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: -Zmeta-stats Bad file descriptor #116055

Closed
matthiaskrgr opened this issue Sep 22, 2023 · 1 comment · Fixed by #116067
Closed

ice: -Zmeta-stats Bad file descriptor #116055

matthiaskrgr opened this issue Sep 22, 2023 · 1 comment · Fixed by #116067
Assignees
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Sep 22, 2023

Code

rustc -Zmeta-stats --crate-type lib

pub fn a() {}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (8759de0a4 2023-09-22)
binary: rustc
commit-hash: 8759de0a4935e677fdce99a849addea2d5318da9
commit-date: 2023-09-22
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

<output>
Backtrace

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:738:22:
called `Result::unwrap()` on an `Err` value: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" }
stack backtrace:
   0:     0x7f5c533641bc - std::backtrace_rs::backtrace::libunwind::trace::h2c74ac6deac56f28
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f5c533641bc - std::backtrace_rs::backtrace::trace_unsynchronized::h88c61688a4e1192f
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5c533641bc - std::sys_common::backtrace::_print_fmt::h2deb8eef8c5c089d
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f5c533641bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he46fa481b90009b7
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f5c533c9c2c - core::fmt::rt::Argument::fmt::hda3d7f3cd9199f3a
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/core/src/fmt/rt.rs:138:9
   5:     0x7f5c533c9c2c - core::fmt::write::h40f0f0afa8d83c16
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/core/src/fmt/mod.rs:1114:21
   6:     0x7f5c53356e4e - std::io::Write::write_fmt::h3fbee16ff35ee122
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/io/mod.rs:1714:15
   7:     0x7f5c53363fa4 - std::sys_common::backtrace::_print::h73fd854499da7291
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f5c53363fa4 - std::sys_common::backtrace::print::h9655cea3c483884a
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f5c53366e83 - std::panicking::default_hook::{{closure}}::h8c19e7e8a549fb73
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/panicking.rs:272:22
  10:     0x7f5c53366ba4 - std::panicking::default_hook::h55202e3f551762fb
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/panicking.rs:292:9
  11:     0x7f5c564f84af - std[6e2841eb239ea73c]::panicking::update_hook::<alloc[934157a7c91b5d71]::boxed::Box<rustc_driver_impl[4882aae0112549ca]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f5c533676b1 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6e14d4d9ffc0c4e6
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/alloc/src/boxed.rs:2021:9
  13:     0x7f5c533676b1 - std::panicking::rust_panic_with_hook::hc15f28407fa2a306
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/panicking.rs:735:13
  14:     0x7f5c53367431 - std::panicking::begin_panic_handler::{{closure}}::h6d33f31db0875e55
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/panicking.rs:609:13
  15:     0x7f5c533646e6 - std::sys_common::backtrace::__rust_end_short_backtrace::hdc285b62ecc2ed04
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f5c53367182 - rust_begin_unwind
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/panicking.rs:597:5
  17:     0x7f5c533c62b5 - core::panicking::panic_fmt::ha1ddd16588ec18da
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/core/src/panicking.rs:72:14
  18:     0x7f5c533c6943 - core::result::unwrap_failed::hda98b93833d5f813
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/core/src/result.rs:1652:5
  19:     0x7f5c558073d9 - <rustc_metadata[e17fe1675ffb8cf6]::rmeta::encoder::EncodeContext>::encode_crate_root
  20:     0x7f5c5577ab68 - rustc_metadata[e17fe1675ffb8cf6]::rmeta::encoder::encode_metadata_impl
  21:     0x7f5c55779843 - rustc_data_structures[6eeedaf2e616f613]::sync::parallel::disabled::join::<rustc_metadata[e17fe1675ffb8cf6]::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata[e17fe1675ffb8cf6]::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
  22:     0x7f5c55779442 - rustc_metadata[e17fe1675ffb8cf6]::rmeta::encoder::encode_metadata
  23:     0x7f5c55778141 - rustc_metadata[e17fe1675ffb8cf6]::fs::encode_and_write_metadata
  24:     0x7f5c5576edc0 - rustc_interface[6a19061a6606b6ee]::passes::start_codegen
  25:     0x7f5c5576959a - <rustc_middle[5306ca3e19273ded]::ty::context::GlobalCtxt>::enter::<<rustc_interface[6a19061a6606b6ee]::queries::Queries>::ongoing_codegen::{closure#0}, core[203a612186f4578]::result::Result<alloc[934157a7c91b5d71]::boxed::Box<dyn core[203a612186f4578]::any::Any>, rustc_span[ca38ddb36620620f]::ErrorGuaranteed>>
  26:     0x7f5c5576849d - rustc_span[ca38ddb36620620f]::set_source_map::<core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>, rustc_interface[6a19061a6606b6ee]::interface::run_compiler<core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>, rustc_driver_impl[4882aae0112549ca]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  27:     0x7f5c55767120 - std[6e2841eb239ea73c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6a19061a6606b6ee]::util::run_in_thread_with_globals<rustc_interface[6a19061a6606b6ee]::interface::run_compiler<core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>, rustc_driver_impl[4882aae0112549ca]::run_compiler::{closure#1}>::{closure#0}, core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>>
  28:     0x7f5c55d5644e - <<std[6e2841eb239ea73c]::thread::Builder>::spawn_unchecked_<rustc_interface[6a19061a6606b6ee]::util::run_in_thread_with_globals<rustc_interface[6a19061a6606b6ee]::interface::run_compiler<core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>, rustc_driver_impl[4882aae0112549ca]::run_compiler::{closure#1}>::{closure#0}, core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[203a612186f4578]::result::Result<(), rustc_span[ca38ddb36620620f]::ErrorGuaranteed>>::{closure#1} as core[203a612186f4578]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7f5c53372025 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf0c9cb239a13ebdd
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/alloc/src/boxed.rs:2007:9
  30:     0x7f5c53372025 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0f9f799ae3dbbb52
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/alloc/src/boxed.rs:2007:9
  31:     0x7f5c53372025 - std::sys::unix::thread::Thread::new::thread_start::h6b6066f3f20c40b7
                               at /rustc/8759de0a4935e677fdce99a849addea2d5318da9/library/std/src/sys/unix/thread.rs:108:17
  32:     0x7f5c5308c9eb - <unknown>
  33:     0x7f5c53110dfc - <unknown>
  34:                0x0 - <unknown>

error: 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: please attach the file at `/tmp/rustc-ice-2023-09-22T10:30:59.940536126Z-40564.txt` to your bug report

note: compiler flags: -Z meta-stats --crate-type lib

query stack during panic:
end of query stack

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Sep 22, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 22, 2023
@saethlin
Copy link
Member

Having not looked into this at all I'm pretty sure I broke this.
@rustbot claim

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 22, 2023
@bors bors closed this as completed in efee13a Sep 22, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2023
Rollup merge of rust-lang#116067 - saethlin:meta-stats-ice, r=WaffleLapkin

Open the FileEncoder file for reading and writing

Maybe I just don't know `File` well enough, but the previous comment didn't make it clear enough to me that we can't use `File::create`. This one does.

Fixes rust-lang#116055

r? `@WaffleLapkin`
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) ❄️ 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.

3 participants