WordPress-Android icon indicating copy to clipboard operation
WordPress-Android copied to clipboard

JniAndroid$UncaughtExceptionException: Native stack trace:

Open sentry-io[bot] opened this issue 1 year ago • 37 comments

Sentry Issue: JETPACK-ANDROID-J3B

Surface$OutOfResourcesException: None
    at android.view.SurfaceControl.nativeCreate(SurfaceControl.java)
    at android.view.SurfaceControl.<init>(SurfaceControl.java:1038)
    at android.view.SurfaceControl.<init>(SurfaceControl.java:86)
    at android.view.SurfaceControl$Builder.build(SurfaceControl.java:693)
    at android.view.View.startDragAndDrop(View.java:27229)
...
(8 additional frame(s) were not displayed)

JniAndroid$UncaughtExceptionException: Native stack trace:
#00 pc 0x0000000003cb82b7 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#01 pc 0x0000000002bb566f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#02 pc 0x0000000002bb4d57 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#03 pc 0x0000000007073447 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#04 pc 0x00000000054fdd1f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#05 pc 0x00000000053b8b63 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#06 pc 0x00000000053956f3 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#07 pc 0x0000000003984603 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#08 pc 0x0000000002bd169f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#09 pc 0x0000000002bd0f6b /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#10 pc 0x0000000002bd121f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#11 pc 0x0000000002a7b41f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#12 pc 0x0000000002a7b2d7 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#13 pc 0x0000000002b6bc4f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#14 pc 0x0000000002b6696f /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#15 pc 0x0000000003aa3bc3 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#16 pc 0x0000000003aa3b47 /data/app/~~edjQkLFlZwvqNMeJWfgDKw==/com.google.android.trichromelibrary_616714333-9frhU_h0WwVrsnVaP0qSbg==/base.apk (offset 0x8dc000)
#17 pc 0x000000000000b067 /system/lib64/libutils.so
#18 pc 0x000000000000ac6b /system/lib64/libutils.so
#19 pc 0x000000000007cb3f /system/lib64/libandroid_runtime.so

    at org.chromium.base.JniAndroid.handleException(chromium-TrichromeWebViewGoogle6432.aab-stable-616714333:11)
    at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
    at android.os.MessageQueue.next(MessageQueue.java:335)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:8131)
...
(3 additional frame(s) were not displayed)

sentry-io[bot] avatar Feb 08 '24 11:02 sentry-io[bot]

Sentry issue: WORDPRESS-ANDROID-2TTG

sentry-io[bot] avatar Feb 08 '24 11:02 sentry-io[bot]

Sentry issue: JETPACK-ANDROID-HNP

sentry-io[bot] avatar Feb 08 '24 11:02 sentry-io[bot]

Sentry issue: JETPACK-ANDROID-HN0

sentry-io[bot] avatar Feb 08 '24 11:02 sentry-io[bot]

Sentry issue: WORDPRESS-ANDROID-2T29

sentry-io[bot] avatar Feb 08 '24 11:02 sentry-io[bot]

Noting that this often appears as a new crash due to the fact it comes up in numerous different areas. All of these Sentry reports show a comment Resources$NotFoundException: Resource ID #0x90c0006 error in the logs, indicating a common resource issue. Setting the priority as Medium. It's tricky to determine the specific number of times this has occurred, but there are numerous Sentry reports indicating that this is a fairly widespread issue.

SiobhyB avatar Feb 08 '24 11:02 SiobhyB

Sentry issue: JETPACK-ANDROID-FQB

sentry-io[bot] avatar Feb 12 '24 01:02 sentry-io[bot]

Sentry issue: JETPACK-ANDROID-J8R

sentry-io[bot] avatar Feb 12 '24 01:02 sentry-io[bot]

Sentry issue: WORDPRESS-ANDROID-2V0V

sentry-io[bot] avatar Feb 12 '24 01:02 sentry-io[bot]

Sentry issue: WORDPRESS-ANDROID-2V85

sentry-io[bot] avatar Feb 12 '24 01:02 sentry-io[bot]

Sentry issue: WORDPRESS-ANDROID-2TKN

sentry-io[bot] avatar Feb 12 '24 01:02 sentry-io[bot]

Sentry issue: WORDPRESS-ANDROID-2V5H

sentry-io[bot] avatar Feb 12 '24 01:02 sentry-io[bot]

I collected all the reports of JniAndroid$UncaughtExceptionException from Sentry and linked all of the ones I could find that included Resources$NotFoundException that seemed related:

Issue Events Users
WORDPRESS-ANDROID-2T29 172 126
JETPACK-ANDROID-FQB 191 141
JETPACK-ANDROID-J8R 1 1
JETPACK-ANDROID-HNP 32 28
WORDPRESS-ANDROID-2TTG 24 24
WORDPRESS-ANDROID-2V0V 3 3
WORDPRESS-ANDROID-2V85 1 1
JETPACK-ANDROID-J3B 1 1
JETPACK-ANDROID-HN0 13 13
WORDPRESS-ANDROID-2TKN 7 7
WORDPRESS-ANDROID-2V5H 6 6
451 351

While this often appears as a new crash as @SiobhyB noted, the oldest issue I could find first appeared in 23.7.1. Keeping Medium Priority per the matrix.

derekblank avatar Feb 12 '24 02:02 derekblank

Given that the crash is affecting app versions as old as 21.5 I think that the recent surge is unlikely related with our app. The stack trace of the crash

android.content.res.Resources$NotFoundException: Resource ID #0x20c0006
    at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:254)
    at android.content.res.Resources.getInteger(Resources.java:1209)
    at org.chromium.ui.base.DeviceFormFactor.isTablet(chromium-TrichromeWebViewGoogle6432.aab-stable-616714333:9)

also looks similar with this Google issue but I opened a new one since the recent crashes might indicate that a recent WebView version is causing this.

antonis avatar Feb 12 '24 10:02 antonis

Checking the issue on Android Vitals the spike started on January 26th around the time that 121.0.6167 version of WebView was released. Screenshot 2024-02-13 at 10 37 47 AM

antonis avatar Feb 13 '24 08:02 antonis

Following up on our discussion (ref p1708008049877909/1707711421.715029-slack-C012H19SZQ8) and the responses from Google we think that the issue is more of a crash reporting change and not a new crash. I'll keep the issue open and continue monitoring how the crashes trend evolves.

antonis avatar Feb 15 '24 15:02 antonis

While investigating this issue I noticed that some of the Chromium related crashes appear when we try to get the default user agent

Screenshot 2024-02-23 at 2 18 29 PM

We can probably avoid this type of crash by catching the RuntimeException thrown and provide a "default" default user agent. A question would be what an appropriate "default" user agent would be so that our API and WebViews work as expected 🤔

edit: raised for discussion internally pcdRpT-5Us-p2

antonis avatar Feb 23 '24 12:02 antonis

Sentry Issue: WORDPRESS-ANDROID-2VFY

This issue is an ANR but it seems to have been caused by the same root cause related to the chromium library. I'm linking to this issue so we can have the full investigation history about the main root cause and the possible solutions and workarounds implemented.

sentry-io[bot] avatar Mar 01 '24 01:03 sentry-io[bot]

Sentry Issue: JETPACK-ANDROID-JSB

sentry-io[bot] avatar Mar 01 '24 02:03 sentry-io[bot]

Sentry Issue: JETPACK-ANDROID-JVQ

sentry-io[bot] avatar Mar 01 '24 02:03 sentry-io[bot]

Following up on our discussion (ref p1708008049877909/1707711421.715029-slack-C012H19SZQ8) and the responses from Google we think that the issue is more of a crash reporting change and not a new crash. I'll keep the issue open and continue monitoring how the crashes trend evolves.

I took another snapshot of the old and the new crash report numbers and I believe that our overall crash rate is not affected significantly since the spiking new issue almost matches the drop of crashes in the old issue.

  • New: chromium-TrichromeWebViewGoogle6432.aab-stable-616714433 - org.chromium.ui.base.DeviceFormFactor.isTablet
  • Old: [base.apk!libmonochrome_64.so] SIGTRAP
Screenshot 2024-03-01 at 12 10 56 PM Screenshot 2024-03-01 at 12 10 38 PM

I think there is no action on our side other than expecting the new WebView M123 sometime in mid-March.

antonis avatar Mar 01 '24 10:03 antonis

Sentry Issue: JETPACK-ANDROID-HPJ

sentry-io[bot] avatar Mar 19 '24 09:03 sentry-io[bot]

Sentry Issue: WORDPRESS-ANDROID-2WA6

sentry-io[bot] avatar Mar 21 '24 07:03 sentry-io[bot]

Sentry Issue: JETPACK-ANDROID-MPQ

sentry-io[bot] avatar Mar 21 '24 07:03 sentry-io[bot]

Sentry Issue: WORDPRESS-ANDROID-2WA4

sentry-io[bot] avatar Mar 21 '24 08:03 sentry-io[bot]

I think there is no action on our side other than expecting the new WebView M123 sometime in mid-March.

The expected new Webview release arrived a few days ago. There is no change in the recorder crashes yet but it may take some time to rollout and notice a difference 🤞

antonis avatar Mar 26 '24 15:03 antonis

Sentry Issue: JETPACK-ANDROID-KAM

sentry-io[bot] avatar Mar 27 '24 16:03 sentry-io[bot]

The expected new Webview release arrived a few days ago. There is no change in the recorder crashes yet but it may take some time to rollout and notice a difference 🤞

I've added the webview version in the crash reports with https://github.com/wordpress-mobile/WordPress-Android/pull/20533 to be able to measure if the new release has an impact on the crashes.

antonis avatar Mar 28 '24 08:03 antonis

Sentry Issue: WORDPRESS-ANDROID-2VYY

sentry-io[bot] avatar Apr 01 '24 07:04 sentry-io[bot]

While investigating this issue I noticed that some of the Chromium related crashes appear when we try to get the default user agent

The WORDPRESS-ANDROID-2VYY ANR is related to the fix :( The ANR is related to a know limitation of the getDefaultUserAgent call https://issuetracker.google.com/issues/289118199#comment9

I'll track the user agent retrieval related ANRs in https://github.com/wordpress-mobile/WordPress-Android/issues/12259

antonis avatar Apr 01 '24 07:04 antonis