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

Add Memory Sanitizer Check to CI #12

Open
coder3101 opened this issue Jun 15, 2020 · 0 comments
Open

Add Memory Sanitizer Check to CI #12

coder3101 opened this issue Jun 15, 2020 · 0 comments
Labels
ci Continuous Integration related Issues enhancement New feature or request future-work Deferred to be worked in later stage of GSOC or after GSOC

Comments

@coder3101
Copy link
Collaborator

Memory Sanitizer helps in finding uninitialized use of variables, leaks and other memory-related behaviour that causes can cause UB.

However, due to restricting nature of MEMSAN and limitations, it is only available with clang and is hard to setup correctly. From discussion on #11

I have added the memory sanitizer but here is a problem.

Not uBLAS.tensor but Boost. Test framework has an issue of memory-sanitizer use of uninitialized value. I am not sure if it is really a true issue or false positive of MEMSAN. See this error report from Memory Sanitizer. However, I see many Stackoverflow questions that mention false positives for MEMSAN. Even its wiki says some things to do before using MEMSAN.

If you want MemorySanitizer to work properly and not produce any false positives, you must ensure that all the code in your program and in libraries it uses is instrumented (i.e. built with -fsanitize=memory). In particular, you would need to link against MSan-instrumented C++ standard library. We recommend using libc++ for that purpose.
See https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo

I even tried using libc++ and linked a demo code to it with sanitizer enabled and got uninitialized use of memory error for std::cout<<"Hello world". See this:

image

The current CI is failing for Linux Clang due to the above sanitizer reported an error in Boost. Test

@coder3101 coder3101 added enhancement New feature or request help wanted Extra attention is needed ci Continuous Integration related Issues future-work Deferred to be worked in later stage of GSOC or after GSOC labels Jun 15, 2020
@bassoy bassoy removed the help wanted Extra attention is needed label Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration related Issues enhancement New feature or request future-work Deferred to be worked in later stage of GSOC or after GSOC
Projects
None yet
Development

No branches or pull requests

2 participants