Boost logo

Boost :

Subject: Re: [boost] A summary of testing with sanitizers
From: John Maddock (jz.maddock_at_[hidden])
Date: 2015-05-07 12:40:03


On 07/05/2015 16:52, Ben Pope wrote:
> On Thursday, May 07, 2015 11:33 PM, John Maddock wrote:
>>
>>> 15 SUMMARY: MemorySanitizer: use-of-uninitialized-value
>>> /home/ben/development/boost/test/build/boost_root/status/../boost/multiprecision/gmp.hpp:331:10
>>>
>>> in
>>> boost::multiprecision::backends::detail::gmp_float_imp<50u>::~gmp_float_imp()
>>>
>>>
>>
>> After banging my head against the wall that is memory-sanitizer for a
>> while, I finally figured out that the multiprecision failures are caused
>> by external libraries (gmp, mpfr etc) not being built with sanitizer
>> support. I've changed the configuration tests to trigger
>> memory-sanitizer errors when this is the case, so that these will no
>> longer be built in that case. However, you will need to manually delete
>> the Boost.Build configuration caches (or all of bin.v2) in order for the
>> fix to take effect, as these appear not to be subject to
>> dependency-checking :(
>
> What if I build sanitised versions? How many dependant libraries
> would need to be built?
>
The code is such that if the config tests are linked against sanitized
libraries they will pass and the tests will be built as normal - which
might well be useful actually - though I confess I've found clang's
memory sanitizer to be a right pain to use with utterly inscrutable
error messages. Just my 2c... though I guess it is marked as "not
ready for widespead use".

The libraries effected are gmp, mpfr, mpfi and tommath (the latter two
are probably not installed by default anyway).

BTW there are also a lot of multiprecision tests failing because of the
300 second timeout - seems to be the -fsanitize=memory and
-fsanitize=undefined that are causing the issues - do these
significantly slow compile times?

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk