[PATCH] D67331: Stop tracking atexit/__cxa_atexit/pthread_atfork allocations in LSan/NetBSD

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 8 09:25:25 PDT 2019


krytarowski created this revision.
krytarowski added reviewers: dvyukov, joerg, mgorny, vitalybuka.
krytarowski added a project: Sanitizers.
Herald added subscribers: llvm-commits, jfb.
Herald added a project: LLVM.

The atexit(3) and __cxa_atexit() calls allocate internally memory and free on exit,
after executing all callback. This causes false positives as DoLeakCheck() is called
from the atexit handler. In the LSan/ASan tests there are strict checks triggering
false positives here.

Intercept all atexit(3) and __cxa_atexit() calls and disable LSan when calling the
real functions.

Stop tracing allocations in pthread_atfork(3) funtions, as there are performed
internal allocations that are not freed for the time of running StopTheWorld()
code. This avoids false-positives.

The same changes have to be replicated in the ASan and LSan runtime.


Repository:
  rL LLVM

https://reviews.llvm.org/D67331

Files:
  lib/asan/asan_interceptors.cpp
  lib/lsan/lsan_interceptors.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67331.219272.patch
Type: text/x-patch
Size: 3392 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190908/907aade2/attachment.bin>


More information about the llvm-commits mailing list