Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

errors: detect unknown frames correctly#192

Merged
davecheney merged 1 commit intopkg:masterfrom
randall77:master
Jan 9, 2019
Merged

errors: detect unknown frames correctly#192
davecheney merged 1 commit intopkg:masterfrom
randall77:master

Conversation

@randall77
Copy link
Contributor

With Go 1.12, we will now be doing mid-stack inlining. This exposes
inlined frames to runtime.Callers and friends.

The spec says that a runtime.Frame may have a nil Func field for
inlined functions. Instead, use the Function field to detect whether
we really have an empty Frame.

With Go 1.12, we will now be doing mid-stack inlining. This exposes
inlined frames to runtime.Callers and friends.

The spec says that a runtime.Frame may have a nil Func field for
inlined functions. Instead, use the Function field to detect whether
we really have an empty Frame.
@davecheney
Copy link
Member

davecheney commented Jan 8, 2019 via email

@randall77
Copy link
Contributor Author

If you're going to go back to []uintptr for the stack, you should use the runtime.Callers to get the []uintptr, then subtract 1 before calling FuncForPC for each of the entries. That should still work with 1.12. (And don't subtract 1 from the result of runtime.Caller.)

Feel free to use the test, though. We have an internal Google test that was tripping up on the wrapper issue.

@davecheney
Copy link
Member

davecheney commented Jan 8, 2019 via email

@davecheney davecheney added this to the 0.9 milestone Jan 9, 2019
@davecheney davecheney merged commit 72fa05e into pkg:master Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants