https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101476
--- Comment #7 from Stas Sergeev <stsp at users dot sourceforge.net> --- Created attachment 52221 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52221&action=edit test case This is a reproducer for both problems. $ cc -Wall -o bug -ggdb3 -fsanitize=address bug.c -O1 to see the canary overwrite problem. $ cc -Wall -o bug -ggdb3 -fsanitize=address bug.c -O0 to see the poisoned stack after pthread_cancel() problem.