Subject: bug#76393: Warn about -fsanitizer=address builds

From: Eli Zaretskii <[email-masked]>
Date: Tue, 18 Feb 2025 17:25:32 +0200

> Date: Tue, 18 Feb 2025 12:34:08 +0000
> From:  Pip Cet via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Building with current GCC and -fsanitizer=address results in certain
> (large) stack allocations being performed on a "fake stack", using
> __asan_stack_malloc_N.  This "fake stack" is invisible to GC and thus
> breaks conservative GC scanning (bug#76327).
> 
> It seems to be possible to work around this by setting
> 
> ASAN_OPTIONS=detect_stack_use_after_return=0
> 
> Even with that option, a "sanitized" build reports bogus errors.
> 
> ASAN_OPTIONS=detect_stack_use_after_return=0,detect_leaks=0
> 
> seems to work, at least, but is it really worth it to keep adding
> options (inconveniently using environment variables) to work around such
> ASAN bugs?
> 
> I think it would be preferrable to warn about builds with
> -fsanitizer=address, which generates broken code, or disable them
> entirely.

If what we have in etc/DEBUG about building with address sanitization
is not enough or outdated, please consider updating and expanding that
section.