-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[sanitizer] Downgrade TestPTrace() Reports to VReport #152350
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Thurston Dang (thurstond) ChangesRequested in #152072 (comment) Full diff: https://github.com/llvm/llvm-project/pull/152350.diff 1 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
index 5fde65ea48c42..2bf547f4a7216 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
@@ -413,11 +413,12 @@ static void TestPTrace() {
// internal_fork() on SPARC actually calls __fork(). We can't safely fork,
// because it's possible seccomp has been configured to disallow fork() but
// allow clone().
- Report("WARNING: skipping TestPTrace() because this is SPARC\n");
- Report(
- "If seccomp blocks ptrace, LeakSanitizer may hang without further "
- "notice\n");
- Report(
+ VReport(1, "WARNING: skipping TestPTrace() because this is SPARC\n");
+ VReport(1,
+ "If seccomp blocks ptrace, LeakSanitizer may hang without further "
+ "notice\n");
+ VReport(
+ 1,
"If seccomp does not block ptrace, you can safely ignore this warning\n");
# else
// Heuristic: only check the first time this is called. This is not always
@@ -438,7 +439,7 @@ static void TestPTrace() {
if (pid < 0) {
int rverrno;
if (internal_iserror(pid, &rverrno))
- Report("WARNING: TestPTrace() failed to fork (errno %d)\n", rverrno);
+ VReport(0, "WARNING: TestPTrace() failed to fork (errno %d)\n", rverrno);
// We don't abort the sanitizer - it's still worth letting the sanitizer
// try.
|
"If seccomp blocks ptrace, LeakSanitizer may hang without further " | ||
"notice\n"); | ||
Report( | ||
VReport(1, "WARNING: skipping TestPTrace() because this is SPARC\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we only run this function if verbose logging is on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-SPARC case has logging for verbosity >= 0. It would be ugly to add an extra check for verbosity only for SPARC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually, this function is only called once (for leak detection at the end of the program execution); it's rare for users to manually trigger leak detection. In any case, the overhead of calling this function is low compared to the rest of leak detection.
Requested in #152072 (comment)