IMX6Q egldestroycontext corrupted

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6Q egldestroycontext corrupted

Jump to solution
941 Views
chenghaibo
Contributor III
EGLObjects::~EGLObjects()
{
 printf("call ~EGLObjects() \n");
 glFinish();
    printf("call ~EGLObjects()1 \n");
 eglMakeCurrent(egldisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
    printf("call ~EGLObjects()2 \n");
    if (eglcontext != EGL_NO_CONTEXT)
    {
        eglDestroyContext(egldisplay, eglcontext); // corrupted at here
        printf("call ~EGLObjects()4 \n");
    }
 
    if (eglsurface != EGL_NO_SURFACE)
    {
        eglDestroySurface(egldisplay, eglsurface);
        printf("call ~EGLObjects()3 \n");
    }
  
 eglTerminate(egldisplay);
    printf("call ~EGLObjects()5 \n");
 eglReleaseThread();
    printf("call ~EGLObjects()6 \n");
}

#0  __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.27-r0/git/sysdeps/unix/sysv/linux/raise.c:51
#1  0x75f9dfc4 in __GI_abort () at /usr/src/debug/glibc/2.27-r0/git/stdlib/abort.c:79
#2  0x75fd6140 in __libc_message (action=action@entry=do_abort, fmt=<optimized out>) at /usr/src/debug/glibc/2.27-r0/git/sysdeps/posix/libc_fatal.c:181
#3  0x75fdc79c in malloc_printerr (str=<optimized out>) at /usr/src/debug/glibc/2.27-r0/git/malloc/malloc.c:5350
#4  0x75fde3c0 in _int_free (av=<optimized out>, p=<optimized out>, have_lock=<optimized out>) at /usr/src/debug/glibc/2.27-r0/git/malloc/malloc.c:4157
#5  0x76a7a024 in gcoOS_FreeMemory (Os=<optimized out>, Memory=<optimized out>) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/hal/os/linux/user/gc_hal_user_os.c:2528
#6  0x76a7a098 in gcoOS_Free (Os=Os@entry=0x0, Memory=<optimized out>) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/hal/os/linux/user/gc_hal_user_os.c:2320
#7  0x75a6d0d4 in _gcSHADER_Clean (Shader=Shader@entry=0x67e06848) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/compiler/libVSC/old_impl/gc_vsc_old_compiler.c:2144
#8  0x75a6ed74 in gcSHADER_Destroy (Shader=0x67e06848) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/compiler/libVSC/old_impl/gc_vsc_old_compiler.c:2586
#9  0x76e1e02c in gcChipPgInstanceDeinitialize (gc=0x7403e038, pgInstanceToDel=0x67e177b8)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/chip/gc_chip_shader.c:7073
#10 0x76e2da9c in gcChipUtilsHashDeleteObject (gc=0x7403e038, pHash=<optimized out>, pObj=<optimized out>)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/chip/gc_chip_utils.c:213
#11 0x76e2db04 in gcChipUtilsHashDeleteAllObjects (gc=gc@entry=0x7403e038, pHash=pHash@entry=0x681e9830)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/chip/gc_chip_utils.c:232
#12 0x76e2db38 in gcChipUtilsHashDestory (gc=0x7403e038, pHash=0x681e9830) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/chip/gc_chip_utils.c:168
#13 0x76e137a8 in __glChipDeleteProgram (gc=0x7403e038, programObject=0x681e2348) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/chip/gc_chip_shader.c:7259
#14 0x76dc51dc in __glDeleteProgramObject (gc=0x7403e038, programObject=0x681e2348)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/glcore/gc_es_shader.c:203
#15 0x76dbfffc in __glFreeSharedObjectState (gc=gc@entry=0x7403e038, shared=0x74058298)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/glcore/gc_es_names.c:406
#16 0x76dccc70 in __glFreeShaderProgramState (gc=gc@entry=0x7403e038) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/glcore/gc_es_shader.c:483
#17 0x76db1e88 in __glDestroyContext (context=context@entry=0x7403e038) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/glcore/gc_es_context.c:1028
#18 0x76db50ec in veglDestroyContext_es3 (thrData=<optimized out>, pCtxPriv=0x7403e038)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libGLESv3/src/glcore/gc_es_egl.c:181
#19 0x76fa8364 in _DestroyContext (Thread=Thread@entry=0x74000b48, Display=Display@entry=0x74001b60, Context=Context@entry=0x7403df58)
    at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libEGL/source/gc_egl_context.c:1555
#20 0x76fa910c in veglDestroyContext (Dpy=<optimized out>, Ctx=<optimized out>) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libEGL/source/gc_egl_context.c:1718
#21 0x76fa9194 in eglDestroyContext (Dpy=<optimized out>, Ctx=<optimized out>) at /usr/src/debug/gpu-viv-fb/git-r0/git/driver/driver/khronos/libEGL/source/gc_egl_context.c:1741
#22 0x00027fa0 in EGLObjects::~EGLObjects (this=0x740009d0, __in_chrg=<optimized out>) at displayGL/glutils.cpp:270
#23 0x000223f8 in GLUtils::~GLUtils (this=0x740009c0, __in_chrg=<optimized out>) at displayGL/glutils.h:93
#24 UtilsGuard<GLUtils>::~UtilsGuard (this=<synthetic pointer>, __in_chrg=<optimized out>) at displayGL/glutils.h:215
#25 GLDispThd::run (this=0x66228) at displayGL/GLDispThd.cpp:63
#26 0x0001e4d4 in Thread::run1 (this=this@entry=0x66228) at common/CThread0.cpp:32
#27 0x0001e4f8 in Thread::run0 (pVoid=0x66228) at common/CThread0.cpp:24
#28 0x760b8d94 in start_thread (arg=0x751c5450) at /usr/src/debug/glibc/2.27-r0/git/nptl/pthread_create.c:463
#29 0x76041138 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Labels (2)
0 Kudos
Reply
1 Solution
778 Views
chenghaibo
Contributor III

I'm sorry, during  the init, 

void SphereSurf::genBezelDisk(float r, float a1, float a2, float a3, int nsNums, int ewNums)
{
    //float h0 = r * cosf(a1);
    int num1, num2, num3;
    pEWTbl = new float[2 * ewNums]; // should be adjust to new float[2 * ewNums + 2]
    float dFai = 2.f*3.1415926f / (float)ewNums;
    for (int i = 0; i <= ewNums; i++) { ///write beyond the buffer
        pEWTbl[2 * i] = cos(dFai * i);
        pEWTbl[2 * i + 1] = sin(dFai * i);
    }
    ....
}
after rewrite the function, eglDestroyContext would not corrupted 

View solution in original post

0 Kudos
Reply
1 Reply
779 Views
chenghaibo
Contributor III

I'm sorry, during  the init, 

void SphereSurf::genBezelDisk(float r, float a1, float a2, float a3, int nsNums, int ewNums)
{
    //float h0 = r * cosf(a1);
    int num1, num2, num3;
    pEWTbl = new float[2 * ewNums]; // should be adjust to new float[2 * ewNums + 2]
    float dFai = 2.f*3.1415926f / (float)ewNums;
    for (int i = 0; i <= ewNums; i++) { ///write beyond the buffer
        pEWTbl[2 * i] = cos(dFai * i);
        pEWTbl[2 * i + 1] = sin(dFai * i);
    }
    ....
}
after rewrite the function, eglDestroyContext would not corrupted 
0 Kudos
Reply