{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/13444","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/13444/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/13444/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/13444/events","html_url":"https://github.com/JuliaLang/julia/pull/13444","id":109662808,"number":13444,"title":"Improve parse_eval_all line number reporting","user":{"login":"ihnorton","id":327706,"avatar_url":"https://avatars.githubusercontent.com/u/327706?v=3","gravatar_id":"","url":"https://api.github.com/users/ihnorton","html_url":"https://github.com/ihnorton","followers_url":"https://api.github.com/users/ihnorton/followers","following_url":"https://api.github.com/users/ihnorton/following{/other_user}","gists_url":"https://api.github.com/users/ihnorton/gists{/gist_id}","starred_url":"https://api.github.com/users/ihnorton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihnorton/subscriptions","organizations_url":"https://api.github.com/users/ihnorton/orgs","repos_url":"https://api.github.com/users/ihnorton/repos","events_url":"https://api.github.com/users/ihnorton/events{/privacy}","received_events_url":"https://api.github.com/users/ihnorton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/error%20handling","name":"error handling","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-04T04:39:11Z","updated_at":"2015-10-21T03:25:59Z","closed_at":"2015-10-19T14:18:04Z","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/13444","html_url":"https://github.com/JuliaLang/julia/pull/13444","diff_url":"https://github.com/JuliaLang/julia/pull/13444.diff","patch_url":"https://github.com/JuliaLang/julia/pull/13444.patch"},"body":"Wraps a `LoadError` thrown by `jl_parse_eval_all` with the original top-level line/file from the parser.\r\n\r\nRef: https://github.com/JuliaOpt/JuMP.jl/issues/7 where we have a macro expansion that will throw `UndefVarError`:\r\n\r\n```\r\nusing JuMP\r\nm = Model()\r\n@setObjective(m, Max, z)\r\n```\r\n\r\nbefore:\r\n```\r\nERROR: LoadError: UndefVarError: z not defined\r\n in include at ./boot.jl:260\r\n in include_from_node1 at ./loading.jl:304\r\nwhile loading /cmn/julia/dummy.jl, in expression starting on line 584\r\n```\r\n\r\nafter:\r\n```\r\njulia> include(\"dummy.jl\")\r\nERROR: LoadError: LoadError: UndefVarError: z not defined\r\n in include at ./boot.jl:261\r\n in include_from_node1 at ./loading.jl:304\r\nwhile loading /home/isaiah/.julia/v0.5/JuMP/src/macros.jl, in expression starting on line 584\r\nwhile loading /cmn/julia/dummy.jl, in expression starting on line 3\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/149770615","html_url":"https://github.com/JuliaLang/julia/pull/13444#issuecomment-149770615","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/13444","id":149770615,"user":{"login":"ihnorton","id":327706,"avatar_url":"https://avatars.githubusercontent.com/u/327706?v=3","gravatar_id":"","url":"https://api.github.com/users/ihnorton","html_url":"https://github.com/ihnorton","followers_url":"https://api.github.com/users/ihnorton/followers","following_url":"https://api.github.com/users/ihnorton/following{/other_user}","gists_url":"https://api.github.com/users/ihnorton/gists{/gist_id}","starred_url":"https://api.github.com/users/ihnorton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihnorton/subscriptions","organizations_url":"https://api.github.com/users/ihnorton/orgs","repos_url":"https://api.github.com/users/ihnorton/repos","events_url":"https://api.github.com/users/ihnorton/events{/privacy}","received_events_url":"https://api.github.com/users/ihnorton/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T03:25:59Z","updated_at":"2015-10-21T03:25:59Z","body":"> it doesn't handle recursive include's correctly so you end up with a bunch of -1 line numbers being reported.\r\n\r\nI didn't see [this](https://github.com/JuliaOpt/JuMP.jl/issues/7#issuecomment-149235849)) because it works fine in a debug build (note that `top_lineno` is a local variable).\r\nI added the line `a = Typer`= at `linalg/cholesky.jl:25`, and get the following with `make debug`:\r\n\r\n```\r\nlinalg.jl\r\nerror during bootstrap:\r\nLoadError(at \"sysimg.jl\" line 5: LoadError(at \"sysimg.jl\" line 241: LoadError(at \"linalg.jl\" line 3: LoadError(at \"linalg.jl\" line 225: LoadError(at \"linalg/cholesky.jl\" line 25: UndefVarError(var=:Typer))))))\r\n```\r\n\r\nwhereas in a release build:\r\n```\r\nlinalg.jl\r\nerror during bootstrap:\r\nLoadError(at \"sysimg.jl\" line -1: LoadError(at \"sysimg.jl\" line 241: LoadError(at \"linalg.jl\" line -1: LoadError(at \"linalg.jl\" line 225: LoadError(at \"linalg/cholesky.jl\" line -1: LoadError(at \"linalg/cholesky.jl\" line 25: UndefVarError(var=:Typer)))))))\r\n```\r\n\r\nMaybe `top_lineno` is not properly restored by the catch handler under some conditions?\r\n(when I step through the release build in gdb, it is set correctly when I return from `jl_parse_next`, but then reverts to `-1` when the expression is evaluated / error thrown)"}}