Repository navigation
Description
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1414905
Pipeline: runtime-coreclr libraries-pgo (definition 145)
Affected leg: linux-x64 Release
Error Message
{
"ErrorMessage": ["bufferSize ('-1') must be a non-negative and non-zero value"],
"BuildRetry": false,
"ExcludeConsoleLog": false
}Summary
System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException fails under PGO (libraries-pgo pipeline). The test expects that new StreamReader(path, Encoding.UTF8, true, -1) does not throw, but under PGO it throws ArgumentOutOfRangeException: bufferSize ('-1') must be a non-negative and non-zero value.
The StreamReader(string, Encoding, bool, int) constructor calls ValidateArgsAndOpenPath(path, bufferSize) which skips validation for -1, then chains to the Stream-based constructor which converts -1 to DefaultBufferSize. Under normal execution this works; the PGO-compiled code path may be reordering or inlining in a way that hits validation before the -1 → default conversion.
Impact on platforms
runtime-coreclr libraries-pgo(def 145) ·linux-x64 Release· exit code 1
Console log
System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException [FAIL]
System.ArgumentOutOfRangeException : bufferSize ('-1') must be a non-negative and non-zero value. (Parameter 'bufferSize')
Stack Trace:
at System.ArgumentOutOfRangeException.ThrowNegativeOrZero[T](T value, String paramName)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException()
First build it occurred
Present in builds 1414905 (May 10) and 1414533 (May 9). ≥2 occurrences.
Recommended action
Investigate whether PGO-guided inlining/optimization is changing the evaluation order of ValidateArgsAndOpenPath and the Stream ctor's bufferSize check. The -1 sentinel value should be converted to DefaultBufferSize before ThrowIfNegativeOrZero runs.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
dotnet.github.io
To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:
network:
allowed:
- defaults
- "dotnet.github.io"See Network Configuration for more information.
Note
🔒 Integrity filter blocked 4 items
The following items were blocked because they don't meet the GitHub integrity level.
- #116358
search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". - #86273
search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". - #125436
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". - #128019
search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
To allow these resources, lower min-integrity in your GitHub frontmatter:
tools:
github:
min-integrity: approved # merged | approved | unapproved | noneGenerated by CI Outer-Loop Failure Scanner · ● 56.5M · ◷
Report
| Build | Definition | Test | Pull Request |
|---|---|---|---|
| 1416672 | dotnet/runtime | System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException | #126671 |
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 1 | 1 | 1 |
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1414905
Error message validated: [NegativeOneBufferSize_ShouldNotThrowException System.ArgumentOutOfRangeException]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 5/12/2026 11:31:36 AM UTC
Report
| Build | Definition | Test | Pull Request |
|---|---|---|---|
| 1416672 | dotnet/runtime | System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException | #126671 |
| 1414905 | dotnet/runtime | System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException |
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 2 | 2 |
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1414905
Error message validated: [NegativeOneBufferSize_ShouldNotThrowException System.ArgumentOutOfRangeException]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 5/12/2026 11:31:36 AM UTC
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1414905
Error message validated: [bufferSize ('-1') must be a non-negative and non-zero value]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 5/13/2026 8:12:07 AM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 4 | 8 | 16 |
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1414905
Error message validated: [NegativeOneBufferSize_ShouldNotThrowException System.ArgumentOutOfRangeException]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 5/12/2026 11:31:36 AM UTC
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1414905
Error message validated: [bufferSize ('-1') must be a non-negative and non-zero value]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 5/13/2026 8:12:07 AM UTC
Activity
dotnet-policy-service commentedon May 12, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
kg commentedon May 22, 2026
Failed in (1):
Console Log: Console Log
Source: runtime-coreclr libraries-pgo / net11.0-linux-Release-x64-jitosr_stress_random-AzureLinux.3.Amd64.Open / System.IO.Tests.StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowException
Generated by ci-pipeline-monitor/scripts/update_github.py
github-actions commentedon Jun 18, 2026
Workflow artifact: ci-fix
Artifact kind: handoff
Linked KBE: #128062
Note
AI/Copilot-generated triage note.
This Known Build Error has no producible automated code change (reason: JIT/PGO miscompilation — the product code is correct and the fix requires changes to JIT optimization passes, which exceeds automated bounds), so I could not open even a best-effort PR. Looping in owners so it can be fixed forward rather than muted.
Root cause (best analysis)
StreamReader_StringCtorTests.NegativeOneBufferSize_ShouldNotThrowExceptionfails under PGO (runtime-coreclr libraries-pgo) because PGO-guided inlining miscompiles the-1sentinel handling inStreamReader.The product code in
System.Private.CoreLib/src/System/IO/StreamReader.csis correct:StreamReader(string path, Encoding, bool, int bufferSize)(line 199) chains to:ValidateArgsAndOpenPath(path, bufferSize)— which skipsThrowIfNegativeOrZerowhenbufferSize == -1(line 230)-1toDefaultBufferSizebefore callingThrowIfNegativeOrZeroUnder PGO, when both
ValidateArgsAndOpenPathand the stream constructor are inlined into the string-path constructor, the JIT appears to miscompile the conditional branch that converts-1toDefaultBufferSize. The stack trace confirms inlining:The intermediate
StreamReader(Stream, ...)frame is absent, confirming it was inlined. TheThrowNegativeOrZero(-1)call fires despite the guardingif (bufferSize == -1)check.Evidence
Suggested reviewers / area contacts
@EgorBo(already assigned, milestone 11.0.0)area-CodeGen-coreclr):@JulieLeeMSFT,@jakobbotschThe fix likely involves the JIT's handling of conditional branches around
ThrowIfNegativeOrZerowhen inlining across constructor chains under PGO.Note
🔒 Integrity filter blocked 1 item
The following item was blocked because it doesn't meet the GitHub integrity level.
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:JIT: fix stale VN in redundant branch opts dominating-branch simplifi…
JIT: fix stale VN in redundant branch opts dominating-branch simplifi…