fix: Handle leading whitespace in elided frames marker#138
Open
homme wants to merge 1 commit intouber-go:masterfrom
Open
fix: Handle leading whitespace in elided frames marker#138homme wants to merge 1 commit intouber-go:masterfrom
homme wants to merge 1 commit intouber-go:masterfrom
Conversation
The stack trace elision marker "...N frames elided..." can appear with
leading whitespace (tabs/spaces) in deep call stacks, particularly from
AWS SDK v2 middleware chains (33+ frames).
The parser was only checking for lines starting with "...", causing it
to pass indented elision markers to parseFuncName(), which panicked with
"no function found".
This fix trims whitespace before checking for the elision marker pattern,
allowing both indented and non-indented markers to be handled gracefully.
Example stack trace triggering the issue (Go 1.25.1):
github.com/aws/aws-sdk-go-v2/service/sqs.(*disableHTTPSMiddleware).HandleFinalize(...)
/go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/sqs@v1.42.11/api_client.go:864 +0x143
...33 frames elided...
github.com/aws/aws-sdk-go-v2/aws/middleware.ClientRequestID.HandleBuild(...)
/go/pkg/mod/github.com/aws/aws-sdk-go-v2@v1.39.4/aws/middleware/middleware.go:42 +0x1e5
9700612 to
94b42c7
Compare
SlevinWasAlreadyTaken
approved these changes
Jan 22, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes panic when parsing stack traces with indented elided frames marker.
Problem
Go's runtime can elide frames in very deep stack traces (e.g., AWS SDK v2 middleware with 33+ frames). The elision marker
...N frames elided...appears with leading whitespace (tabs/spaces), but the parser only checked for lines starting with....When the indented marker wasn't caught, it was passed to
parseFuncName(), causing a panic:no function found: "...33 frames elided..."Solution
Trim whitespace before checking for the elision marker pattern. This allows both indented and non-indented markers to be handled gracefully.
Example (Go 1.25.1)
Note the leading whitespace before
...33 frames elided....