{"action":"created","issue":{"url":"https://api.github.com/repos/facebookgo/stack/issues/1","labels_url":"https://api.github.com/repos/facebookgo/stack/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/facebookgo/stack/issues/1/comments","events_url":"https://api.github.com/repos/facebookgo/stack/issues/1/events","html_url":"https://github.com/facebookgo/stack/pull/1","id":120442491,"number":1,"title":"bugfix wrong line number reporting","user":{"login":"frairon","id":6941321,"avatar_url":"https://avatars.githubusercontent.com/u/6941321?v=3","gravatar_id":"","url":"https://api.github.com/users/frairon","html_url":"https://github.com/frairon","followers_url":"https://api.github.com/users/frairon/followers","following_url":"https://api.github.com/users/frairon/following{/other_user}","gists_url":"https://api.github.com/users/frairon/gists{/gist_id}","starred_url":"https://api.github.com/users/frairon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frairon/subscriptions","organizations_url":"https://api.github.com/users/frairon/orgs","repos_url":"https://api.github.com/users/frairon/repos","events_url":"https://api.github.com/users/frairon/events{/privacy}","received_events_url":"https://api.github.com/users/frairon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebookgo/stack/labels/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-04T16:56:07Z","updated_at":"2015-12-07T07:46:11Z","closed_at":"2015-12-07T04:46:08Z","pull_request":{"url":"https://api.github.com/repos/facebookgo/stack/pulls/1","html_url":"https://github.com/facebookgo/stack/pull/1","diff_url":"https://github.com/facebookgo/stack/pull/1.diff","patch_url":"https://github.com/facebookgo/stack/pull/1.patch"},"body":"The bug occured when using *stack* with *ensure* which always reported the next instruction as failing instruction.\r\n\r\nAccording to \r\nhttps://golang.org/src/runtime/extern.go?s=8754:8794#L169\r\n\r\n> Note that since each slice entry pc[i] is a return program counter, looking up the file and line for pc[i] (for example, using (*Func).FileLine) will return the file and line number of the instruction immediately following the call. 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.\r\n\r\nThe correct line is now reported but I'm not sure how to check for runtime.sigpanic as function origin."},"comment":{"url":"https://api.github.com/repos/facebookgo/stack/issues/comments/162439231","html_url":"https://github.com/facebookgo/stack/pull/1#issuecomment-162439231","issue_url":"https://api.github.com/repos/facebookgo/stack/issues/1","id":162439231,"user":{"login":"frairon","id":6941321,"avatar_url":"https://avatars.githubusercontent.com/u/6941321?v=3","gravatar_id":"","url":"https://api.github.com/users/frairon","html_url":"https://github.com/frairon","followers_url":"https://api.github.com/users/frairon/followers","following_url":"https://api.github.com/users/frairon/following{/other_user}","gists_url":"https://api.github.com/users/frairon/gists{/gist_id}","starred_url":"https://api.github.com/users/frairon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frairon/subscriptions","organizations_url":"https://api.github.com/users/frairon/orgs","repos_url":"https://api.github.com/users/frairon/repos","events_url":"https://api.github.com/users/frairon/events{/privacy}","received_events_url":"https://api.github.com/users/frairon/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T07:46:11Z","updated_at":"2015-12-07T07:46:11Z","body":"No problem, it just bugged me too :)"}}