[libcxx-commits] [PATCH] D86256: [libunwind] Make .eh_frame scanning/caching optional

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 28 02:29:42 PDT 2020


rprichard added a comment.

> If the unwinder uses dl_iterate_phdr, then entries that are automatically added to DwarfFDECache would become invalid if the module containing the entry were unloaded. (On Apple systems, DwarfFDECache registers dyldUnloadHook to remove unloaded entries.)

AFAICT, this is also a problem for Windows DWARF EH, which relies on scanning an .eh_frame section. e.g. A stale cachedFDE could point into the middle of an FDE/CIE with an arbitrary outcome. Maybe decodeFDE crashes, or maybe it decodes something that looks like a match. I'm not sure if it can be fixed without disabling the caching. If so, then I'd wonder if the caching is worth keeping. (Bare-metal could use .eh_frame_hdr, and I'm not sure whether Apple systems actually need the full __eh_frame scan.)

Windows also has SEH exceptions, which I think don't have this problem.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86256



More information about the libcxx-commits mailing list