Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #2
I see same issue and have been debugging it.
NOTE: It DOES NOT happen if not using support package, but use android level 14/15 library. I believe Honeycomb works well too.
My current workaround is to provide my own DialogFragment.show() method, like below:
public int show(FragmentTransaction transaction, String tag) {
return show(transaction, tag, false);
}
public int show(FragmentTransaction transaction, String tag, boolean allowStateLoss) {
transaction.add(this, tag);
mRemoved = false;
mBackStackId = allowStateLoss ? transaction.commitAllowingStateLoss() : transaction.commit();
return mBackStackId;
}
NOTE: It DOES NOT happen if not using support package, but use android level 14/15 library. I believe Honeycomb works well too.
My current workaround is to provide my own DialogFragment.show() method, like below:
public int show(FragmentTransaction transaction, String tag) {
return show(transaction, tag, false);
}
public int show(FragmentTransaction transaction, String tag, boolean allowStateLoss) {
transaction.add(this, tag);
mRemoved = false;
mBackStackId = allowStateLoss ? transaction.commitAllowingStateLoss() : transaction.commit();
return mBackStackId;
}
ju...@gmail.com <ju...@gmail.com> #3
[Comment deleted]
vi...@google.com <vi...@google.com> #4
But Google pls fix this issue, as the expected behaviors must be consistent with ICS DialogFragment + FragmentManager and support package DialogFragment + FragmentManager.
It happens with both Support Package v4 r6 and v13 r6.
It happens with both Support Package v4 r6 and v13 r6.
ju...@gmail.com <ju...@gmail.com> #5
I have this problem too.
As a workaround I use a boolean in the onActivityResult to mark the desired dialog and show the dialog in the onResume.
As a workaround I use a boolean in the onActivityResult to mark the desired dialog and show the dialog in the onResume.
ju...@gmail.com <ju...@gmail.com> #7
This is definitely not a bug. There are times when onActivityResult() can be called before the Activity has restored its saved state... committing fragment transactions in these situations will simply not be remembered as a result (see this blog post: http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html ).
Try moving your commits into "onPostResume()" instead as described here:http://stackoverflow.com/questions/16265733/failure-delivering-result-onactivityforresult/18345899#18345899
Try moving your commits into "onPostResume()" instead as described here:
ds...@google.com <ds...@google.com> #8
Adding a "super.onActivityResult(requestCode, resultCode, data)" call at the beginning of the method seems to fix the problem. I'm surprised than almost nobody came up with such a simple solution.
ju...@gmail.com <ju...@gmail.com> #9
Dear alockw...@google.com,
Let's say we have an application where we need to select a picture from gallery, and then when we come back to onActivityResult(), we need to show a DialogFragment asking the user if he really wants to send the file.
How do you propose we can implement this with the current API?
Thank you,
Sabin
Let's say we have an application where we need to select a picture from gallery, and then when we come back to onActivityResult(), we need to show a DialogFragment asking the user if he really wants to send the file.
How do you propose we can implement this with the current API?
Thank you,
Sabin
Description
1. Apply below checker in StackMapStream::Encode() of stack_map_stream.cc (patch have attached)
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc
index 75e5806..48773ca 100644
--- a/compiler/optimizing/stack_map_stream.cc
+++ b/compiler/optimizing/stack_map_stream.cc
@@ -481,6 +481,7 @@ ScopedArenaVector<uint8_t> StackMapStream::Encode() {
}
});
+
// Verify that we can load the CodeInfo and check some essentials.
size_t number_of_read_bits;
CodeInfo code_info(buffer.data(), &number_of_read_bits);
@@ -491,6 +492,12 @@ ScopedArenaVector<uint8_t> StackMapStream::Encode() {
CHECK_EQ(CodeInfo::IsDebuggable(buffer.data()), debuggable_);
CHECK_EQ(CodeInfo::HasShouldDeoptimizeFlag(buffer.data()), has_should_deoptimize_flag_);
+ auto stackmap_size = code_info.GetNumberOfStackMaps();
+ for (auto i=0u; i<stackmap_size; i++) {
+ if (code_info.GetStackMapAt(i).HasDexRegisterMapIndex())
+ CHECK_LT(code_info.GetStackMapAt(i).GetDexRegisterMapIndex(), code_info.dex_register_maps_.NumRows());
+ }
+
2.
source build/envsetup.sh;
lunch aosp_cf_arm64_phone-trunk_staging-userdebug
m com.android.art
- What happened.
Added Checker check failed during compile boot iamge when running "m com.android.art" as below log:
01-13 11:24:31.240 27640 27723 F dex2oatd: stack_map_stream.cc:498 Check failed: code_info.GetStackMapAt(i).GetDexRegisterMapIndex() < code_info.dex_register_maps_.NumRows() (code_info.GetStackMapAt(i).GetDexRegisterMapIndex()=15, code_info.dex_register_maps_.NumRows()=15)
01-13 11:24:31.261 27640 27779 F dex2oatd: stack_map_stream.cc:498 Check failed: code_info.GetStackMapAt(i).GetDexRegisterMapIndex() < code_info.dex_register_maps_.NumRows() (code_info.GetStackMapAt(i).GetDexRegisterMapIndex()=20, code_info.dex_register_maps_.NumRows()=20)
01-13 11:24:31.267 27640 27640 F dex2oatd: stack_map_stream.cc:498 Check failed: code_info.GetStackMapAt(i).GetDexRegisterMapIndex() < code_info.dex_register_maps_.NumRows() (code_info.GetStackMapAt(i).GetDexRegisterMapIndex()=4, code_info.dex_register_maps_.NumRows()=4)
01-13 11:24:31.288 27640 27767 F dex2oatd: stack_map_stream.cc:498 Check failed: code_info.GetStackMapAt(i).GetDexRegisterMapIndex() < code_info.dex_register_maps_.NumRows() (code_info.GetStackMapAt(i).GetDexRegisterMapIndex()=10, code_info.dex_register_maps_.NumRows()=10)
01-13 11:24:31.289 27640 27718 F dex2oatd: stack_map_stream.cc:498 Check failed: code_info.GetStackMapAt(i).GetDexRegisterMapIndex() < code_info.dex_register_maps_.NumRows() (code_info.GetStackMapAt(i).GetDexRegisterMapIndex()=11, code_info.dex_register_maps_.NumRows()=11)
01-13 11:24:31.291 27640 27784 F dex2oatd: stack_map_stream.cc:498 Check failed: code_info.GetStackMapAt(i).GetDexRegisterMapIndex() < code_info.dex_register_maps_.NumRows() (code_info.GetStackMapAt(i).GetDexRegisterMapIndex()=24, code_info.dex_register_maps_.NumRows()=24)
- What you think the correct behavior should be.
If you agree the added checker have no problem, the checker should not be failed.
Currently it is failed, so I think it is a suspected out of bounds issue.
My investigation:
I added debug code at blow in StackMapStream::CreateDexRegisterMap(), I found sometimes the value of
temp_dex_register_mask_.GetNumberOfBits() will be 0 (see attached investigation.png), dex_register_masks_.Dedup() seems not handle correctly
when second argv is 0, it return the size of the table incorrectly when the second argv is 0 which is filled
into stackmap's DexRegisterMapIndex field incorrectly.
// Set the mask and map for the current StackMap (which includes inlined registers).
if (temp_dex_register_mask_.GetNumberOfBits() != 0) {
current_stack_map_[StackMap::kDexRegisterMaskIndex] =
dex_register_masks_.Dedup(temp_dex_register_mask_.GetRawStorage(),
temp_dex_register_mask_.GetNumberOfBits());
}