[Bug sanitizer/124206] [16 Regression] Stack overflow in ASAN-instrumented GCC

pheeck at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 23 13:15:48 GMT 2026


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

--- Comment #3 from Filip Kastl <pheeck at gcc dot gnu.org> ---
Right.  I think I see what you're getting at.

If I increase the stack size, I get rid of the stack overflow.  So it is not
unterminated recursion.  Though I have to increase it pretty significantly
(from ~8MB to ~100MB) to achieve this.

Conversely, one would expect that lowering the stack size limit for
non-asan-instrumented GCC would lead to a segfault.  But that doesn't happen (I
tried as low as 32KB stack and no segfault).  Maybe without the asan
instrumentation, the relevant recursive calls get optimized into loops?

I'll double check if this is a regression.  I just assumed that from the fact
that I don't recall seeing this segfault before 2026.  But I'll go and build
some older revision with --with-build-config=bootstrap-asan to confirm this.


More information about the Gcc-bugs mailing list