-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compiling code hangs compiler #58523
Comments
I will note that this has been happening for more than six months; I just haven't bothered reporting it until now.
Minimizing the body of the test to this seems to a) cause the problem to happen on my machine and, b) cause the Rust playground's
|
Highly unlikely to have anything to do with #58506 -- that's likely a hardware, not a hanging issue. The SIGKILL on playground is likely because we limit memory to 256 MB, at least as far as I can tell, (see docker invocation here). The hang appears to be in rustc_mir (
|
Oh, forgot to note -- I am able to reproduce on Linux as well and with this code (same as the previous minimal, just with pub fn main() {
let mut _buf = vec![0u8; 1 << 32];
(&[0u8; (1 << 32) - 8]);
} |
Is this more than "just" CTFE going OOM? |
Well, maybe - I haven't actually waited, but even if it does eventually OOM, it certainly is also quite slow so this could be a good test case for optimizing what I assume is a relatively tight loop. |
This is not even ctfe going OOM (except maybe on the playground), this is just ctfe taking forever. We are running a loop for 2^32 copies of an undef mask (which keeps setting single bits in bytes) I have started setting up some optimizations in #58556 |
Optimize copying large ranges of undefmask blocks Hopefully fixes #58523
…felix Optimize copying large ranges of undefmask blocks Hopefully fixes rust-lang#58523
Optimize copying large ranges of undefmask blocks Hopefully fixes #58523
On version |
running out of memory meaning this consumes more than 8GB of RAM for a 4GB array? One duplication is pretty much guaranteed the way we work with constants and I don't see many possibilites around (though I think we could try to tell llvm to just use our memory and not duplicate it. Not sure how well that works with LLVM optimizations). Some Playground tests showed that anything beyond 60MB gets killed (though 60MB gets killed randomly every now and then). So I guess if 256MB is the kill limit, we have a duplication of 4. Meaning in order to comiple a 4GB array, you need 16GB of RAM plus anything you need for compiling a 1MB array. |
Triage: Looks a lot like a duplicate, so let's close as duplicate of #37155. |
When compiling this code, if this test is uncommented, the compiler hangs indefinitely during compilation.
Details:
cargo version
-cargo 1.34.0-nightly (245818076 2019-01-27)
rustc --version
-rustc 1.34.0-nightly (8ae730a44 2019-02-04)
cargo test --no-run
rustc
uses a constant 80% CPU (of 200% - 2-core CPU)The text was updated successfully, but these errors were encountered: