forked from OSchip/llvm-project
[ASan] Clear allocation magic value before recycling the chunk. This led to spurious crashes in LSan when it walked through reused chunks. Don't know how to create not-brittle test case for this.
llvm-svn: 184404
This commit is contained in:
parent
cb0b876b39
commit
686c229b03
|
@ -280,6 +280,9 @@ struct QuarantineCallback {
|
|||
if (p != m) {
|
||||
uptr *alloc_magic = reinterpret_cast<uptr *>(p);
|
||||
CHECK_EQ(alloc_magic[0], kAllocBegMagic);
|
||||
// Clear the magic value, as allocator internals may overwrite the
|
||||
// contents of deallocated chunk, confusing GetAsanChunk lookup.
|
||||
alloc_magic[0] = 0;
|
||||
CHECK_EQ(alloc_magic[1], reinterpret_cast<uptr>(m));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue