Subject: Re: bug#18885: 25.0.50; build fails with ASan enabled

From: Andreas Schwab <[email-masked]>
Date: Wed, 29 Oct 2014 17:04:44 +0100

Mark Oteiza <[email-masked]> writes:

> Hi,
>
> For debugging another project, I resorted to using gcc's address
> sanitizer to help track down a bug, and it actually helped find others
> along the way.  I came across a crash in emacs and decided to build
> trunk with the address sanitizer enabled.
>
> The build failed with this output on Arch Linux.  The build config is
> the same as below except without optimization and with
> -fsanitize=address in CFLAGS and LDFLAGS.
>
> Loading /tmp/makepkg/emacs-git/src/emacs/lisp/tooltip.el (source)...
> Finding pointers to doc strings...
> Finding pointers to doc strings...done
> Dumping under the name emacs
> =================================================================
> ==6778==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000cf9d70 at pc 0x7ffff6f2fd1a bp 0x7fffffffc6a0 sp 0x7fffffffbe48
> READ of size 3601184 at 0x000000cf9d70 thread T0
>     #0 0x7ffff6f2fd19 in __interceptor_memcpy.part.38 (/usr/lib/libasan.so.1+0x2fd19)
>     #1 0x91421d in unexec /tmp/makepkg/emacs-git/src/emacs/src/unexelf.c:1060

This is expected.  unexec and asan are not compatible.

Andreas.

-- 
Andreas Schwab, SUSE Labs, [email-masked]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."