{"action":"closed","issue":{"url":"https://api.github.com/repos/mruby/mruby/issues/2902","labels_url":"https://api.github.com/repos/mruby/mruby/issues/2902/labels{/name}","comments_url":"https://api.github.com/repos/mruby/mruby/issues/2902/comments","events_url":"https://api.github.com/repos/mruby/mruby/issues/2902/events","html_url":"https://github.com/mruby/mruby/issues/2902","id":98062881,"number":2902,"title":"broken exception backtraces","user":{"login":"yregelman","id":2567678,"avatar_url":"https://avatars.githubusercontent.com/u/2567678?v=3","gravatar_id":"","url":"https://api.github.com/users/yregelman","html_url":"https://github.com/yregelman","followers_url":"https://api.github.com/users/yregelman/followers","following_url":"https://api.github.com/users/yregelman/following{/other_user}","gists_url":"https://api.github.com/users/yregelman/gists{/gist_id}","starred_url":"https://api.github.com/users/yregelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yregelman/subscriptions","organizations_url":"https://api.github.com/users/yregelman/orgs","repos_url":"https://api.github.com/users/yregelman/repos","events_url":"https://api.github.com/users/yregelman/events{/privacy}","received_events_url":"https://api.github.com/users/yregelman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-30T01:21:58Z","updated_at":"2015-12-29T14:49:33Z","closed_at":"2015-12-29T14:49:33Z","body":"```\r\ndef raise_func\r\n  raise \"noise\"\r\nend\r\n\r\ndef err_func\r\n  raise_func\r\nend\r\n\r\ndef use_some_more_stack\r\n  puts \"used some more stack\"\r\nend\r\n\r\ndef use_some_stack\r\n  puts \"used some stack\"\r\n  use_some_more_stack\r\nend\r\n\r\ndef func1\r\n  begin\r\n    err_func\r\n  rescue => e\r\n    use_some_stack\r\n    e.backtrace.each { |entry|\r\n      p entry\r\n    }\r\n  end\r\nend\r\n\r\ndef func2\r\n  begin\r\n    err_func\r\n  rescue => e\r\n    e.backtrace.each { |entry|\r\n      p entry\r\n    }\r\n  end\r\nend\r\n      \r\n\r\nfunc1\r\nfunc2\r\n```\r\n$>ruby broken_backtrace.rb \r\nused some stack\r\nused some more stack\r\n\"broken_backtrace.rb:2:in raise_func\"\r\n\"broken_backtrace.rb:6:in err_func\"\r\n\"broken_backtrace.rb:20:in func1\"\r\n\"broken_backtrace.rb:40:in main\"\r\n\"broken_backtrace.rb:2:in raise_func\"\r\n\"broken_backtrace.rb:6:in err_func\"\r\n\"broken_backtrace.rb:31:in func2\"\r\n\"broken_backtrace.rb:41:in main\"\r\n\r\n$>mruby broken_backtrace.rb \r\nused some stack\r\nused some more stack\r\n\"broken_backtrace.rb:10:in Object.use_some_more_stack\"\r\n\"broken_backtrace.rb:23:in Object.func1\"\r\n\"broken_backtrace.rb:40\"\r\n\"broken_backtrace.rb:2:in Object.raise_func\"\r\n\"broken_backtrace.rb:33:in Object.func2\"\r\n\"broken_backtrace.rb:41\r\n\r\nI see several discrepancies:\r\n1. err_func is not mentioned in the backtraces given by mruby\r\n2. line numbers differ for 'func1' and 'func2' entries between mruby and ruby\r\n3. in backtrace for 'func1',  'raise_func' is replaced by 'use_some_more_stack'  even though it was not on the call stack when the exception was thrown, but was called right before printing the backstack \r\n"}}