-
Notifications
You must be signed in to change notification settings - Fork 35
Add memcheck and asan annotations #275
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
Conversation
696de5f
to
2faf454
Compare
21a6b88
to
e3c8d6f
Compare
@igchor about TBB - why do we can't annotate mem as unaccessible on free()? Even if TBB keeps metadata inline, you pass ptr+size to the Valgrind so you annotate only the portion of memory - internal TBB accesses outside this portion shouldn't cause problems? |
TBB seems to store some metadata in the allocation itself (first 8 bytes) after free (similarly as we do in base_alloc - but in base_alloc we know exactly where and how much metadata we store). Which means that if we mark the allocation as inaccessible, it will trigger an error when tbb writes it's metadata. |
so can we annotate the rest of memory, after these 8 bytes? or this doesn't make sense? |
general comment: it is quite complex code - it would be great if you could extend the comments and describe why we do annotations in each case |
@kswiecicki we need second approver - could you look at this? |
We could if we're sure that tbb always uses only 8 bytes. This might be true but I don't know if we want to rely on such behavior. |
Closes #217
TBB pool is not annotated because tbb keeps metadata inline and hence we cannot mark the memory as undefined/unaccessible on free.
Ref: https://valgrind.org/docs/manual/valgrind_manual.pdf