This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hanging app in shim_glBindFramebuffer() from libMali.so

Hi there,

I have an Android app with 3M+ downloads, and I get frequent 'Application Not Responding' crash reports.

When I examine these, my main thread always hangs waiting for futex in shim_glBindFramebuffer() of libMali.so

What could be causing this call to dead lock?

This is the callstack, identical in all reports. I get 15 reports per day or so.

"Thread-515" prio=5 tid=10 NATIVE

| group="main" sCount=1 dsCount=0 obj=0x41f22ff0 self=0x40f11758

| sysTid=14087 nice=0 sched=0/0 cgrp=apps handle=1550005552

| schedstat=( 0 0 0 ) utm=52 stm=13 core=1

#00 pc 0000dce0 /system/lib/libc.so (__futex_syscall3+8)

#01 pc 000121bc /system/lib/libc.so

#02 pc 000589e8 /system/lib/libMali.so

#03 pc 00066b9c /system/lib/libMali.so

#04 pc 00019464 /system/lib/libMali.so

#05 pc 00019810 /system/lib/libMali.so

#06 pc 0003b2c0 /system/lib/libMali.so (shim_glBindFramebuffer+72)

#07 pc 00033ed3 /data/data/com.steenriver.littlecrane/lib/liblittlecrane.so (android_main+178)

#08 pc 00034327 /data/data/com.steenriver.littlecrane/lib/liblittlecrane.so

#09 pc 00012e60 /system/lib/libc.so (__thread_entry+48)

#10 pc 000125b8 /system/lib/libc.so (pthread_create+172)

#11 pc 000004a4 <unknown>

at dalvik.system.NativeStart.run(Native Method)

Thanks,

  Bram Stolk

Parents
  • With the help of a customer, I've narrowed down the cause to shadow mapping.

    When I render the light view to a z-texture, and then use this texture to render the camera view in the standard framebuffer, the app will hang.

    If I skip the render to texture, there is no crash.

    I create the depth texture using:

            // create the framebuffer

            glGenFramebuffers( 1, &shadowFramebuffer );

            glBindFramebuffer( GL_FRAMEBUFFER, shadowFramebuffer );

            // create the texture

            glGenTextures( 1, &shdw_texture );

            glBindTexture( GL_TEXTURE_2D, shdw_texture );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,  GL_CLAMP_TO_EDGE );

            glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOWBUFFERSIZE, SHADOWBUFFERSIZE, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0 );

            glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, shdw_texture, 0 );

            GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER) ;

    The status returned is GL_FRAMEBUFFER_COMPLETE.

    And the ES2 config I use is 8/8/8/24 bits.

    The shadowbuffer has size 512x512 texels.

    To repro on an affected device:

    Go to Google Play store, and search for 'Little Crane'.

    Install the free game 'The Little Crane That Could'

    Launch any level from the main menu.

    After 5s, Application Not Responding occurs, with main thread waiting in shim_glBindFramebuffer()

    non Mali devices run fine.

    Lastly: note that there is no color attachment attached to the frame buffer.

    Normally this is fine, but maybe Mali cannot render to texture without a colour channel?

      Bram

Reply
  • With the help of a customer, I've narrowed down the cause to shadow mapping.

    When I render the light view to a z-texture, and then use this texture to render the camera view in the standard framebuffer, the app will hang.

    If I skip the render to texture, there is no crash.

    I create the depth texture using:

            // create the framebuffer

            glGenFramebuffers( 1, &shadowFramebuffer );

            glBindFramebuffer( GL_FRAMEBUFFER, shadowFramebuffer );

            // create the texture

            glGenTextures( 1, &shdw_texture );

            glBindTexture( GL_TEXTURE_2D, shdw_texture );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );

            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,  GL_CLAMP_TO_EDGE );

            glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOWBUFFERSIZE, SHADOWBUFFERSIZE, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0 );

            glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, shdw_texture, 0 );

            GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER) ;

    The status returned is GL_FRAMEBUFFER_COMPLETE.

    And the ES2 config I use is 8/8/8/24 bits.

    The shadowbuffer has size 512x512 texels.

    To repro on an affected device:

    Go to Google Play store, and search for 'Little Crane'.

    Install the free game 'The Little Crane That Could'

    Launch any level from the main menu.

    After 5s, Application Not Responding occurs, with main thread waiting in shim_glBindFramebuffer()

    non Mali devices run fine.

    Lastly: note that there is no color attachment attached to the frame buffer.

    Normally this is fine, but maybe Mali cannot render to texture without a colour channel?

      Bram

Children