The crash happens only when calling eglReleaseThread() from destructor of the process. Please find the attached simple app which can be used to repro the issue.
With valgrind, I see there is some invalid memory access during the eglReleaseThread() call. Find the logs below: ==5059== Invalid read of size 8 ==5059== at 0x70480EC: eglReleaseThread (eglapi.c:1706) ==5059== by 0x48825B7: eglReleaseThread (in /usr/lib/aarch64-linux-gnu/libEGL.so.1.1.0) ==5059== by 0x1089FB: deinit (in /home/ubuntu/egl_sample/egl_sample) ==5059== by 0x400EBFF: _dl_fini (dl-fini.c:138) ==5059== by 0x48DC84B: __run_exit_handlers (exit.c:108) ==5059== by 0x48DC9DB: exit (exit.c:139) ==5059== by 0x48C7093: (below main) (libc-start.c:342) ==5059== Address 0x4c6f8c8 is 8 bytes inside a block of size 48 free'd ==5059== at 0x484AF20: free (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so) ==5059== by 0x7051FE3: _eglDestroyThreadInfo (eglcurrent.c:134) ==5059== by 0x7051FE3: _eglFiniTSD (eglcurrent.c:76) ==5059== by 0x70539CF: _eglAtExit (eglglobals.c:112) ==5059== by 0x48DC84B: __run_exit_handlers (exit.c:108) ==5059== by 0x48DC9DB: exit (exit.c:139) ==5059== by 0x48C7093: (below main) (libc-start.c:342) So eglReleaseThread() in this case, tries to access the _EGLThreadInfo memory already freed by _eglFiniTSD() ? But it is expected that a new instance of _EGLThreadInfo has to be created when eglReleaseThread() is called from the app in this case. ** Attachment added: "egl_sample.tar" https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/1946621/+attachment/5531907/+files/egl_sample.tar -- You received this bug notification because you are a member of Ubuntu-X, which is subscribed to mesa in Ubuntu. https://bugs.launchpad.net/bugs/1946621 Title: Crash in libegl-mesa0 (eglReleaseThread) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/1946621/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~ubuntu-x-swat Post to : ubuntu-x-swat@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-x-swat More help : https://help.launchpad.net/ListHelp