-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in libjpeg.so when BitmapFactory.decodeStream called #1058
Comments
Does your app include libjpeg? Is it your obfuscated Java code |
Unfortunately,we can't reproduce this problem. It was happened on some devices. |
You did not answer the specific question: Does this stack start with your obfuscated Java code? Does your app contain some C++ components, too? It could be very helpful for the community if you share the names of offending devices. There may be a bug in some vendor-specific implementations of 64-bit libjpeg.so. Note that on the qualcomm device, this libqc-opt.so is simply a wrapper for the same libjpeg. If the crash reproduce on the same device often, you can try to install a 32-bit version of your app on such device. Will the crashes still happen? |
Thanks. Yes,this stack starts with my obfuscated Java code. And my app also contains some C++ components. Before we supported 64-bit version, we never received this bug report. But now, we have to support 64-bit version in order to publish on Google Play. After that, many reports about this bug appeared. So I am sure that it will not crash with a 32-bit version app. It happened at most on these devices. |
Auch, this hurts. Don't hesitate to write to OPPO and to HTC, let them fix their bugs. I would also suggest you to escalate this issue with your local Google representative. With the new 64-bit regulations, it will definitely hit not only you. As for immediate practical steps… You use split build, don't you? Then you can set (in build.gradle) minSdkVersion for the 64-bit flavor to 26 or even higher. This will exclude the older devices where libjpeg or other 64-bit system libraries may still have glitches. |
Yes, I agree that it looks like a bug in some OPPO devices. |
Hi @alexcohn I am facing a similar issue but I observed Oppo Realme 3Pro (RMX1851), Android 9 was the one device which is from many other brands, Mi A1 (tissot_sprout), Android 9 is the most effective device. It could be specific to Android 9, or latest ndk lib since it is only happening on Android 9 version. |
@srikanthsunkari generally speaking, you can blacklist specific devices for a version on Play Store. Unfortunately, this may become hard to manage if you want to keep the 32-bit flavor of your app available for users with RMX1851 and other problematic devices. |
@alexcohn thank you for your reply, May I know what is RMC1851? |
On Mon, Aug 12, 2019 at 1:48 PM srikanthsunkari ***@***.***> wrote:
@alexcohn <https://github.com/alexcohn> thank you for your reply, May I
know what is RMC1851?
It's my typo. I wanted to write RMX1851.
… |
@alexcohn , One of our lib uses ndk, But this issue is not from that lib or from our stack trace It is completely from ndk lib. |
@srikanthsunkari as I wrote above, this seems to be a bug in OPPO system: the way the built the 64-bit libjpeg.so (a system library) has some fault. |
Thanks a bunch for the help as always, @alexcohn I sent this thread along to the PM tracking 64-bit transition issues. Given that this appears to be a device-specific issue, I'm not sure there's much we can do on our end short of documenting the advice @alexcohn gave in #1058 (comment) |
@alexcohn: Where'd you get 26 from? Is that a guess based on those devices all being 25 or lower (I haven't checked all of them), or is there some indication that this was fixed in that release? We clearly have a missing CTS test somewhere, I'm just not sure what that test is without knowing how to repro. |
@DanAlbert the devices listed in the original table are all 25 and lower. Then came @srikanthsunkari with Realme 3 Pro from the same manufacturer, but with API 28, so my suggestion happens to have been too optimistic. This is really a 64-bit transition issue. Note that it may be extremely hard for indie developers to handle such rare crashes on a rather exotic phone. I hope that with Google's resources, you can find what really happens in 64-bit Jpeg decoder on these devices. There is a slim chance that the affected apps have some very specific Jpeg resources that trigger the crash, but more likely these libs were built with some wrong combination of flags and tools. For example, it could be that OPPO chose to use libjpeg while AOSP has switched to libjpeg-turbo some while ago. I believe that for an individual developer who is haunted by such crash there is no real harm in setting minSdkVersion to 30, effectively opting out from the forced transition to 64-bit for the meanwhile. Methinks, such workaround should not be considered illegitimate on Play Store. On the other hand, even before fixing the bug in Jpeg decoder, it is in power of Play Store to
|
It definitely looks to me like there's more than one bug being discussed here. Could be that your suggestion is correct for working around a subset of them. |
Found https://stackoverflow.com/q/57412918/632035, which is probably the other crash, and yeah, that's yet another different stack trace. It is always possible that this is actually just a case of memory corruption in the app that is causing a segfault later on. ASan might help if that is the case. Don't have enough information to know if that's the problem or if this actually is a device bug. |
Hi, @DanAlbert @alexcohn I managed to pull crash report here from my device which happens randomly, can you conclude something from this report? |
@srikanthsunkari It seems that the crash happens while the surface is not ready:
compare this to
Also the name |
Thank you @alexcohn means issue may be due to my code changes? If so, since it is not reproducible any suggestion for this? |
This could be some delicate time race, and it may be beyond your control. How often is this crash reproduced? How is it distributed across devices, OS versions, whatever? Crashlytics has a lot of helpful hints for you. Actually, when you look at the full statistics, you can usually see that there are some crashes that have no rational explanation. If they affect less than 1 in 10000 active users, you can probably just ignore them (unless this 1 user happens to be your boss). |
Just to be sure: the switch to 64-bit is the only variable that changed when this crash started appearing? It wasn't the same release that also did something like switch to app bundles/APK splits, updated your NDK, switched compilers, or some other change? I'm guessing not, but someone asked so I wanted to clarify. |
After so many test cases, crash is always reproducible after we increased the SurfaceView instances > 6 in the layout, and leaving the SurfaceView tag without visibility tag. |
Yes, we have had the change for the 64-bit flavor support, but no splits. And it is observed that only after this apk we have had this crash. And it happens only in OS 9.0 and above.
|
@DanAlbert note that there are at least 3 distinct cases discussed in this thread |
@srikanthsunkari it's not clear: on devices with OS version <9, you can open more surfaces than on Android 9, can't you? Also, on Android 9, you can open more surfaces when you force 32-bit bundle? |
This is not happening on below Android 9 (32-bit) devices.
Android 9 with 32-bit bundle APK also this crash produces. |
Given the error message it doesn't sound like the crash you're seeing is a bug, but just a limit you've exceeded. |
@DanAlbert would you confirm that this limit is from vendors implementation and not from the ndk? If it is from ndk it has to be handled and thrown a readable message from the android framework, not from ndk. |
I can guarantee it's not from the NDK. Your stack trace is Java. |
It doesn't seem like there's an NDK bug here, so closing. If that's wrong, lmk and we can reopen, but it sounds more like device bugs. |
Since we need to support 64bit CPU in order to publish on Google Play.Then we found a strange crash happened in libjpeg.so in some devices(arm64-v8a).
Some logs are below:
Any ideas? Thanks a lot.
The text was updated successfully, but these errors were encountered: