-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE: capacity overflow or "Illegal instruction (core dumped)" with very large static item #23600
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I just hit this. It happens even with arrays whose element type is zero-sized (and therefore the entire array should be zero-sized): static _FOO: [(); 9223372036854775807] = [(); 9223372036854775807]; |
This also gives the same ICE: let _y = &[(); !0]; If you size it just right you actually get an out of memory instead (= abort) let _z = &[(); 1 << 32]; |
Reference rust-lang/rust#23600
Reference rust-lang/rust#23600
Triage: tracked by glacier |
tests in the OP seem to not build, but no longer ICE.
|
This code
no longer ICEs, it does however kick rustc into high gear and take up huge amounts of RAM and time. https://travis-ci.org/steveklabnik/glacier/builds/370159653 is currently attempting to build this and it looks like it's hanging. At the very least, it shouldn't take multiple minutes to compile such a thing. |
I spoke to @oli-obk for a bit about this issue. They have some ideas on ways to address this within const-eval. The main question was how to select an actual threshold to act as the limit on memory usage (or maybe individual array length); we agreed that a configurable threshold analogous to the recursion limit would probably make the most sense. |
But having said that, I evaluated the four cases of interest that were identified in the comments here, and evaluated their behavior on my x86_64 Linux box. I saw:
Based on these observations, I'm going to triage this as P-low. If someone wants to put in the effort to get the const-eval to support a configurable limit on memory usage, great. (@oli-obk even said that it used to have a memory usage limit, and they ripped it out.) But its not something we should prioritize over other problems we face. |
Seems to no longer ICE with |
The ZST variants now work really fast, it's only the 2^32 variant that takes forever to compile on 64 bit |
Add tests for some old fixed issues Closes rust-lang#30867 Closes rust-lang#30472 Closes rust-lang#28994 Closes rust-lang#26719 (and migrates the relevant test to the new run-make) Closes rust-lang#23600 cc `@jieyouxu` for the run-make-support changes try-job: x86_64-msvc
Rollup merge of rust-lang#131355 - clubby789:old-tests, r=jieyouxu Add tests for some old fixed issues Closes rust-lang#30867 Closes rust-lang#30472 Closes rust-lang#28994 Closes rust-lang#26719 (and migrates the relevant test to the new run-make) Closes rust-lang#23600 cc `@jieyouxu` for the run-make-support changes try-job: x86_64-msvc
Uh oh!
There was an error while loading. Please reload this page.
Added by pnkfelix: here is a summary of cases discussed in comment dialogue on issue..
Original bug report below
Test case one:
Test case two:
rustc version:
I didn't see any other open issues mentioning
capacity overflow
.The text was updated successfully, but these errors were encountered: