Skip to content

[MSan] Pass -fsanitize-ignorelist to the instrumented libcxxabi #83652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

arichardson
Copy link
Member

This ensures that the MSan unit tests are able to pass with an
uninstrumented libunwind. We need to avoid instrumentation for
__gxx_personality_v0, which is part of the default msan_ignorelist.txt
that is installed into the resource directory. However, if we are trying
to test the just-built libraries, this global ignore list may not be
present yet, so we still instrument the function.

Arguably this function should not be on the default ignore list since it
is only a problem when building libcxxabi with MSan instrumentation and
without an instrumented libunwind, so maybe the logic should really be
part of the libcxxabi build. However, that could be done as a follow-up.

See 2f856a3 for more context.

Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented Mar 2, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Alexander Richardson (arichardson)

Changes

This ensures that the MSan unit tests are able to pass with an
uninstrumented libunwind. We need to avoid instrumentation for
__gxx_personality_v0, which is part of the default msan_ignorelist.txt
that is installed into the resource directory. However, if we are trying
to test the just-built libraries, this global ignore list may not be
present yet, so we still instrument the function.

Arguably this function should not be on the default ignore list since it
is only a problem when building libcxxabi with MSan instrumentation and
without an instrumented libunwind, so maybe the logic should really be
part of the libcxxabi build. However, that could be done as a follow-up.

See 2f856a3 for more context.


Full diff: https://github.com/llvm/llvm-project/pull/83652.diff

1 Files Affected:

  • (modified) compiler-rt/lib/msan/tests/CMakeLists.txt (+2-1)
diff --git a/compiler-rt/lib/msan/tests/CMakeLists.txt b/compiler-rt/lib/msan/tests/CMakeLists.txt
index 0d43f432ab6a37..4f09f1e6a691fa 100644
--- a/compiler-rt/lib/msan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/msan/tests/CMakeLists.txt
@@ -10,7 +10,8 @@ set(MSAN_LIBCXX_CFLAGS
   -fsanitize-memory-track-origins
   -fno-sanitize-memory-param-retval  # unittests test mostly this mode.
   -Wno-pedantic
-  -Xclang -fdepfile-entry=${COMPILER_RT_OUTPUT_DIR}/share/msan_ignorelist.txt
+    # Do not instrument __gxx_personality_v0 (part of libcxxabi)
+  -fsanitize-ignorelist=${COMPILER_RT_OUTPUT_DIR}/share/msan_ignorelist.txt
   )
 
 # Unittest sources and build flags.

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
mtrofin and others added 2 commits March 6, 2024 22:13
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@arichardson arichardson changed the base branch from users/arichardson/spr/main.msan-pass-fsanitize-ignorelist-to-the-instrumented-libcxxabi to main March 7, 2024 06:14
@arichardson arichardson merged commit 95bde4b into main Mar 7, 2024
@arichardson arichardson deleted the users/arichardson/spr/msan-pass-fsanitize-ignorelist-to-the-instrumented-libcxxabi branch March 7, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants