Skip to content
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

bug(android): application hang detected #13310

Open
sentry-io bot opened this issue Feb 21, 2025 · 10 comments
Open

bug(android): application hang detected #13310

sentry-io bot opened this issue Feb 21, 2025 · 10 comments

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 21, 2025

Sentry Issue: KEYMAN-ANDROID-4J

SIGTRAP: Trap
  ?
  ?
  ?
  ?
  ?
...
(9 additional frame(s) were not displayed)

Web searches tend to strongly correlate this with an "ANR" - Application Not Responding - as Android tends to put it.

No Keyman or KeymanEngine stack frames appear in the stacktrace; our libraries don't even appear under "images".

@jahorton
Copy link
Contributor

OS Version: Android 9 (PPR1.180610.011.J730GDXUDCUE2)
Report Version: 104

Exception Type: Unknown (SIGTRAP)

Application Specific Information:
Trap

Thread 0 Crashed:
0   base.apk                        0xd41ac9f8          <unknown> + 3558525432
1   base.apk                        0xd3373b9d          <unknown> + 3543612317
2   base.apk                        0xd35b21c7          <unknown> + 3545964999
3   base.apk                        0xd232a715          <unknown> + 3526534933
4   base.apk                        0xd3cf87c5          <unknown> + 3553593285
5   base.apk                        0xd3cf766f          <unknown> + 3553588847
6   base.apk                        0xd33876a7          <unknown> + 3543692967
7   base.apk                        0xd4641c95          <unknown> + 3563330709
8   base.apk                        0xd4641c69          <unknown> + 3563330665
9   base.apk                        0xd3393d8f          <unknown> + 3543743887
10  libutils.so                     0xeb91033f          android::Looper::pollInner
11  libutils.so                     0xeb910043          android::Looper::pollOnce
12  libandroid_runtime.so           0xec3b24e9          <unknown> + 3963299049
13  boot-framework.oat              0x72252ccd          <unknown> + 1915038925

@jahorton
Copy link
Contributor

There are potentially-related issues I can find that lightly suggest there could be something WebView related here.

After seeing the latter link above, I asked @darcywong00 to check into it via the Play console, but he was unable to find anything clearly correlated in the manner described by that post.

"not seeing a WebView issue"

That request was on 2025-01-28.

@jahorton
Copy link
Contributor

There are some links that pop up talking about the NDK, but those should be ignored. Native Development Kit.

Copy link
Author

sentry-io bot commented Feb 25, 2025

Sentry Issue: KEYMAN-ANDROID-39Y

io.sentry.android.core.ApplicationNotResponding: Application Not Responding for at least 5000 ms.
    at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
    at android.os.MessageQueue.next(MessageQueue.java:325)
    at android.os.Looper.loop(Looper.java:142)
    at android.app.ActivityThread.main(ActivityThread.java:6549)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)

Current example event's breadcrumbs:

Exception

- This event
error
10:52:15.000 AM
ApplicationNotResponding: Application Not Responding for at least 5000 ms.

10:52:00.347 AM
.initialize() call complete

10:52:00.342 AM
attempting CloudDownloadMgr.initialize()
{
  stacktrace: [
    com.keyman.engine.cloud.CloudDownloadMgr.initialize(CloudDownloadMgr.java:64),
    com.keyman.engine.KMManager.initialize(KMManager.java:443),
    com.keyman.android.SystemKeyboard.onCreate(SystemKeyboard.java:70),
    android.app.ActivityThread.handleCreateService(ActivityThread.java:3381),
    android.app.ActivityThread.-wrap4(Unknown Source:0),
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1712),
    android.os.Handler.dispatchMessage(Handler.java:106),
    android.os.Looper.loop(Looper.java:164),
    android.app.ActivityThread.main(ActivityThread.java:6549),
    java.lang.reflect.Method.invoke(Native Method)
  ]
}

10:52:00.271 AM
CloudDownloadMgr.createInstance() - first call
{
  stacktrace: [
    com.keyman.engine.cloud.CloudDownloadMgr.createInstance(CloudDownloadMgr.java:43),
    com.keyman.engine.cloud.CloudDownloadMgr.getInstance(CloudDownloadMgr.java:32),
    com.keyman.engine.KMManager.initialize(KMManager.java:443),
    com.keyman.android.SystemKeyboard.onCreate(SystemKeyboard.java:70),
    android.app.ActivityThread.handleCreateService(ActivityThread.java:3381),
    android.app.ActivityThread.-wrap4(Unknown Source:0),
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1712),
    android.os.Handler.dispatchMessage(Handler.java:106),
    android.os.Looper.loop(Looper.java:164),
    android.app.ActivityThread.main(ActivityThread.java:6549)
  ]
}

Examining another event, the same breadcrumbs appear far back in history, with a lot of more recent "screen on" / "screen off" / "low memory" / "orientation changed" device-state breadcrumbs. So... we're probably not in ANR mode during engine init for that case.

Copy link
Author

sentry-io bot commented Feb 25, 2025

Sentry Issue: KEYMAN-ANDROID-6CB

And now for a completely different ANR case:

