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
Hi Bram,
Thanks for the report, do you have any finer grained information on specific devices/build versions that are affected?
Chris
Thanks Chris,
Here are some devices that are affected:
Mostly cheap knock offs running 4.1, except for the Samsung Galaxy devices running 4.2
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
Thanks for the detailed report Bram, I've made a ticket internally, which is MPDDEVREL-1023 in case you need to quote it. We'll do our best to provide a workaround for the affected devices.
Do you have an update on case MPDDEVREL-1023 for me?
Could you reproduce the crash?
Thanks.
Hi bram,
This is on my Todo list for this week, might even get around to it today!
Having some trouble finding a 4.2.0 stock image for Galaxy S3 which is what I'm going to have to reproduce on, do you know if the bug is present in 4.2.1 or 4.2.2 as those are available online, or even 4.1.2 as we have a copy of that internally?
Are those android version nrs you speak of?Google Play dashboard just lists it as 4.2. (I think it may ignore sub versions.)
Here is a list of instances of the last few days.
Galaxy Tab3 is listed a few times, so if you have that one lying around, try that one.
Also of the users that emailed me: some were running stock, some were running a modified image (CM10.1), so it can occur on either.
by Android version
by device
Also note: google developer console lets you filter bug reports on these android version nrs.
As you can see, nothing more specific than 4.2.
So I expect that all 4.2.x occurrences are lumped together.
This means that it would not surprise me if it occurs on 4.2.anything.
Any progress on this?
thx
Sorry for delay, GDC and waiting for a Tab3 have gotten in the way somewhat. I'm still waiting on the Tab3 so decided to hunt a little harder for S3 4.2 roms, but I'm coming up with nothing on sammobile, so will try with 4.1.2 to see if I can reproduce with that.
Couldn't reproduce it on the S3 4.1.2, that just gives me a blank screen and touch events get passed to the screen the app was launched from, not the app itself. Reproduced it exactly on my CM10 SGS2 though, so will take a detailed look at that.
I've asked the driver team if there are any known workarounds for affected devices, but they are quite busy at the moment so might take a week or two.
Do you have a smaller reproducer perhaps? The driver team are asking for one to help speed things up.