-
Notifications
You must be signed in to change notification settings - Fork 1k
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
msan: False positive with libaio? #688
Comments
The problem is that libaio uses inline asm for those syscalls, and MSan #include <sanitizer/linux_syscall_hooks.h> and then add PRE and POST to io_syscall1 .. io_syscall5. On Sat, Jun 11, 2016 at 1:03 AM, Sitsofe Wheeler notifications@github.com
|
Thanks for the advice - the attached patch based on your suggestion seems to solve the issue on an x86_64 Linux after building and linking appropriately: I guess this issue should be closed but before then is there anything that can be done more generically if users are willing to deal with false negatives (e.g. marking all memory from functions in a given given library as unpoisoned)? |
Also, perhaps MSan could warn on unrecognized asm blocks? |
@yugr: |
(http://thread.gmane.org/gmane.comp.compilers.llvm.cvs/167562/focus=167565 talks about why libaio calls aren't intercepted because doing so would force every *san program to use -laio) |
But isn't this desired? I mean 99% of asm blocks need special handling in MSan. |
In my experience it is a lot less than 99%. A lot of assembly blocks don't As for a more generic solution, that's hard. I don't know how to define On Mon, Jun 13, 2016 at 4:09 AM, Yury Gribov notifications@github.com
|
Thank you for answering my remaining question. Marking this issue as closed. |
When trying to use a program that uses libaio MemorySanitzer regularly says uninitialized values are stored just after the io_getevents call:
I see that the sanitizers know about the syscall (https://github.com/llvm-mirror/compiler-rt/blob/release_38/lib/sanitizer_common/sanitizer_common_syscalls.inc#L1295 ) but even if I compile libaio by hand with memory sanitizer and use LD_LIBRARY_PATH to ensure my hand compiled version is used I still get errors.
Steps to reproduce:
clang-3.8 -g -O0 -fsanitize=memory -fsanitize-memory-track-origins=2 -lpthread -laio -o aio-stress aio-stress.c
./aio-stress -m -s 2MB
Expected results:
Test to run without error?
Actual result:
How reproducible is the problem?
The problem can be reproduced every time.
Version information:
Clang 3.8
Ubuntu 14.04 x86_64
The text was updated successfully, but these errors were encountered: