[PATCH] D31354: [tsan] Assert to make sure we don't try to Acquire() or Release() a NULL pointer

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 02:05:47 PDT 2017


dvyukov added a comment.

What was the bug? How did it manifest?
I somewhat afraid of breaking some existing code. Currently we consider memory around 0 to be "user memory". And in fact it's possible to mmap the first page at least on some linuxes, not sure about other OSes. And there is some effort to port sanitizers to mmu-less environment (https://reviews.llvm.org/D30583). Another possible use if you have N virtual entities and use N as address passed to acquire/release annotations (not perfect, but currently valid).
If we are excluding NULL from user memory, then I think we need to change IsAppMem to return false for NULL. That will make behavior consistent across all functions. Acquire/Release already check IsAppMem for the passed address (at least in debug build). It will also make simpler to undo this decision in some particular contexts.


https://reviews.llvm.org/D31354





More information about the llvm-commits mailing list