Skip to content

[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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

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
Expand All @@ -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.
Expand Down
Loading