Re: Testing for memory safety issues with Address Sanitizer



On Wed, 2016-09-21 at 11:27 -0500, Michael Catanzaro wrote:
For some reason, Fedora doesn't seem to have a libasan-devel package,
so there's no plain libasan.so. Really strange. I tried changing it
to libasan.so.3 in my jhbuildrc but actually couldn't figure out how
to do that; jhbuild is playing with LD_PRELOAD as well. :(

        Hi,
these options used to work in some not so distant past for me (yeah,
when playing with evolution-data-server and evolution):

export CFLAGS="$CFLAGS -fsanitize=address,bounds,alignment,object-size -fno-omit-frame-pointer"
export LDFLAGS="-fsanitize=address,bounds,alignment,object-size -lasan -lubsan -lpthread -ldl"
export 
ASAN_OPTIONS=abort_on_error=1:detect_stack_use_after_return=0:detect_leaks=0:handle_segv=0:check_printf=0:detect_deadlocks=1:replace_str=1:replace_intrin=1:alloc_dealloc_mismatch=1:new_delete_type_mismatch=1:detect_container_overflow=1

I recall I was forced to use the LD_PRELOAD too. It was for cases when
mixing with and without asan built code, if I recall correctly. You
should teach jhbuild to add the asan/ubsan first, I'm afraid (or to
concatenate the LD_PRELOAD with some shell value, similar to CFLAGS
above.
        Bye,
        Milan


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