-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix OOM crash (exit 137) in System.Runtime.Tests OuterLoop on Linux Debug/Checked CoreCLR #126013
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1026,19 +1026,18 @@ private static void AllocateUninitializedArray() | |||||
| arr[i - 1] = "17"; | ||||||
| Assert.True(arr[0] == "5" && arr[i - 1] == "17"); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| // allocate max size byte array | ||||||
| { | ||||||
| if (IntPtr.Size == 8) | ||||||
| { | ||||||
| int i = 0x7FFFFFC7; | ||||||
| var arr = GC.AllocateUninitializedArray<byte>(i); | ||||||
| [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsReleaseRuntime))] | ||||||
| [OuterLoop] | ||||||
|
Comment on lines
+1031
to
+1032
|
||||||
| private static void AllocateUninitializedArray_MaxSize() | ||||||
| { | ||||||
| int i = 0x7FFFFFC7; | ||||||
|
||||||
| int i = 0x7FFFFFC7; | |
| int i = Array.MaxLength; |
Copilot
AI
Mar 24, 2026
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 guard here (IsReleaseRuntime) skips this max-size allocation on all non-Release runtime builds across OSes/runtimes. The PR description says the issue is specific to Linux Debug/Checked CoreCLR, so this condition looks broader than intended; consider adding narrower conditions (e.g., IsLinux and/or IsCoreCLR) or updating the PR description to match the new behavior.
Copilot
AI
Mar 24, 2026
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.
0x7FFFFFC7 is a magic number. Consider using Array.MaxLength (or a named constant) to self-document that this is the maximum supported array length and avoid duplicating the value in multiple tests.
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 difference between checked and release runtime overhead is negligible relative to the GBs of memory that this test allocates.
IsReleaseRuntimecondition does not make sense to me.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.
If we are seeing these failures on checked build only, it suggests that there is something very inefficient in checked runtime for arrays of this size. We should fix that instead of disabling the test.
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.
Sounds good