Closed lhsoft closed 9 months ago
If I use ptmalloc
, it works well and I switch to tcmalloc
, the seg fault will happen.
It looks like when tsan is enabled and tcmalloc is inited before tsan, when tsan begin to init, it will call tcmalloc and tcmlloc will also call tsan to traceAddevent which cause the segmentation fault.
TSan links in its own memory allocator so that it can see the allocations and deallocations. Mixing-and-matching allocators might lead to an object being allocated by one of TSan's allocator or TCMalloc and then deallocated with the other, leading to invalid preconditions.
The stack is following