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 Jan 9, 2019
Merged
Conversation
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.
Member
|
Thanks for the PR Keith, I appreciate it.
However I might have to figure a way to revert errors.Frame to a uintptr. It turns out there are too many libraries that are depending on this library which are not using dependency management.
… On 9 Jan 2019, at 10:27, Keith Randall ***@***.***> wrote:
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.
You can view, comment on, or merge this pull request online at:
#192
Commit Summary
errors: detect unknown frames correctly
File Changes
M format_test.go (24)
M stack.go (5)
Patch Links:
https://github.com/pkg/errors/pull/192.patch
https://github.com/pkg/errors/pull/192.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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. |
Member
|
Thanks Keith, will do.
… On 9 Jan 2019, at 10:35, Keith Randall ***@***.***> wrote:
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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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.