{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/14432","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14432/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14432/comments","events_url":"https://api.github.com/repos/golang/go/issues/14432/events","html_url":"https://github.com/golang/go/issues/14432","id":135121479,"number":14432,"title":"runtime: error returned by os.OpenFile blocks panic handler","user":{"login":"mxk","id":7256995,"avatar_url":"https://avatars.githubusercontent.com/u/7256995?v=3","gravatar_id":"","url":"https://api.github.com/users/mxk","html_url":"https://github.com/mxk","followers_url":"https://api.github.com/users/mxk/followers","following_url":"https://api.github.com/users/mxk/following{/other_user}","gists_url":"https://api.github.com/users/mxk/gists{/gist_id}","starred_url":"https://api.github.com/users/mxk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxk/subscriptions","organizations_url":"https://api.github.com/users/mxk/orgs","repos_url":"https://api.github.com/users/mxk/repos","events_url":"https://api.github.com/users/mxk/events{/privacy}","received_events_url":"https://api.github.com/users/mxk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-20T21:18:36Z","updated_at":"2016-02-20T21:18:36Z","closed_at":null,"body":"go1.6 windows/amd64 on Windows 8\r\n\r\nThe following program tries to create a new file with os.O_EXCL and panics if the file already exists. When `panic(err)` is called, \"panic:\" is written to stderr and the program blocks. You have to terminate it with Ctrl-C. If you uncomment err.Error() then you get a normal backtrace and the program exits.\r\n\r\nI'm guessing that there is a problem with retrieving the error information in the panic handler, but if done before panicking, then everything works as expected.\r\n\r\n```go\r\npackage main\r\n\r\nimport \"os\"\r\n\r\nfunc main() {\r\n\t_, err := os.OpenFile(\"tmp\", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666)\r\n\tif err != nil {\r\n\t\t//err.Error()\r\n\t\tpanic(err)\r\n\t}\r\n}\r\n```"}}