SUSE / libpulp

libpulp enables live patching in user space applications.
GNU Lesser General Public License v2.1
55 stars 11 forks source link

Test libpulp with address sanitizer #60

Closed giulianobelinassi closed 2 years ago

giulianobelinassi commented 3 years ago

GCC supports address sanitizer by passing -fsanitize=address. Test libpulp with that to ensure we haven't any memory problems hidden around awaiting to catch us unguarded.

giulianobelinassi commented 3 years ago

Support for address sanitizer has been added into tools, but there is none support for libpulp.so itself.

giulianobelinassi commented 2 years ago

So I tried to implement support for libsanitizer in libpulp.so and I couldn't get past a segmentation fault in startup. The crash seems to be either in libsanitizer or during the dynamic link, because adding infinite loops or prints on libpulp constructors also results in a crash. Statically linking libsanitizer into libpulp.so doesn't help either.

Setting breakpoints in _start and __asan_init also results in a crash, so either gdb cannot be used for debugging those or the crash is even before the binary starts executing.

However, valgrind works in libpulp.so, so perhaps it is better to just patch the testsuite to support valgrind.