Skip to content

[utils/not] Disable coredumps when --crash is passed #83704

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

We are expecting a crash, so it is unlikely that a coredump is going to
be particularly useful. For debugging the program can always be run without
the not --crash wrapper.

Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented Mar 3, 2024

@llvm/pr-subscribers-testing-tools

Author: Alexander Richardson (arichardson)

Changes

We are expecting a crash, so it is unlikely that a coredump is going to
be particularly useful. For debugging the program can always be run without
the not --crash wrapper.


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

1 Files Affected:

  • (modified) llvm/utils/not/not.cpp (+4)
diff --git a/llvm/utils/not/not.cpp b/llvm/utils/not/not.cpp
index 4fcc0e89fc4023..1504ee87a3606c 100644
--- a/llvm/utils/not/not.cpp
+++ b/llvm/utils/not/not.cpp
@@ -12,6 +12,7 @@
 //     Will return true if cmd crashes (e.g. for testing crash reporting).
 
 #include "llvm/Support/Program.h"
+#include "llvm/Support/Process.h"
 #include "llvm/Support/WithColor.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -41,6 +42,9 @@ int main(int argc, const char **argv) {
     setenv("LLVM_DISABLE_CRASH_REPORT", "1", 0);
     setenv("LLVM_DISABLE_SYMBOLIZATION", "1", 0);
 #endif
+    // Try to disable coredumps for expected crashes as well since this can
+    // noticeably slow down running the test suite.
+    sys::Process::PreventCoreFiles();
   }
 
   if (argc == 0)

Copy link

github-actions bot commented Mar 3, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once clang-format has been placated.

Created using spr 1.3.6-beta.1
@arichardson arichardson merged commit 53a656d into main Mar 4, 2024
@arichardson arichardson deleted the users/arichardson/spr/utilsnot-disable-coredumps-when-crash-is-passed branch March 4, 2024 18:45
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.

3 participants