[PATCH] D40382: Plug dlerror() leak for swift_demangle

Hector Martin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 02:39:08 PDT 2023


marcan added a comment.
Herald added a project: All.

FYI, this introduces a subtle regression. `dlerror()` calls into gettext to translate the error. ASAN itself can be initialized from a random malloc intercept which can turn out to be in gettext, which is quite common since apps initialize gettext early. This ends up re-entering into gettext and corrupting a rwmutex by trying to take the write lock while the read-side is locked. The unlock sequence leaves the rwlock in a bad state. Things then deadlock much later on the bad mutex.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D40382/new/

https://reviews.llvm.org/D40382



More information about the llvm-commits mailing list