Forums - Fatal signal 11 (SIGSEGV) on eglDestroyContext

2 posts / 0 new
Last post
Fatal signal 11 (SIGSEGV) on eglDestroyContext
adreamer
Join Date: 24 Mar 15
Location: Seoul, Korea
Posts: 2
Posted: Tue, 2015-03-24 23:33

Hi,

 
I'm developing an app based on Grafika's Record GL App to
 
1) decode the mp4 file with Encoder MediaCodec and draw it on oes texture
 
2) copy to 2D texture and draw something
 
3) copy to input surface of Decoder MediaCodec and encode a new mp4.
 
However, Fatal signal 11 crash happens on eglDestroyContext.
 
I'm using the EglCore from Grafika and the relase code is like this.
 
    public void release() {
 
        if (EGL14Display != EGL14.EGL_NO_DISPLAY) {
            // Android is unusual in that it uses a reference-counted EGLDisplay.  So for
            // every eglInitialize() we need an eglTerminate().
            EGL14.eglMakeCurrent(EGL14Display, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE,
                    EGL14.EGL_NO_CONTEXT);
            EGL14.eglDestroyContext(EGL14Display, EGL14Context);
            //EGL14.eglReleaseThread();
            EGL14.eglTerminate(EGL14Display);
        }
 
        EGL14Display = EGL14.EGL_NO_DISPLAY;
        EGL14Context = EGL14.EGL_NO_CONTEXT;
        EGL14Config = null;
    }
 
The crash happens on Galaxy S5, Optimus G which has Adreno 330 and Adreno 320, but works OK on Galaxy Note2(Exynos) and Galaxy S3(Exynos) with Mali GPU.
 
ALso the crash log shows the backtrace to libEGL_adreno.so (egliGetMutex)
 
Here is the log from Galaxy S5.
 
03-24 18:14:13.048    8539-8781/com.app A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 8781 (Export GL rende)
03-24 18:14:13.108      408-408/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-24 18:14:13.108      408-408/? I/DEBUG﹕ Build fingerprint: 'samsung/kltelgt/kltelgt:5.0/LRX21T/G900LKLU1BOA1:user/release-keys'
03-24 18:14:13.108      408-408/? I/DEBUG﹕ Revision: '14'
03-24 18:14:13.108      408-408/? I/DEBUG﹕ ABI: 'arm'
03-24 18:14:13.108      408-408/? I/DEBUG﹕ pid: 8539, tid: 8781, name: Export GL rende  >>> com.app <<<
03-24 18:14:13.108      408-408/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
03-24 18:14:13.118      408-408/? I/DEBUG﹕ r0 00000000  r1 00000000  r2 224d4001  r3 00000001
03-24 18:14:13.118      408-408/? I/DEBUG﹕ r4 b4ed8900  r5 ad421e74  r6 00000001  r7 ad41f7cc
03-24 18:14:13.118      408-408/? I/DEBUG﹕ r8 00000003  r9 b4e07c00  sl 86ec1140  fp 86ec1120
03-24 18:14:13.118      408-408/? I/DEBUG﹕ ip ad3f2ec4  sp 9df9da50  lr ad40b568  pc ad40576c  cpsr 200f0010
03-24 18:14:13.118      408-408/? I/DEBUG﹕ backtrace:
03-24 18:14:13.118      408-408/? I/DEBUG﹕ #00 pc 0000b76c  /system/vendor/lib/egl/libEGL_adreno.so (egliGetMutex)
03-24 18:14:13.118      408-408/? I/DEBUG﹕ #01 pc 00011564  /system/vendor/lib/egl/libEGL_adreno.so (qeglDrvAPI_eglDestroyContext+124)
03-24 18:14:13.118      408-408/? I/DEBUG﹕ #02 pc 000077d0  /system/vendor/lib/egl/libEGL_adreno.so (eglDestroyContext+16)
03-24 18:14:13.118      408-408/? I/DEBUG﹕ #03 pc 000135ab  /system/lib/libEGL.so (eglDestroyContext+66)
03-24 18:14:13.118      408-408/? I/DEBUG﹕ #04 pc 0006447d  /system/lib/libandroid_runtime.so
03-24 18:14:13.118      408-408/? I/DEBUG﹕ #05 pc 0001b0b9  /system/framework/arm/boot.oat
 
 
 
CrashAnrDetector﹕ Build: samsung/kltelgt/kltelgt:5.0/LRX21T/G900LKLU1BOA1:user/release-keys
    Hardware: MSM8974
    Revision: 14
    Bootloader: G900LKLU1BOA1
    Radio: unknown
    Kernel: Linux version 3.4.0-3866468 (dpi@SWDD5804) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Tue Jan 13 14:17:02 KST 2015
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'samsung/kltelgt/kltelgt:5.0/LRX21T/G900LKLU1BOA1:user/release-keys'
    Revision: '14'
    ABI: 'arm'
    pid: 8539, tid: 8781, name: Export GL rende  >>> com.app <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
    r0 00000000  r1 00000000  r2 224d4001  r3 00000001
    r4 b4ed8900  r5 ad421e74  r6 00000001  r7 ad41f7cc
    r8 00000003  r9 b4e07c00  sl 86ec1140  fp 86ec1120
    ip ad3f2ec4  sp 9df9da50  lr ad40b568  pc ad40576c  cpsr 200f0010
    d0  0000000000000000  d1  0000000000000000
    d2  000003f500000000  d3  0000000000000004
    d4  fe8000003f000001  d5  000122e800000000
    d6  0000000000000000  d7  00000000000022ec
    d8  3f8000003f800000  d9  402c000000000000
    d10 0000000000000000  d11 0000000000000000
    d12 0000000000000000  d13 0000000000000000
    d14 0000000000000000  d15 0000000000000000
    d16 0000000000000000  d17 002e00640069006f
    d18 002e006900750067  d19 0061007200470049
    d20 0063006900680070  d21 0066006600750042
    d22 0072005000720065  d23 006300750064006f
    d24 0000000000000000  d25 0000000000000000
    d26 0001000100010001  d27 0001000100010001
    d28 0080008000800080  d29 0080008000800080
    d30 0800080008000800  d31 0800080008000800
    scr 20000017
    backtrace:
    #00 pc 0000b76c  /system/vendor/lib/egl/libEGL_adreno.so (egliGetMutex)
    #01 pc 00011564  /system/vendor/lib/egl/libEGL_adreno.so (qeglDrvAPI_eglDestroyContext+124)
    #02 pc 000077d0  /system/vendor/lib/egl/libEGL_adreno.so (eglDestroyContext+16)
    #03 pc 000135ab  /system/lib/libEGL.so (eglDestroyContext+66)
    #04 pc 0006447d  /system/lib/libandroid_runtime.so
    #05 pc 0001b0b9  /system/framework/arm/boot.oat
    stack:
    9df9da10  00000003
    9df9da14  ad3e260b  /system/vendor/lib/libgsl.so (os_mutex_unlock+10)
    9df9da18  9df9ddb0  [stack:8781]
    9df9da1c  ad416f34  /system/vendor/lib/egl/libEGL_adreno.so (eglGetThread+120)
    9df9da20  b4ed8900
    9df9da24  00000001
    9df9da28  ad422054  /system/vendor/lib/egl/libEGL_adreno.so
    9df9da2c  ad41a308  /system/vendor/lib/egl/libEGL_adreno.so (eglGetCurrentThreadState+8)
    9df9da30  00000001
    9df9da34  ad415c30  /system/vendor/lib/egl/libEGL_adreno.so (eglSetActiveDisplay+12)
    9df9da38  b4ed8900
    9df9da3c  ad415c94  /system/vendor/lib/egl/libEGL_adreno.so (eglMapDisplay+88)
    9df9da40  ad422054  /system/vendor/lib/egl/libEGL_adreno.so
    9df9da44  ad421e74  /system/vendor/lib/egl/libEGL_adreno.so
    9df9da48  00000001
    9df9da4c  ad40b54c  /system/vendor/lib/egl/libEGL_adreno.so (qeglDrvAPI_eglDestroyContext+100)
    #00  9df9da50  00000001
    ........  ........
    #01  9df9da50  00000001
    9df9da54  b6cf1d4b  /system/lib/libEGL.so (android::egl_display_t::getObject(android::egl_object_t*) const+54)
    9df9da58  b6d4b3b0  /system/lib/libEGL.so
    9df9da5c  aa88c2c0
    9df9da60  00000001
    9df9da64  aa88c2c0
    9df9da68  aa88c2c0
    9df9da6c  9df9da84  [stack:8781]
    9df9da70  12c5e0b0  /dev/ashmem/dalvik-main space (deleted)
    9df9da74  ad4017d4  /system/vendor/lib/egl/libEGL_adreno.so (eglDestroyContext+20)
    #02  9df9da78  b6d4d2f0
    9df9da7c  b6cf55ad  /system/lib/libEGL.so (eglDestroyContext+68)
    #03  9df9da80  b6d4b3b0  /system/lib/libEGL.so
    9df9da84  aa88c2c0
    9df9da88  00000001
    9df9da8c  aa082320
    9df9da90  00000001
    9df9da94  9df9dac4  [stack:8781]
    9df9da98  12c5e070  /dev/ashmem/dalvik-main space (deleted)
    9df9da9c  b6db3481  /system/lib/libandroid_runtime.so
    #04
  • Up0
  • Down0
adreamer
Join Date: 24 Mar 15
Location: Seoul, Korea
Posts: 2
Posted: Fri, 2015-03-27 00:22
I avoided the problem by changing mInputWindowSurface.makeCurrentReadFrom(mOffscreenDrawSurface); to mInputWindowSurface.makeCurrent(); mInputWindowSurface is a WindowSurface made by MediaCodec's input surface, and mOffscreenDrawSurface is a OffscreenSurface.
  • 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.