io.sentry.android.core.ApplicationNotResponding: Application Not Responding for at least 5000 ms.
    at J.N._V(chromium-TrichromeWebViewGoogle.aab-stable-683416331)
    at org.chromium.content.browser.BrowserStartupControllerImpl.c(chromium-TrichromeWebViewGoogle.aab-stable-683416331:136)
    at WV.f6.run(chromium-TrichromeWebViewGoogle.aab-stable-683416331:229)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.chromium.base.task.PostTask.d(chromium-TrichromeWebViewGoogle.aab-stable-683416331:12)
    at org.chromium.android_webview.AwBrowserProcess.j(chromium-TrichromeWebViewGoogle.aab-stable-683416331:33)
    at com.android.webview.chromium.N.e(chromium-TrichromeWebViewGoogle.aab-stable-683416331:217)
    at com.android.webview.chromium.N.b(chromium-TrichromeWebViewGoogle.aab-stable-683416331:42)
    at com.android.webview.chromium.N.g(chromium-TrichromeWebViewGoogle.aab-stable-683416331:5)
    at com.android.webview.chromium.WebViewChromiumFactoryProvider.m(chromium-TrichromeWebViewGoogle.aab-stable-683416331:8)
    at com.android.webview.chromium.WebViewChromium.init(chromium-TrichromeWebViewGoogle.aab-stable-683416331:97)
    at android.webkit.WebView.<init>(WebView.java:443)
    at android.webkit.WebView.<init>(WebView.java:363)
    at android.webkit.WebView.<init>(WebView.java:345)
    at android.webkit.WebView.<init>(WebView.java:332)
    at android.webkit.WebView.<init>(WebView.java:322)
    at com.keyman.engine.util.WebViewUtils.getChromeVersion(WebViewUtils.java:97)
    at com.keyman.engine.util.WebViewUtils.getEngineWebViewVersionStatus(WebViewUtils.java:42)
    at com.keyman.engine.KMManager.copyAssets(KMManager.java:858)
    at com.keyman.engine.KMManager.initialize(KMManager.java:424)
    at com.keyman.android.SystemKeyboard.onCreate(SystemKeyboard.java:70)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4655)
    at android.app.ActivityThread.access$1800(ActivityThread.java:283)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2194)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:231)
    at android.os.Looper.loop(Looper.java:338)
    at android.app.ActivityThread.main(ActivityThread.java:8065)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:579)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

Copy link
Author

sentry-io bot commented Feb 25, 2025

Sentry Issue: KEYMAN-ANDROID-6CZ

More ANRs for the party:

io.sentry.android.core.ApplicationNotResponding: Application Not Responding for at least 5000 ms.
    at android.content.res.AssetManager.nativeList(AssetManager.java)
    at android.content.res.AssetManager.list(AssetManager.java:908)
    at com.keyman.engine.KMManager.copyAssets(KMManager.java:935)
    at com.keyman.engine.KMManager.initialize(KMManager.java:424)
    at com.keyman.android.SystemKeyboard.onCreate(SystemKeyboard.java:70)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4043)
    at android.app.ActivityThread.access$1700(ActivityThread.java:235)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:225)
    at android.app.ActivityThread.main(ActivityThread.java:7563)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)

Copy link
Author

sentry-io bot commented Feb 25, 2025

Sentry Issue: KEYMAN-ANDROID-5EH

io.sentry.android.core.ApplicationNotResponding: Application Not Responding for at least 5000 ms.
    at android.os.BinderProxy.transactNative(BinderProxy.java)
    at android.os.BinderProxy.transact(BinderProxy.java:605)
    at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:6676)
    at android.app.ActivityThread.acquireProvider(ActivityThread.java:7718)
    at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:3071)
    at android.content.ContentResolver.acquireProvider(ContentResolver.java:2442)
    at android.content.ContentResolver.insert(ContentResolver.java:2153)
    at android.content.ContentResolver.insert(ContentResolver.java:2121)
    at android.app.DownloadManager.enqueue(DownloadManager.java:1574)
    at com.keyman.engine.cloud.CloudDownloadMgr.executeAsDownload(CloudDownloadMgr.java:244)
    at com.keyman.engine.data.CloudRepository.downloadMetaDataFromServer(CloudRepository.java:408)
    at com.keyman.engine.data.CloudRepository.initializeDataSet(CloudRepository.java:228)
    at com.keyman.engine.logic.ResourcesUpdateTool.checkResourceUpdatesInternal(ResourcesUpdateTool.java:134)
    at com.keyman.engine.logic.ResourcesUpdateTool.access$700(ResourcesUpdateTool.java:46)
    at com.keyman.engine.logic.ResourcesUpdateTool$6.run(ResourcesUpdateTool.java:469)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:246)
    at android.app.ActivityThread.main(ActivityThread.java:8587)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

@jahorton
Copy link
Contributor

It's unclear whether any of these ANR event sources is directly tied to the original Sentry crash depicted in the description. That said, if the ANR state is generally reached before the SIGTRAP / kill signal crashes the app, these seem to be our best leads.

There are admittedly a remarkable amount of them centered around WebView access, init, and version-checking.

@jahorton
Copy link
Contributor

While oriented to Android apps using the Unity game engine, I found the first example on this link to be potentially useful: https://developer.android.com/games/engines/unity/unity-anrs-list

I've seen almost that exact stack trace in some of the ANRs viewable through Sentry.

@jahorton
Copy link
Contributor

A general-purpose ANR page: https://developer.android.com/topic/performance/vitals/anr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant