mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-20 02:38:07 +02:00
When eglReleaseThread() is called from application's
destructor (API with __attribute__((destructor))),
it crashes due to invalid memory access.
In this case, _egl_TLS is freed in the flow of
_eglAtExit() as below but _egl_TLS is not set to NULL.
_eglDestroyThreadInfo
_eglFiniTSD
_eglAtExit
_run_exit_handlers
exit
Later when the eglReleaseThread is called from
application's destructor, it ends-up accessing
the freed _egl_TLS pointer.
eglReleaseThread -> in libEGL_mesa
eglReleaseThread -> in libEGL(glvnd)
destructor() -> App's destructor
To resolve the invalid access, setting the _egl_TLS
pointer as NULL after freeing it.
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5466
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13302>
|
||
|---|---|---|
| .. | ||
| 50_mesa.json | ||
| egl.def | ||
| eglapi.c | ||
| eglarray.c | ||
| eglarray.h | ||
| eglconfig.c | ||
| eglconfig.h | ||
| eglcontext.c | ||
| eglcontext.h | ||
| eglcurrent.c | ||
| eglcurrent.h | ||
| egldefines.h | ||
| egldevice.c | ||
| egldevice.h | ||
| egldispatchstubs.c | ||
| egldispatchstubs.h | ||
| egldisplay.c | ||
| egldisplay.h | ||
| egldriver.h | ||
| eglentrypoint.h | ||
| eglglobals.c | ||
| eglglobals.h | ||
| eglglvnd.c | ||
| eglimage.c | ||
| eglimage.h | ||
| egllog.c | ||
| egllog.h | ||
| eglsurface.c | ||
| eglsurface.h | ||
| eglsync.c | ||
| eglsync.h | ||
| egltypedefs.h | ||