Skip to content

Panics aren't handled correctly #6

@akalin-keybase

Description

@akalin-keybase

The docs for runtime.Callers() ( https://golang.org/pkg/runtime/#Callers ) says:

To look up the file and line number of the call itself, use pc[i]-1. As an exception to this rule, if pc[i-1] corresponds to the function runtime.sigpanic, then pc[i] is the program counter of a faulting instruction and should be used without any subtraction.

It doesn't look like this library implements the second part, since it only converts a frame one at a time.

If I get some time, I can do a pull request. I'd like to add an argument to NewStackFrame(), like bool triggeredPanic or something, but I don't know how much code actually calls that directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions