Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory sanitizer error in python API #1165

Closed
acquamarin opened this issue Jan 10, 2023 · 3 comments
Closed

Memory sanitizer error in python API #1165

acquamarin opened this issue Jan 10, 2023 · 3 comments
Assignees

Comments

@acquamarin
Copy link
Collaborator

We need to add memory sanitizer check to our CI in order to detect memory issues in PRs.
However, when i compile our code with memory sanitizer and run python tests, i get the following errors:

➜  test git:(drop-col) ✗ python3 test_main.py 
==28988==ERROR: Interceptors are not working. This may be because AddressSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with:
DYLD_INSERT_LIBRARIES=/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
"interceptors not installed" && 0
[1]    28988 abort      python3 test_main.py

Reproduce:
Added those flags to cmake:

set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")

Then run:
cmake debug

@anuchak
Copy link
Collaborator

anuchak commented Jan 17, 2023

google/sanitizers#856

Using fsanitize flag and building binary causes ASAN to fail when running python tests.
The binary can't be built with the fsanitize flag, it has to be run with LD_PRELOAD pointing to the gcc / clang libasan .so

@mewim
Copy link
Member

mewim commented Jan 17, 2023

I have verified that the method mentioned by @anuchak works and configured CI with address sanitizer in #1185

@anuchak
Copy link
Collaborator

anuchak commented Jan 17, 2023

This issue can be closed, address sanitizer with build debug has been added successfully in the ci pipeline. There are some error in python tests due to which the step fails (I've raised a ticket for this #1189 and @acquamarin will take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants