Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure syntax error locations appear in backtraces #31881

Merged
merged 1 commit into from
May 2, 2019

Conversation

c42f
Copy link
Member

@c42f c42f commented Apr 30, 2019

Errors which are thrown directly inside jl_toplevel_eval_flex do not get an entry in the backtrace. The most prominent of these are syntax errors, but there's other cases too.

Fix this by constructing a julia expression throwing the appropriate error, and evaling it to generate a julia-level frame.

This is one step toward removing LoadError as part of addressing #31830 but seems useful on its own.

I feel like there should be a better way to get an appropriate julia frame into the backtrace but this is relatively simple and expedient.

src/toplevel.c Outdated Show resolved Hide resolved
Errors which are thrown directly inside jl_toplevel_eval_flex do not get
an entry in the backtrace. The most prominent of these are syntax
errors, but there's other cases too.

Fix this by constructing a julia expression throwing the appropriate
error, and evaling it to generate a julia-level frame.
@c42f c42f force-pushed the cjf/syntax-error-in-backtrace branch from 0ca9146 to 294b866 Compare April 30, 2019 23:52
@c42f
Copy link
Member Author

c42f commented May 1, 2019

Surprisingly enough all CI has passed here so I don't need to explain away any spurious failures :-)

Shall I merge?

@KristofferC
Copy link
Sponsor Member

Should be backported?

@c42f
Copy link
Member Author

c42f commented May 1, 2019

@KristofferC I support backporting this — it's fairly minor and a useful improvement IMHO.

Note that #31882 depends on this. I only split them because I anticipated #31882 being more difficult / breaking than it is turning out to be.

@c42f c42f merged commit 5b637df into master May 2, 2019
@fredrikekre fredrikekre deleted the cjf/syntax-error-in-backtrace branch May 2, 2019 05:08
KristofferC pushed a commit that referenced this pull request May 9, 2019
Errors which are thrown directly inside jl_toplevel_eval_flex do not get
an entry in the backtrace. The most prominent of these are syntax
errors, but there's other cases too.

Fix this by constructing a julia expression throwing the appropriate
error, and evaling it to generate a julia-level frame.

(cherry picked from commit 5b637df)
@KristofferC KristofferC mentioned this pull request May 9, 2019
58 tasks
c42f added a commit that referenced this pull request May 20, 2019
This reverts the workaround in
commit 5b637df, but keeps the tests.

This will be handled in a more robust way by the intepreter backtrace
machinery.
c42f added a commit that referenced this pull request May 21, 2019
This reverts the workaround in
commit 5b637df, but keeps the tests.

This will be handled in a more robust way by the intepreter backtrace
machinery.
c42f added a commit that referenced this pull request May 21, 2019
This reverts the workaround in
commit 5b637df, but keeps the tests.

This will be handled in a more robust way by the intepreter backtrace
machinery.
c42f added a commit that referenced this pull request May 24, 2019
This reverts the workaround in
commit 5b637df, but keeps the tests.

This will be handled in a more robust way by the intepreter backtrace
machinery.
c42f added a commit that referenced this pull request May 28, 2019
This reverts the workaround in
commit 5b637df, but keeps the tests.

This will be handled in a more robust way by the intepreter backtrace
machinery.
c42f added a commit that referenced this pull request Aug 9, 2019
This reverts the workaround in
commit 5b637df, but keeps the tests.

This will be handled in a more robust way by the intepreter backtrace
machinery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants