[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 09:49:46 PDT 2018


Lekensteyn created this revision.
Lekensteyn added reviewers: kcc, eugenis.
Lekensteyn added a project: Sanitizers.
Herald added subscribers: Sanitizers, llvm-commits, kubamracek.

Calling `__asan_describe_address` after unloading any library through
dlclose or FreeLibrary currently results in a crash due to accessing
unmapped memory (the `Global` structure in list_of_all_globals).

As list_of_all_globals is only accessed under a lock, it is safe to
remove items in UnregisterGlobal.

Fixes https://github.com/google/sanitizers/issues/741
Fixes https://github.com/google/sanitizers/issues/963


Repository:
  rCRT Compiler Runtime

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.150777.patch
Type: text/x-patch
Size: 3765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/658f5a33/attachment.bin>


More information about the llvm-commits mailing list