Forums - eglTerminate crashes on Adreno 320

4 posts / 0 new
Last post
eglTerminate crashes on Adreno 320
damien.dejean
Join Date: 12 Dec 12
Posts: 5
Posted: Mon, 2013-10-07 00:56

Hello,

I'm facing a issue with a crash in eglTerminate: when my application ends, the program crashes in eglTerminate destroying egl images. It reproduces on LG Nexus 4, Adreno 320, here is a stacktrace sample:

W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
W/Adreno200-GSL( 4785): <ioctl_kgsl_sharedmem_free:1486>: kgsl_sharedmem_free: munmap failed: errno 22 Invalid argument
E/libEGL  ( 4785): call to OpenGL ES API with no current context (logged once per thread)
F/libc    ( 4785): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4874 (OpenGLRenderer)
I/DEBUG   (  172): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  172): Build fingerprint: 'Android/full_mako/mako:4.3/JSS15J/mvp_aosp_4.3-86d5731:userdebug/test-keys'
I/DEBUG   (  172): Revision: '10'
I/DEBUG   (  172): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG   (  172):     r0 73a4a5e8  r1 769d1048  r2 00000000  r3 758ccde8
I/DEBUG   (  172):     r4 769d1048  r5 73a44e50  r6 758bef1d  r7 73a4a4a0
I/DEBUG   (  172):     r8 761cae70  r9 73abbef4  sl 73a455a8  fp 756ccc84
I/DEBUG   (  172):     ip 130a4001  sp 756ccae0  lr 758bef2b  pc 00000000  cpsr 200e0010
I/DEBUG   (  172):     d0  0000000000000000  d1  0000000000000000
I/DEBUG   (  172):     d2  6e2068746977201c  d3  6e65727275632076
I/DEBUG   (  172):     d4  7865746e6f632074  d5  6567676f6c282074
I/DEBUG   (  172):     d6  702065636e6f2064  d7  6165726874207265
I/DEBUG   (  172):     d8  0000000000000000  d9  0000000000000000
I/DEBUG   (  172):     d10 0000000000000000  d11 0000000000000000
I/DEBUG   (  172):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  172):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  172):     d16 4018000000000000  d17 4010000000000000
I/DEBUG   (  172):     d18 0000000000000000  d19 0000000000000000
I/DEBUG   (  172):     d20 0000000000000000  d21 0000000000000000
I/DEBUG   (  172):     d22 0000000000000000  d23 0000000000000000
I/DEBUG   (  172):     d24 0000000000000000  d25 00bc800000b98000
I/DEBUG   (  172):     d26 0000000000000000  d27 0000000000000000
I/DEBUG   (  172):     d28 0707070703030303  d29 0003000000030000
I/DEBUG   (  172):     d30 0001000000010000  d31 0001000000010000
I/DEBUG   (  172):     scr 20000012
I/DEBUG   (  172):
I/DEBUG   (  172): backtrace:
I/DEBUG   (  172):     #00  pc 00000000  <unknown>
I/DEBUG   (  172):     #01  pc 00023f29  /system/lib/egl/libGLESv1_CM_adreno200.so
I/DEBUG   (  172):     #02  pc 0001a264  /system/lib/egl/libEGL_adreno200.so (egliDoDestroyEGLImage+212)
I/DEBUG   (  172):     #03  pc 0000fec4  /system/lib/egl/libEGL_adreno200.so (qeglDrvAPI_eglTerminate+684)
I/DEBUG   (  172):     #04  pc 0000d74f  /system/lib/libEGL.so (android::egl_display_t::terminate()+54)
I/DEBUG   (  172):     #05  pc 0000e827  /system/lib/libEGL.so (eglTerminate+46)
I/DEBUG   (  172):     #06  pc 00035a8f  /data/app-lib/com.vmware.mvp-1/libEGL_translator.so (EglOS::terminate(unsigned int)+134)
I/DEBUG   (  172):     #07  pc 00036b55  /data/app-lib/com.vmware.mvp-1/libEGL_translator.so (eglTerminate+168)
I/DEBUG   (  172):     #08  pc 00023b81  /data/app-lib/com.vmware.mvp-1/libOpenglRender.so (FrameBuffer::finalize()+352)
I/DEBUG   (  172):     #09  pc 00021b2b  /data/app-lib/com.vmware.mvp-1/libOpenglRender.so (stopOpenGLRenderer+26)
I/DEBUG   (  172):     #10  pc 0001284f  /data/app-lib/com.vmware.mvp-1/libMVP.so (OpenGLHandle::stopOpenGLRenderer()+562)
I/DEBUG   (  172):     #11  pc 00011dd1  /data/app-lib/com.vmware.mvp-1/libMVP.so (OpenGLRenderer_stopOpenGLRenderer(_JNIEnv*, _jobject*, _jobject*)+68)
I/DEBUG   (  172):     #12  pc 0001dc4c  /system/lib/libdvm.so (dvmPlatformInvoke+112)
I/DEBUG   (  172):     #13  pc 0004decf  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
I/DEBUG   (  172):     #14  pc 00027060  /system/lib/libdvm.so
I/DEBUG   (  172):     #15  pc 0002b5ec  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
I/DEBUG   (  172):     #16  pc 0005ff21  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+292)
I/DEBUG   (  172):     #17  pc 0005ff4b  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
I/DEBUG   (  172):     #18  pc 00054ccb  /system/lib/libdvm.so
I/DEBUG   (  172):     #19  pc 0000ca58  /system/lib/libc.so (__thread_entry+72)
I/DEBUG   (  172):     #20  pc 0000cbd4  /system/lib/libc.so (pthread_create+208)
I/DEBUG   (  172):
I/DEBUG   (  172): stack:
I/DEBUG   (  172):          756ccaa0  7589a014  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccaa4  73a459e8
I/DEBUG   (  172):          756ccaa8  7589a048  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccaac  73ac2d7f  /system/lib/libgsl.so (os_mutex_unlock+10)
I/DEBUG   (  172):          756ccab0  769d10f0
I/DEBUG   (  172):          756ccab4  73a44e50
I/DEBUG   (  172):          756ccab8  7589a048  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccabc  769d10f8
I/DEBUG   (  172):          756ccac0  7589a048  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccac4  4012da13  /system/lib/libc.so (dlfree+50)
I/DEBUG   (  172):          756ccac8  769d1048
I/DEBUG   (  172):          756ccacc  73a44e50
I/DEBUG   (  172):          756ccad0  7589a048  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccad4  73a4a4a0
I/DEBUG   (  172):          756ccad8  df0027ad
I/DEBUG   (  172):          756ccadc  00000000
I/DEBUG   (  172):     #00  756ccae0  00000001
I/DEBUG   (  172):          ........  ........
I/DEBUG   (  172):     #01  756ccae0  00000001
I/DEBUG   (  172):          756ccae4  75890268  /system/lib/egl/libEGL_adreno200.so (egliDoDestroyEGLImage+216)
I/DEBUG   (  172):     #02  756ccae8  00000001
I/DEBUG   (  172):          756ccaec  400f6de1  /system/bin/linker
I/DEBUG   (  172):          756ccaf0  75899ed0  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccaf4  758966c4  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccaf8  769d1048
I/DEBUG   (  172):          756ccafc  76a906d8
I/DEBUG   (  172):          756ccb00  00000001
I/DEBUG   (  172):          756ccb04  73a44e50
I/DEBUG   (  172):          756ccb08  7589a048  /system/lib/egl/libEGL_adreno200.so
I/DEBUG   (  172):          756ccb0c  75885ec8  /system/lib/egl/libEGL_adreno200.so (qeglDrvAPI_eglTerminate+688)

 

Do you have any suggestion on this behavior ? It is not 100% reproducible but it happens regularly and we're not able to find the root cause.

Best,

Damien.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-10-07 10:20

Hi Damien..

Could you let us know what build and Android version is loaded on the Nexus 4?

Also, do you have a sample apk that duplicates the problem (even it not all the time)?

 

thanks,

mark

 

 

  • Up0
  • Down0
damien.dejean
Join Date: 12 Dec 12
Posts: 5
Posted: Thu, 2013-10-10 01:14

Hi,

We're using Android JellyBean 4.3 and it's a custom build, but with proprietary binaries from the official 4.3 image(build JWR66Y). I don't have any apk to reproduce, but I'll try to provide you any information I get.

During my investigations I found that creating the EGLimages in a GLES2.0 context make the bug disappear, I'm not crashing anymore. What I don't understand is that when doing the eglTerminate(), there is no more "current" context, all textures and contexts are destroyed. We're doing:

eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(mEglDisplay, mEglContext);
eglDestroySurface(mEglDisplay, mPbufSurface);
eglTerminate(mEglDisplay);

 

Best,

Damien.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-10-14 08:15

Damien - The termination sequence seems correct.  It could be an issue with our GL3 drivers, but without a apk to reproduce it's difficult to tell if it's the driver, or the custom environment/build you're running in.

 

-mark

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.