Android render crash (SOLVED)

Hi guys, Im struggling with crash on android anybody can tell me why this might happens:

2020-05-06 19:03:02.266 14161-14203/rocks.mpgames.travelblast E/Parcel: fcntl(F_DUPFD_CLOEXEC) failed in Parcel::read, i is 0, fds[i] is -1, fd_count is 1, error: Bad file descriptor
2020-05-06 19:03:02.347 14161-14245/rocks.mpgames.travelblast D/AudioTrack: stop() called with 257280 frames delivered
2020-05-06 19:03:02.476 14161-14203/rocks.mpgames.travelblast D/graphic: #00 pc 0000000000670c24  /vendor/lib64/egl/libGLES_mali.so (gc_utils_callstack+36)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #01 pc 0000000000829f84  /vendor/lib64/egl/libGLES_mali.so (gles_state_set_mali_error_internal+96)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #02 pc 00000000007f0460  /vendor/lib64/egl/libGLES_mali.so (gles_fb_first_operation_cb+312)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #03 pc 00000000007e8440  /vendor/lib64/egl/libGLES_mali.so (glesx_fbp_prepare_to_render+52)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #04 pc 00000000007ef0d0  /vendor/lib64/egl/libGLES_mali.so (gles_fbp_clear+128)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #05 pc 00000000007ed9b0  /vendor/lib64/egl/libGLES_mali.so (gles_fb_clear+284)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #06 pc 00000000007d5838  /vendor/lib64/egl/libGLES_mali.so (glClear+96)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #07 pc 00000000000fde90  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (dmGraphics::Clear(dmGraphics::Context*, unsigned int, unsigned char, unsigned char, unsigned char, unsigned char, float, unsigned int)+280)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #08 pc 0000000000115718  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (dmRender::ParseCommands(dmRender::RenderContext*, dmRender::Command*, unsigned int)+256)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #09 pc 0000000000114f6c  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (dmRender::UpdateRenderScriptInstance(dmRender::RenderScriptInstance*, float)+172)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #10 pc 000000000009bf68  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (dmEngine::Step(dmEngine::Engine*)+804)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #11 pc 00000000000fdb24  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (dmGraphics::RunApplicationLoop(void*, void (*)(void*), int (*)(void*))+32)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #12 pc 000000000009cc08  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (_ZN8dmEngine6LaunchEiPPcPFvPNS_6EngineEPvES6_S4_+200)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #13 pc 00000000000995e8  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (engine_main(int, char**)+132)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #14 pc 000000000005eed8  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (main+28)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #15 pc 00000000001e69a8  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (_glfwPreMain+180)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #16 pc 000000000005eefc  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (android_main+20)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #17 pc 00000000001e9dbc  /data/app/rocks.mpgames.travelblast-QSnH2JxobHeHoGPTkeqS1Q==/lib/arm64/libTravelBlast.so (android_app_entry+168)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #18 pc 0000000000083588  /system/lib64/libc.so (__pthread_start(void*)+36)
2020-05-06 19:03:02.477 14161-14203/rocks.mpgames.travelblast D/graphic: #19 pc 00000000000241dc  /system/lib64/libc.so (__start_thread+68)
2020-05-06 19:03:02.478 14161-14203/rocks.mpgames.travelblast E/defold: ERROR:GRAPHICS: gl error 1285
    
    
    
    --------- beginning of crash
2020-05-06 19:03:02.478 14161-14203/rocks.mpgames.travelblast A/libc: ../src/opengl/graphics_opengl.cpp:963: void dmGraphics::Clear(dmGraphics::HContext, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, float, uint32_t): assertion "0" failed
2020-05-06 19:03:02.520 14161-14203/rocks.mpgames.travelblast I/defold: INFO:CRASH: Successfully wrote Crashdump to file: /data/user/0/rocks.mpgames.travelblast/files/_crash
2020-05-06 19:03:02.520 14161-14203/rocks.mpgames.travelblast E/defold: ERROR:CRASH: CALL STACK:
    
    # 0 pc        0x690 [vdso] <unknown>+0
    # 1 pc      0x22984 /system/lib64/libc.so abort+112

Are you using any native extensions? Are you generating debug symbols when you make your apk?

Yes, Im using lot of native extensions, this log is from apk with debug symbols, crash is non consistent very hard to reproduce (happens randomly in fact) and I have another issue I think related to this one:

2020-04-30 18:42:34.772 18562-18616/rocks.mpgames.travelblast E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -22
2020-04-30 18:42:34.772 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 3003
2020-04-30 18:42:34.780 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B
2020-04-30 18:42:34.841 18562-18616/rocks.mpgames.travelblast I/chatty: uid=10165(rocks.mpgames.travelblast) Thread-5557 identical 12 lines
2020-04-30 18:42:34.846 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B
2020-04-30 18:42:34.850 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B
2020-04-30 18:42:35.605 18562-18616/rocks.mpgames.travelblast I/chatty: uid=10165(rocks.mpgames.travelblast) Thread-5557 identical 295 lines
2020-04-30 18:42:35.607 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B
2020-04-30 18:42:35.609 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B
2020-04-30 18:42:35.874 18562-18616/rocks.mpgames.travelblast I/chatty: uid=10165(rocks.mpgames.travelblast) Thread-5559 identical 109 lines
2020-04-30 18:42:35.876 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B
2020-04-30 18:42:35.878 18562-18616/rocks.mpgames.travelblast W/glfw-android: eglSwapBuffers failed, eglGetError: 300B

In this case app still working properly just render stops

With that first callstack, I suspect something related to the graphics driver?
Here’s a google search showing the same callstack.

Is your second log using a mali device as well?

To be honest, I have no real suggestions here.

Do you have a custom render script? What does it look like? Any special render.clear()?
Any special/extra render targets?

Second log is from android, arm64
Here is the render script:
rendercam.render_script.script (2.8 KB)

I was asking about the graphics card that Android device was using? (Since this seems a bit like a graphics driver issue)

Thx for the render script.
Could you test clearing all the bits in your render.clear() call, to see if that makes a difference?

1 Like