bcc icon indicating copy to clipboard operation
bcc copied to clipboard

[gh actions] Enable LSAN leak detection when running CI

Open chantra opened this issue 2 years ago • 6 comments

Once https://github.com/iovisor/bcc/pull/4127 lands, the test suite should be able to run leak free. Enabling the LeakSanitizer will help preventing leaks being introduced in the future.

This diff makes leak sanitization the default for all our tests running in CI.

chantra avatar Jul 22 '22 16:07 chantra

I will need to re-base this on https://github.com/iovisor/bcc/pull/4127 once it is landed to make sure it is not triggering any other errors.

chantra avatar Jul 22 '22 16:07 chantra

We have a test failure with missing lsan library,

[  7%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/bpf.c.o
/usr/bin/ld: cannot find /usr/lib64/liblsan.so.0.0.0
collect2: error: ld returned 1 exit status
make[2]: *** [src/lua/CMakeFiles/bcc-lua.dir/build.make:135: src/lua/bcc-lua] Error 1
make[1]: *** [CMakeFiles/Makefile2:955: src/lua/CMakeFiles/bcc-lua.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  8%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/bpf_prog_linfo.c.o

cc @davemarchevsky

yonghong-song avatar Aug 10 '22 03:08 yonghong-song

We have a test failure with missing lsan library,

[  7%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/bpf.c.o
/usr/bin/ld: cannot find /usr/lib64/liblsan.so.0.0.0
collect2: error: ld returned 1 exit status
make[2]: *** [src/lua/CMakeFiles/bcc-lua.dir/build.make:135: src/lua/bcc-lua] Error 1
make[1]: *** [CMakeFiles/Makefile2:955: src/lua/CMakeFiles/bcc-lua.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  8%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/bpf_prog_linfo.c.o

cc @davemarchevsky

So, this is happening on fedora, it probably just need to be installed a new library.

chantra avatar Aug 10 '22 23:08 chantra

Also, cmake in bionic is at version 3.10, but add_link_options was added in 3.13

https://github.com/iovisor/bcc/runs/7758803580?check_suite_focus=true

chantra avatar Aug 11 '22 00:08 chantra

Ok. With those 2 other patches. Failures are now isolated to the test runs, which I believed failed before.

chantra avatar Aug 11 '22 01:08 chantra

I am putting this one on hold for now. Python and LSAN are not good friends: https://tobywf.com/2021/02/python-ext-asan/

I need to find a way to disable LSAN just in the context of python runs before this can be enabled.

chantra avatar Aug 12 '22 23:08 chantra