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

ICE when rustc asked to -o /dev/null on OSX #66530

Closed
gilescope opened this issue Nov 18, 2019 · 4 comments · Fixed by #67458
Closed

ICE when rustc asked to -o /dev/null on OSX #66530

gilescope opened this issue Nov 18, 2019 · 4 comments · Fixed by #67458
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-macos Operating system: macOS P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@gilescope
Copy link
Contributor

Ok, so rustc outputting to /dev/null is a bit pathelogical but it used to not ICE the compiler.

If you checkout

https://github.com/jethrogb/rust-reduce/tree/master/tests/suite/futures_core

and from dir tests/suite/futures_core run:

rustc --crate-type lib -o /dev/null input.rs

Then rustc is vexed:

error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.3.rcgu.bc.z: Permission denied (os error 13)

error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.0.rcgu.bc.z: Permission denied (os error 13)

error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.4.rcgu.bc.z: Permission denied (os error 13)

error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.7.rcgu.bc.z: Permission denied (os error 13)

thread '<unnamed>' panicked at 'src/librustc_codegen_ssa/back/write.rs:1544: worker thread panicked', src/librustc/util/bug.rs:37:26
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: std::panicking::begin_panic
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc_codegen_ssa::back::write::start_executing_work::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

(ICEs on stable and nightly)

The irony is that this is in the test suite of a rust code minimisation project.... 🤣 🤣 🤣

Let me minimise the reproduction of the problem...

@gilescope gilescope changed the title ICE when rustc failing to write to /dev/null ICE when rustc failing to write to /dev/null on OSX Nov 18, 2019
@gilescope
Copy link
Contributor Author

Thanks to rust-reduce I managed to get the repro down to:

#![cfg_attr(not(feature = "std"), no_std)]
pub mod task {
    pub mod __internal {
        use crate::task::Waker;
    }
    pub use core::task::Waker;
}

Interestingly it doesn't ICE on playground - I'm guessing playground is on linux?

@Centril Centril added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated O-macos Operating system: macOS T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 19, 2019
@bjorn3
Copy link
Member

bjorn3 commented Nov 19, 2019

I'm guessing playground is on linux?

Indeed

@pnkfelix pnkfelix changed the title ICE when rustc failing to write to /dev/null on OSX ICE when rustc asked to -o /dev/null on OSX Nov 21, 2019
@pnkfelix
Copy link
Member

triage: P-medium, removing nomination tag, assigning self.

@pnkfelix pnkfelix self-assigned this Nov 21, 2019
@pnkfelix pnkfelix added P-medium Medium priority and removed I-nominated labels Nov 21, 2019
@JohnTitor JohnTitor added the C-bug Category: This is a bug. label Dec 8, 2019
@pnkfelix
Copy link
Member

Thanks to rust-reduce I managed to get the repro down to:

#![cfg_attr(not(feature = "std"), no_std)]
pub mod task {
    pub mod __internal {
        use crate::task::Waker;
    }
    pub use core::task::Waker;
}

Interestingly it doesn't ICE on playground - I'm guessing playground is on linux?

hmm. I nonetheless see an ICE on my own Linux machine.

(There is probably some other reason the ICE does not replicate on the playpen.)

bors added a commit that referenced this issue Dec 29, 2019
…from-worker, r=matthewjasper

When a codegen worker has a FatalError, propagate it instead of ICE'ing.

Fix #66530
@bors bors closed this as completed in f363745 Jan 12, 2020
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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-macos Operating system: macOS P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants