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

_simplify_include_frames throws bounds error #41566

Closed
fredcallaway opened this issue Jul 13, 2021 · 3 comments
Closed

_simplify_include_frames throws bounds error #41566

fredcallaway opened this issue Jul 13, 2021 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@fredcallaway
Copy link
Contributor

Original issue: JuliaLang/PackageCompiler.jl#517

When using a sysimage, _simplify_include_frames throws a bounds error at line 804 because i is 0.

kept_frames[i:first_ignored] .= false

The immediate fix is to move the decrement to the top of the loop and start at i = length(trace) + 1. I can make a pull request for this.

This still gives really verbose stack traces when using a sysimage. I'd like to take a shot at improving that as well, but perhaps this should be done in a separate issue/pull request since it might require further discussion.

Thanks to @KristofferC for identifying the problem.

@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Jul 13, 2021
@c42f
Copy link
Member

c42f commented Jul 14, 2021

Yes this is a bug, thanks for the report.

I can make a pull request for this.

Perfect, please do. Two separate PRs seems fine.

Looking back at this code, I'm not sure why I wrote it as a while loop! It looks like it could be a for loop and you can just use kept_frames[1:first_ignored] .= false after the loop as it doesn't terminate early?

@fredcallaway
Copy link
Contributor Author

Sorry, quick question: Is there a standard way to develop/test Base code (ideally using Revise.jl)? Normally I would do e.g. ] dev Base but that doesn't work. Didn't see anything about this in dev docs, but might have missed it.

@c42f
Copy link
Member

c42f commented Jul 17, 2021

TBH I haven't done this for a while. But you should be able to build Julia from source and use Revise.track(Base) to update Base while you edit the source (see https://timholy.github.io/Revise.jl/stable/#What-Revise-can-track-1)

KristofferC pushed a commit that referenced this issue Jul 26, 2021
…1622)

* while loop -> for loop in _simplify_include_frames (fixes #41566)

prevents the possibility of a bounds error when i = 0

(cherry picked from commit ed4f316)
KristofferC pushed a commit that referenced this issue Jul 26, 2021
…1622)

* while loop -> for loop in _simplify_include_frames (fixes #41566)

prevents the possibility of a bounds error when i = 0

(cherry picked from commit ed4f316)
KristofferC pushed a commit that referenced this issue Aug 31, 2021
…1622)

* while loop -> for loop in _simplify_include_frames (fixes #41566)

prevents the possibility of a bounds error when i = 0

(cherry picked from commit ed4f316)
KristofferC pushed a commit that referenced this issue Sep 3, 2021
…1622)

* while loop -> for loop in _simplify_include_frames (fixes #41566)

prevents the possibility of a bounds error when i = 0

(cherry picked from commit ed4f316)
staticfloat pushed a commit that referenced this issue Dec 23, 2022
…1622)

* while loop -> for loop in _simplify_include_frames (fixes #41566)

prevents the possibility of a bounds error when i = 0

(cherry picked from commit ed4f316)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants