Skip to content

SRM: accept legal Portable PDB sequence-point boundary values - #136403

Merged
jkoritzinsky merged 2 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/feature-srm-pdb-boundaries
Oct 24, 2026
Merged

jkoritzinsky merged 2 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/feature-srm-pdb-boundaries

Conversation

@jkoritzinsky

Copy link
Copy Markdown
Member

Summary

Fix Portable PDB sequence-point reader boundary checks:

  • Accept column 65535, the legal maximum, instead of rejecting it.
  • Accept the full 29-bit compressed line range through 0x1fffffff, while rejecting the reserved hidden-line value when used as an ordinary coordinate.
  • Validate the initial line as well as delta-derived lines.

Includes boundary and malformed-input regressions. Related to the sequence-point work tracked in #135314; this is a separate library change independently based on main.

Existing workarounds

Roslyn caps columns at ushort.MaxValue - 1, explicitly citing this SRM off-by-one error. That cap is a compatibility workaround, not a special full-row sentinel.

Managed-ilasm source mapping #136396 likewise defaults omitted end columns to 65534 for compatibility with existing readers; see its pinned implementation. That PR preserves explicit legal maximum columns rather than clamping them and is not stacked on this change.

Validation already run

The isolated branch's SRM source subtree was verified identical to the supplied corrected build. Reused that build rather than performing another runtime baseline build.

$hostPath='E:\copilot-worktrees\runtime\dev-jkoritzinsky-glowing-meme\artifacts\bin\testhost\net11.0-windows-Debug-x64\dotnet.exe'
$testDir='E:\copilot-worktrees\runtime\dev-jkoritzinsky-glowing-meme\artifacts\bin\System.Reflection.Metadata.Tests\Debug\net11.0'
$runner='C:\Nuget\microsoft.dotnet.xunitconsolerunner\2.9.3-beta.26471.108\tools\net\xunit.console.dll'
& $hostPath exec --runtimeconfig "$testDir\System.Reflection.Metadata.Tests.runtimeconfig.json" --depsfile "$testDir\System.Reflection.Metadata.Tests.deps.json" $runner "$testDir\System.Reflection.Metadata.Tests.dll" -nologo -notrait category=OuterLoop -notrait category=failing -class System.Reflection.Metadata.Ecma335.Tests.PortablePdbBuilderTests
& $hostPath exec --runtimeconfig "$testDir\System.Reflection.Metadata.Tests.runtimeconfig.json" --depsfile "$testDir\System.Reflection.Metadata.Tests.deps.json" $runner "$testDir\System.Reflection.Metadata.Tests.dll" -nologo -notrait category=OuterLoop -notrait category=failing

Results: focused PortablePdbBuilderTests 52 passed, 0 failed/skipped; full net11 suite 937 passed, 0 failed, 1 existing skip (938 total). The runtime reader hash matched the product reader. net481 was not rerun during branch splitting/publication. No new test runs were performed for PR publication.

Note

This pull request description and code changes were prepared with GitHub Copilot assistance.

jkoritzinsky and others added 2 commits October 23, 2026 15:07
Validate initial and delta-encoded line numbers against the 29-bit Portable PDB range while excluding the hidden-line sentinel.

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

@jkoritzinsky
jkoritzinsky merged commit 47e0d08 into dotnet:main Oct 24, 2026
90 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 24, 2026
@jkoritzinsky
jkoritzinsky deleted the dev/jkoritzinsky/feature-srm-pdb-boundaries branch October 24, 2026 06:13
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants