[Mesa-dev] [PATCH v2] configure.ac: add --enable-sanitize option

Emil Velikov emil.l.velikov at gmail.com
Fri Apr 14 17:02:42 UTC 2017


On 13 April 2017 at 17:14, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Enable code sanitizers by adding -fsanitize=$foo flags for the compiler
> and linker.
>
> In addition, this also disables checking for undefined symbols: running
> the address sanitizer requires additional symbols which should be provided
> by a preloaded libasan.so (preloaded for hooking into malloc & friends
> globally), and the undefined symbols check gets tripped up by that.
>
> Running the tests works normally via `make check`, but shows additional
> failures with the address sanitizer due to memory leaks that seem to be
> mostly leaks in the tests themselves. I believe those failures should
> really be fixed. In the mean-time, you can set
>
> export ASAN_OPTIONS=detect_leaks=0
>
> to only check for more serious error types.
>
> v2:
> - fail reasonably when an unsupported sanitize flag is given (Eric Engestrom)
>
> Reviewed-by: Bartosz Tomczyk <bartosz.tomczyk86 at gmail.com> (v1)
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
> --
> Eric, did you ever figure out what went wrong with LLVM? I'm compiling
> with a fairly recent LLVM trunk here and it works fine, and so apparently
> did you. FWIW, I'm using gcc 6.2.
>
> Emil, as you can see I tried `make check`, and it works without the
> preload because all the tests are standalone libraries.
>
Thought we had some tests that use shared libs. Glad to hear that
everything works as expected.
Thanks for double-checking!

Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil
P.S. Feel free to add a note to docs/relnotes/17.1.0.html or I'll add
one later today.


More information about the mesa-dev mailing list