Skip to content

Keep stack frames that have no parameter list - #1865

Merged
SimonCropp merged 1 commit into
mainfrom
fix-parenless-stack-frames
Aug 17, 2026
Merged

Keep stack frames that have no parameter list#1865
SimonCropp merged 1 commit into
mainfrom
fix-parenless-stack-frames

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

ScrubStackTrace trims each at frame at its closing paren, but not every frame has one. NativeAOT renders unresolved frames as:

at MyApp!<BaseAddress>+0x1a2b3c

Both IndexOf calls return -1, so span[..(indexOfRight + 1)] keeps zero characters and the frame becomes an empty line — or the literal ...) under removeParams. Captured on main:

System.Exception: Boom
                                 <- the frame
at MyApp.Program.Main(String[] args)
                                 <- and this one vanished entirely, trailing newline trimmed

Frames with no parameter list are now emitted as they are. That also leaves the + in the offset alone — routing them through WriteReplacePlus would have rewritten +0x1a2b3c to .0x1a2b3c, since that helper exists to turn the nested type separator into a dot.

NoParens and NoParens_RemoveParams cover both paths, each mixing unresolved frames with a normal one. Verify.Tests (1301) passes.

The scrubber trims each `at` frame at its closing paren, but not every frame has
one: NativeAOT renders unresolved frames as `at MyApp!<BaseAddress>+0x1a2b3c`.
Both IndexOf calls returned -1, so the slice kept zero characters and the frame
became an empty line, or the literal `...)` with removeParams.

Such frames are now emitted as they are, which also leaves the `+` of the offset
alone rather than reading it as a nested type separator.
@SimonCropp SimonCropp added this to the 32.0.0 milestone Aug 17, 2026
@SimonCropp
SimonCropp merged commit 33c70cb into main Aug 17, 2026
7 checks passed
@SimonCropp
SimonCropp deleted the fix-parenless-stack-frames branch August 17, 2026 12:29
This was referenced Aug 26, 2026
This was referenced Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant