[Bug sanitizer/101476] AddressSanitizer check failed, points out a (potentially) non-existing stack error

stsp at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Thu Jan 20 09:58:56 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101476

--- Comment #11 from Stas Sergeev <stsp at users dot sourceforge.net> ---
The third bug here seems to be
that __asan_handle_no_return:
https://github.com/gcc-mirror/gcc/blob/master/libsanitizer/asan/asan_rtl.cpp#L602
also calls sigaltstack() before
unpoisoning stacks. I believe this
makes the problem much more reproducible,
for example the test-case with longjmp()
is likely possible too. I've found about
that instance by trying to call
__asan_handle_no_return() manually as a
pthread cleanup handler, in a hope to
work around the destructor bug. But it
appears __asan_handle_no_return() does
the same thing.
So the fix should be to move this line:
https://github.com/gcc-mirror/gcc/blob/master/libsanitizer/asan/asan_rtl.cpp#L607
above PlatformUnpoisonStacks() call.


More information about the Gcc-bugs mailing list