[PATCH] D42644: [asan] Intercept std::rethrow_exception indirectly.

Robert Schneider via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 07:05:20 PST 2018


robot added a comment.

In https://reviews.llvm.org/D42644#993506, @kubamracek wrote:

> Cool. Can we get a lit test as well?


This is our first patch so we're unfamiliar with the LLVM testing infrastructure. Could you please tell us what kind of test you'd like? An example would also be great.

We still have some concerns regarding the portability of this patch: we don’t know how to portably intercept a C++ standard library function (name mangling, layout of types, …). In libc++abi, there’s `__cxa_rethrow_primary_exception` but it is not used by libstdc++. Instead, libstdc++’s implementation calls either `_Unwind_RaiseException` or `_Unwind_SjLj_RaiseException` directly – so we’ve intercepted those two for libstdc++. We didn’t check if this helps on other platforms (Mac and Windows come to mind).

Additionally, it might be possible there are some other interceptor functions missing such as `__cxa_rethrow` (for throw; statements in catch blocks) which might lead to analogous false positives (especially if you don’t intercept `_Unwind_RaiseException` in the libc++ case).

Arnaud & Robot


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42644





More information about the cfe-commits mailing list