diff options
author | KJ Tsanaktsidis <[email protected]> | 2023-11-12 13:34:43 +1100 |
---|---|---|
committer | KJ Tsanaktsidis <[email protected]> | 2024-01-19 09:55:12 +1100 |
commit | cabdaebc701217049d8a6457c5100f23910f4423 () | |
tree | c359115e5faa4f7461d32b252d79455ad2be349c /thread_win32.c | |
parent | 807714447ef02c77bb0e17fe27d96ee2692264f8 (diff) |
Make stack bounds detection work with ASAN
Where a local variable is used as part of the stack bounds detection, it has to actually be on the stack. ASAN can put local variable on "fake stacks", however, with addresses in different memory mappings. This completely destroys the stack bounds calculation, and can lead to e.g. things not getting GC marked on the machine stack or stackoverflow checks that always fail. The __asan_addr_is_in_fake_stack helper can be used to get the _real_ stack address of such variables, and thus perform the stack size calculation properly [Bug #20001]
-rw-r--r-- | thread_win32.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -11,6 +11,7 @@ #ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION #include <process.h> #define TIME_QUANTUM_USEC (10 * 1000) @@ -592,7 +593,7 @@ COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized) static inline SIZE_T query_memory_basic_info(PMEMORY_BASIC_INFORMATION mi, void *local_in_parent_frame) { - return VirtualQuery(local_in_parent_frame, mi, sizeof(*mi)); } COMPILER_WARNING_POP |