mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-28 23:16:14 +01:00
gthread-win32: Register fallback handler for thread name as last
Many ASAN implementations install Vectored Exception Handlers that must be the first in the sequence. As we don't really care about ordering, let's place our handler as last. References: - https://developercommunity.visualstudio.com/t/asan-problems-when-manual-exception-handling/1242524 - https://source.chromium.org/chromium/chromium/src/+/main:components/browser_watcher/extended_crash_reporting.cc;l=150;drc=4ced8912
This commit is contained in:
parent
69e2007f68
commit
d60ca9aa38
@ -681,7 +681,12 @@ g_thread_win32_init (void)
|
||||
InitializeCriticalSection (&g_private_lock);
|
||||
|
||||
#ifndef _MSC_VER
|
||||
SetThreadName_VEH_handle = AddVectoredExceptionHandler (1, &SetThreadName_VEH);
|
||||
/* Set the handler as last to not interfere with ASAN runtimes.
|
||||
* Many ASAN implementations (currently all three of GCC, CLANG
|
||||
* and MSVC) install a Vectored Exception Handler that must be
|
||||
* first in the sequence to work well
|
||||
*/
|
||||
SetThreadName_VEH_handle = AddVectoredExceptionHandler (0, &SetThreadName_VEH);
|
||||
if (SetThreadName_VEH_handle == NULL)
|
||||
{
|
||||
/* This is bad, but what can we do? */
|
||||
|
Loading…
Reference in New Issue
Block a user