bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: results of gnulib tests with -fsanitize=address


From: Paul Eggert
Subject: Re: results of gnulib tests with -fsanitize=address
Date: Fri, 19 May 2017 09:11:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/19/2017 08:02 AM, Bruno Haible wrote:
the problem comes from the 'closeout' module: When main() is finished,
it closes fd 1 and 2, and the libasan then cannot perform the output it wants 
to do.

Yes, closeout should not close stderr when addresses are being sanitized. I installed the attached patch to work around the problem. Perhaps a better fix could be made (e.g., close_stdout could conditionally call AddressSanitizer's leak_check_at_exit before closing stderr), but this workaround should suffice for now.

2) test-u8-casecoll
It fails because HAVE_ICONV is not defined - because the test program in 
m4/iconv.m4
fails due to an iconv_t leak / memory leak.

What is the best practice here? Should -fsanitize=address only be activated
after configure has run? Or should all configure run tests be changed so that 
they
free all allocated memory?

The latter is surely too much work for not enough benefit. In general, a 'configure'-time test should focus on one individual feature, and not attempt to test a combination of features, as there are too many combinations. This is partly why we advise people not to run 'configure' with -Werror, as that tests not only the desired features but also whether the 'configure'-time test pacifies picky compilers. Similarly, we should advise people not to run 'configure' with sanitization options like memory-leak detection that affect valid (albeit inefficient) test programs.

However, it should be OK to configure with -fsanitize=address if the ASAN_OPTIONS environment variable suppresses checks for valid-albeit-inefficent behavior. For example, ASAN_OPTIONS='detect_leaks=0' may suffice. (I haven't checked this.)

Attachment: 0001-closeout-don-t-close-stderr-when-sanitizing.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]