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

Android and ANR #1019

Closed
CedricGuillemet opened this issue Mar 4, 2022 · 3 comments
Closed

Android and ANR #1019

CedricGuillemet opened this issue Mar 4, 2022 · 3 comments
Assignees
Milestone

Comments

@CedricGuillemet
Copy link
Contributor

This is an issue under investigation.
ANR stands for Android Not Responding.

While testing a demo with BN on Android, I get a crash after loading the scene. It renders for 1 second or 2 then crashes. I get this error but no callstack, neither with the debugger:

29326/com.android.babylonnative.playground I/tive.playgroun: Thread[5,tid=29326,WaitingInMainSignalCatcherLoop,Thread*=0x7eec5d5800,peer=0x12d40a70,"Signal Catcher"]: reacting to signal 3
29326/com.android.babylonnative.playground I/tive.playgroun: Wrote stack traces to tombstoned

Nothing relevant in the tombstone at first. After some research, some developers get the same error when dealing with ANR. Basically, Android System opens a dialog 'Application not responding...' Just like in the browser when some JS takes too much time. But here, no dialog and a crash.

In the tombstone, there is a directoy containing the ANR dumps. For every test I'm doing, I get an entry when the app crash. So, this seems to be related to ANR.

The Playground doesn't respond properly to ANR, why is there no dialog? Can this happen when loading heavy gltf?
In the ANR dump, I can see work being done on the images (decoding, mipmaps,...). I'll try to repro the crash with a simpler JS that loads a big .jpg and compute mipmaps. Shader parsing (glslang/spriv) also appears in the callstacks. Can it be heavy enough to 'freeze' the app?

The crash happens in Debug or Release (so, might no be only image mipmaps?). The crash seems to be less frequent when attaching a debugger. Why?

@CedricGuillemet
Copy link
Contributor Author

I've tested changing the rendering loop to :

        if (g_graphics)
        {
            g_graphics->StartRenderingCurrentFrame();
            g_update->Start();
            g_update->Finish();
            g_graphics->FinishRenderingCurrentFrame();

        }

Still crashes.

@CedricGuillemet
Copy link
Contributor Author

Loading a 4K texture is enough to repro (debug build). Loading takes time, then renders for a few frames, then crashes.

@thomlucc thomlucc added the 6.0 label Sep 23, 2022
@thomlucc thomlucc modified the milestones: Future, 6.0 Sep 23, 2022
@thomlucc thomlucc removed the 6.0 label Sep 23, 2022
@bghgary bghgary modified the milestones: 6.0, Future Oct 13, 2022
@bghgary
Copy link
Contributor

bghgary commented Sep 6, 2024

Closing for now. If someone hits this, then we can re-open.

Related: #1416

@bghgary bghgary closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants