[libunwind] [libunwind][test] Avoid calling back into libunwind on sanitizer errors (PR #67861)

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 17 12:56:27 PDT 2023


================
@@ -28,6 +28,14 @@ if @LIBUNWIND_USES_ARM_EHABI@:
 if not @LIBUNWIND_ENABLE_THREADS@:
     config.available_features.add('libunwind-no-threads')
 
+config.extra_executor_env = ""
----------------
ldionne wrote:

Could we instead do something like this?

```diff
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index c3732560f5e4..3814863cf3fe 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -227,6 +227,7 @@ DEFAULT_PARAMETERS = [
 
                 AddFlag("-fsanitize=address") if sanitizer == "Address" else None,
                 AddFeature("asan")            if sanitizer == "Address" else None,
+                AddEnvironment("ASAN_OPTIONS", "fast_unwind_on_fatal=1") if sanitizer == "Address" else None,
 
                 AddFlag("-fsanitize=hwaddress") if sanitizer == "HWAddress" else None,
                 AddFeature("hwasan")            if sanitizer == "HWAddress" else None,
@@ -234,6 +235,7 @@ DEFAULT_PARAMETERS = [
                 AddFlag("-fsanitize=memory")               if sanitizer in ["Memory", "MemoryWithOrigins"] else None,
                 AddFeature("msan")                         if sanitizer in ["Memory", "MemoryWithOrigins"] else None,
                 AddFlag("-fsanitize-memory-track-origins") if sanitizer == "MemoryWithOrigins" else None,
+                AddEnvironment("MSAN_OPTIONS", "fast_unwind_on_fatal=1") if sanitizer in ["Memory", "MemoryWithOrigins"] else None,
 
                 AddFlag("-fsanitize=thread") if sanitizer == "Thread" else None,
                 AddFeature("tsan")           if sanitizer == "Thread" else None,
```

This would require a bit more plumbing cause we don't have `AddEnvironment` right now, but it seems like the better way of doing this instead of forcing the way in the cmake bridge.

https://github.com/llvm/llvm-project/pull/67861


More information about the cfe-commits mailing list