-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Internal BoundsError in the compiler #37154
Comments
For issues like this, please try on the latest released version (1.5). |
I confirm that this is still the case for Julia 1.5
|
Thanks. |
Reduced to: while
try
a += 0
catch end
end This doesn't only reproduce the bounds error, but also segfaults the GC 🎉 |
I think this is related; this happens on nightly:
|
This bug seems to stem from certain functions (like the examples given in this thread) generating PhiNodes in the entry block. Since PhiNodes imply that the block they are in has predecessors, IR with PhiNodes in its entry block is malformed. More specifically, on the Julia side, these entry block PhiNodes give a bounds error in @vtjnash and I went over some possible solutions for when we detect this (seemingly rare) bug:
In both cases, some handling of the PhiNode edges may be required to avoid the bounds error in Further input on this fix is greatly appreciated! |
Options 1 and 2 seem to be the same? (Though may require some special work to ensure the goto node that splits that block is treated as valid and not removed later) |
The MWE at #37154#issuecomment-678933001 still crashes rc3 (and "a4f7f2d1e4 (1 day old master)"), but the original crashes neither. I'm not sure this is too helpful, but should there be a random amount (on master) of allocations; and much more than on rc3? Possibly I was just lucky with rc3, getting (seemingly) always the same error, but on master, while often getting similar (length of error), sometimes I get way longer text, with something extra. Always on rc3: "Allocations: 2720 (Pool: 2710; Big: 10); GC: 0", while on master the last two lines have slightly different numbers:
I was surprised to see e.g. SuiteSparse in the output for master:
|
Fixed by #46388 |
For anyone running into this issue: a simple workaround is to replace while true with a for loop that never completes, e.g. for _i in Iterators.countfrom(1) |
The following code causes an internal error in Julia 1.4.2 ( and 1.5.0, see my other comment below)
You will need to manually
kill
the server due to the infinite loop 😅. The logic behind the code is to keep trying something that can result in an exception, if it does, do some handling and then go back trying that thing again, until a global state has changed and then we exist.This error seems to be related to #30093
The text was updated successfully, but these errors were encountered: