Re: [PATCH 6/6] tests: mark python libmount tests known to fail with AddressSanitizer

Sami Kerola
2014-11-11T21:16:49Z

On 11 November 2014 02:12, Mike Frysinger <vapier@gentoo.org> wrote:
> On 10 Nov 2014 21:49, Sami Kerola wrote:
>> The tests fail with an error similar to this.
>>
>> Traceback (most recent call last):
>> File "/home/src/util-linux/libmount/python/test_mount_tab_update.py", line 7, in <module>
>> import pylibmount as mnt
>> ImportError: /home/src/util-linux/.libs/libuuid.so.1: undefined symbol: __asan_option_detect_stack_use_after_return
>
> if libuuid.so is built with ASAN, it should be linked with it too. that means
> passing the ASAN flags at link time. or maybe libtool is filtering them out
> when it goes to link the library ?

Hi Mike,

The documentation

https://code.google.com/p/address-sanitizer/wiki/AsanAsDso

gives a hint

-- snip
=ASAN and LD_PRELOAD=

It is possible to use ASAN in this scenario (e.g. JVM+JNI, Python+SWIG):

* There is third-party executable binary which can not be recompiled
* It loads shared libraries that can be recompiled and we want to test
them with ASAN

A simple solution is to build ASAN-DSO and LD_PRELOAD it into the
process, however the devil is in the detail.

* If the process creates sub-processes, they will also have ASAN-DSO
preloaded, which may be undesirable.
* TODO (stay tuned)
-- snip

Making the python + libuuid should be possible, but I it seems to
require a bit trying to get work. I feel it is acceptable to get most
of the util-linux & travis to work with the asan first, and once the
easy stuff is done one can/should concentrate on making the less
trivial things to work.

--
Sami Kerola