Skip to content

ICE panic because the compiler failed to spawn a thread #76230

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

Closed
eleanor-em opened this issue Sep 2, 2020 · 3 comments
Closed

ICE panic because the compiler failed to spawn a thread #76230

eleanor-em opened this issue Sep 2, 2020 · 3 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eleanor-em
Copy link

While compiling my (rather large) Cargo project, I hit an ICE panic because rustc failed to start a new thread. This was because my system was overloaded, which makes sense, but I assume the compiler shouldn't panic in this case and instead exit gracefully? I asked on the Rust Discord and was advised to post the report here.

Meta

rustc --version --verbose:

binary: rustc
commit-hash: d006f5734f49625c34d6fc33bf6b9967243abca8
commit-date: 2020-08-28
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0

Error output

thread '<unnamed>' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/thread/mod.rs:596:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'rustc' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/thread/mod.rs:596:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.47.0-nightly (de521cbb3 2020-08-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no --crate-type lib

note: some of the compiler flags provided by cargo are hidden

note: rustc 1.47.0-nightly (de521cbb3 2020-08-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no --crate-type lib

note: some of the compiler flags provided by cargo are hidden

thread 'rustc' panicked at '/rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/src/librustc_codegen_ssa/back/write.rs:1713:17: panic during codegen/LLVM phase', src/librustc_middle/util/bug.rs:34:26

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.47.0-nightly (de521cbb3 2020-08-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: could not compile `color_quant`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 101

@eleanor-em eleanor-em added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 2, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

thread 'rustc' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/thread/mod.rs:596:29

Maybe rustc should block when trying to start a thread instead of using O_NONBLOCK?

The number of panics makes it look like you have many cargo processes running at once, are you running cargo build with make -j or something?

@eleanor-em
Copy link
Author

@jyn514 it's just cargo build --release --all --all-targets, with 5 projects in the workspace (I think project is the right name?)

No make -j, just the usual core allocation from cargo. I do have 12 virtual CPUs though so it's expected that it would spawn a lot of threads.

@Dylan-DPC Dylan-DPC added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Apr 3, 2023
@Enselic
Copy link
Member

Enselic commented Sep 10, 2023

Triage: Closing as duplicate to #46345

@Enselic Enselic closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants