Prevent OS core dump creation for intentionally crashing tests#113732
Merged
janvorli merged 3 commits intodotnet:mainfrom Mar 20, 2025
Merged
Prevent OS core dump creation for intentionally crashing tests#113732janvorli merged 3 commits intodotnet:mainfrom
janvorli merged 3 commits intodotnet:mainfrom
Conversation
There are three coreclr tests that intentionally run a crashing secondary process. While the CreateDump invocation on crash for these tests was already disabled, the OS core dump creation was still happening. In the CI this was causing test machines getting out of disk space. This change disables OS core dump creation for those tests. Close dotnet#113652
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR disables OS core dump generation for intentionally crashing tests to prevent disk space issues in CI environments. Key changes include:
- Adding a new struct RLimit and a DllImport for setrlimit in Utilities.cs.
- Implementing and invoking the DisableOSCoreDump() method in multiple test files.
- Updating test entry points to call Utilities.DisableOSCoreDump() before executing intentional crashes.
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/Common/CoreCLRTestLibrary/Utilities.cs | Introduces the RLimit struct, RLIMIT_CORE constant, and DisableOSCoreDump() method to disable core dumps |
| src/tests/baseservices/exceptions/stackoverflow/stackoverflow3.cs | Calls DisableOSCoreDump() in Main() to prevent OS core dump generation |
| src/tests/baseservices/exceptions/unhandled/unhandled.cs | Adds a call to DisableOSCoreDump() in Main() before throwing an exception |
| src/tests/baseservices/exceptions/stackoverflow/stackoverflow.cs | Inserts DisableOSCoreDump() call to disable OS core dump for secondary threads tests |
| src/tests/baseservices/exceptions/simple/ParallelCrash.cs | Ensures DisableOSCoreDump() is invoked before triggering parallel crashes |
Files not reviewed (3)
- src/tests/baseservices/exceptions/simple/ParallelCrashTester.csproj: Language not supported
- src/tests/baseservices/exceptions/stackoverflow/stackoverflow.csproj: Language not supported
- src/tests/baseservices/exceptions/stackoverflow/stackoverflow3.csproj: Language not supported
AaronRobinsonMSFT
approved these changes
Mar 20, 2025
Member
AaronRobinsonMSFT
left a comment
There was a problem hiding this comment.
LGTM once the CR is green.
jkotas
reviewed
Mar 20, 2025
* call the setrlimit explicitly on Linux / macOS only * fix missing reference to the CoreCLRTestLibrary.csproj in the ParallelCrash.csproj. I have accidentally put it into ParallelCrashTester.csproj instead.
AaronRobinsonMSFT
approved these changes
Mar 20, 2025
AaronRobinsonMSFT
approved these changes
Mar 20, 2025
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
AaronRobinsonMSFT
approved these changes
Mar 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are three coreclr tests that intentionally run a crashing secondary process. While the CreateDump invocation on crash for these tests was already disabled, the OS core dump creation was still happening. In the CI this was causing test machines getting out of disk space. This change disables OS core dump creation for those tests.
Close #113652