{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/19979","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/19979/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/19979/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/19979/events","html_url":"https://github.com/JuliaLang/julia/issues/19979","id":200094192,"node_id":"MDU6SXNzdWUyMDAwOTQxOTI=","number":19979,"title":"Wrong stacktrace shown when rethrowing an exception after catching another one","user":{"login":"martinholters","id":15785210,"node_id":"MDQ6VXNlcjE1Nzg1MjEw","avatar_url":"https://avatars0.githubusercontent.com/u/15785210?v=4","gravatar_id":"","url":"https://api.github.com/users/martinholters","html_url":"https://github.com/martinholters","followers_url":"https://api.github.com/users/martinholters/followers","following_url":"https://api.github.com/users/martinholters/following{/other_user}","gists_url":"https://api.github.com/users/martinholters/gists{/gist_id}","starred_url":"https://api.github.com/users/martinholters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinholters/subscriptions","organizations_url":"https://api.github.com/users/martinholters/orgs","repos_url":"https://api.github.com/users/martinholters/repos","events_url":"https://api.github.com/users/martinholters/events{/privacy}","received_events_url":"https://api.github.com/users/martinholters/received_events","type":"User","site_admin":false},"labels":[{"id":119746705,"node_id":"MDU6TGFiZWwxMTk3NDY3MDU=","url":"https://api.github.com/repos/JuliaLang/julia/labels/error%20handling","name":"error handling","color":"02d7e1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/JuliaLang/julia/milestones/27","html_url":"https://github.com/JuliaLang/julia/milestone/27","labels_url":"https://api.github.com/repos/JuliaLang/julia/milestones/27/labels","id":3013616,"node_id":"MDk6TWlsZXN0b25lMzAxMzYxNg==","number":27,"title":"1.0.x","description":"Performance issues, bugs and documentation to fix before or after 1.0 as we're able.","creator":{"login":"StefanKarpinski","id":153596,"node_id":"MDQ6VXNlcjE1MzU5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/153596?v=4","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"open_issues":51,"closed_issues":14,"state":"open","created_at":"2018-01-04T19:20:38Z","updated_at":"2018-06-29T00:49:39Z","due_on":null,"closed_at":null},"comments":20,"created_at":"2017-01-11T13:32:40Z","updated_at":"2018-07-02T05:08:16Z","closed_at":null,"author_association":"MEMBER","body":"```julia\r\nfunction foo()\r\n    try\r\n        error(\"error in foo\")\r\n    catch e\r\n    end\r\nend\r\n\r\nfunction bar()\r\n    try\r\n        error(\"error in bar\")\r\n    catch e\r\n        foo()\r\n        rethrow(e)\r\n    end\r\nend\r\n\r\nbar()\r\n```\r\nproduces the misleading\r\n```julia\r\nERROR: error in bar\r\nStacktrace:\r\n [1] foo() at ./REPL[1]:3\r\n [2] bar() at ./REPL[2]:5\r\n```\r\n\r\nThis just hit me in a really wicked situation: The stacktrace actually lead me to a line erroneously throwing the reported exception. I fixed it (to throw the correct exception), but the same error kept showing, leaving me completely puzzled for quite some time..."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/401673792","html_url":"https://github.com/JuliaLang/julia/issues/19979#issuecomment-401673792","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/19979","id":401673792,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTY3Mzc5Mg==","user":{"login":"c42f","id":601473,"node_id":"MDQ6VXNlcjYwMTQ3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/601473?v=4","gravatar_id":"","url":"https://api.github.com/users/c42f","html_url":"https://github.com/c42f","followers_url":"https://api.github.com/users/c42f/followers","following_url":"https://api.github.com/users/c42f/following{/other_user}","gists_url":"https://api.github.com/users/c42f/gists{/gist_id}","starred_url":"https://api.github.com/users/c42f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c42f/subscriptions","organizations_url":"https://api.github.com/users/c42f/orgs","repos_url":"https://api.github.com/users/c42f/repos","events_url":"https://api.github.com/users/c42f/events{/privacy}","received_events_url":"https://api.github.com/users/c42f/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T05:08:16Z","updated_at":"2018-07-02T05:08:16Z","author_association":"CONTRIBUTOR","body":"To follow on from the above, a possible implementation plan:\r\n\r\nFirst, fix the bugs in the current implementation.  This should give experience\r\ngoing to the next step:\r\n\r\n* [ ] Fix thread local exception problems.  Either\r\n  - Move `exception_in_transit` from thread local to task local storage in `_jl_task_t` or\r\n  - Leave as is, but persist the exception state into the task during task\r\n    switching.\r\n  What's the difference here?  There's two things:\r\n  - A potential perf difference, trading task switching perf for task startup\r\n    time and memory usage.\r\n  - Putting it on the task, we can't throw exceptions before the root task is\r\n    initialized.\r\n\r\n* [ ] Fix thread local backtrace buffer.  See above.\r\n\r\n* [ ] Add exception stack to task, perhaps based on a linked list?  Allow the\r\n  first node to be reused so that perf doesn't crater with a pure\r\n\r\n* [ ] Perf testing\r\n  * [ ] Cost of a try block with non-thrown exceptions should be not worse\r\n  * [ ] Cost of `try throw(\"\"); end` should not be worse."}}
{"actor":{"display_login":"c42f"}}