[PATCH] D48033: [ASAN] fix crash in GetGlobalsForAddress after dlclose

Peter Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 15:50:28 PDT 2018


Lekensteyn updated this revision to Diff 150863.
Lekensteyn edited the summary of this revision.
Lekensteyn added a comment.

Since performance was pretty bad at exit (see https://github.com/google/sanitizers/issues/963#issuecomment-396323984), I decided that optimization is mandatory for this version. UnregisterGlobals is apparently not only called for `dlclose`, but also for other shared libaries.

I have no test for the *order* of `UnregisterGlobal`, this could potentially result in performance regressions that the optimizations were trying to address.
If necessary, I can check that through `ASAN_OPTIONS=report_globals=2`. I was however not sure whether the order is deterministic. For example, given `extern "C" { const char *a = "foo"; const int b = 3; }`, can I be sure that these are always registered as `a`, then `b`? (And will it subsequently be unregistered as such)?


https://reviews.llvm.org/D48033

Files:
  lib/asan/asan_globals.cc
  test/asan/TestCases/Posix/dlclose-globals.cc
  test/asan/TestCases/Windows/freelibrary-globals.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48033.150863.patch
Type: text/x-patch
Size: 5242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/9d47f354/attachment.bin>


More information about the llvm-commits mailing list