When parsing stacks we frequently encounter elided frames. The actual stack line looks something like ...23 frames elided..., which is passed to parseFuncName, which of course is not parsable as a function name. As a result, whenever this happens we get a useless panic like the following:
panic: Failed to parse stack trace: parse function: no function found: "...23 frames elided..."
goroutine 1 [running]:
go.uber.org/goleak/internal/stack.getStackBuffer(0x1)
/home/runner/go/pkg/mod/go.uber.org/goleak@v1.3.0/internal/stack/stacks.go:240 +0x65
go.uber.org/goleak/internal/stack.getStacks(0x1)
/home/runner/go/pkg/mod/go.uber.org/goleak@v1.3.0/internal/stack/stacks.go:84 +0x3b
go.uber.org/goleak/internal/stack.All(...)
/home/runner/go/pkg/mod/go.uber.org/goleak@v1.3.0/internal/stack/stacks.go:229
go.uber.org/goleak.Find({0xc0003ae880, 0x4, 0x4})
/home/runner/go/pkg/mod/go.uber.org/goleak@v1.3.0/leaks.go:65 +0x1ea
This PR gracefully handles elided frames to prevent the panic.
When parsing stacks we frequently encounter elided frames. The actual stack line looks something like
...23 frames elided...
, which is passed toparseFuncName
, which of course is not parsable as a function name. As a result, whenever this happens we get a useless panic like the following:This PR gracefully handles elided frames to prevent the panic.