Skip to content

Building fatfs crate for the powerpc-unknown-linux-gnu target with default-features = false crashed the compiler #96796

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
aruiz opened this issue May 7, 2022 · 3 comments
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

@aruiz
Copy link

aruiz commented May 7, 2022

Code

I just imported the fatfs crate from master(87fc1ed5) and tried to build it agasint the powerpc-unknown-linux-gnu target

Meta

rustc --version --verbose:

[1015][aruiz@artanis ~/src/ieee1275-rs/template]$ rustc --version --verbose
rustc 1.62.0-nightly (60e50fc1c 2022-04-04)
binary: rustc
commit-hash: 60e50fc1cfe0bb693a5f4f93eb83ef70854531e3
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.62.0-nightly
LLVM version: 14.0.0

Error output

[1014][aruiz@artanis ~/src/ieee1275-rs/template]$ cargo build --target powerpc-unknown-linux-gnu --release
   Compiling fatfs v0.4.0 (/home/aruiz/src/ieee1275-rs/template/rust-fatfs)
thread 'rustc' panicked at 'Collection VecMap(
    [
        (
            OpaqueTypeKey {
                def_id: DefId(0:949 ~ fatfs[f379]::fs::{impl#9}::cluster_iter::{opaque#0}),
                substs: [
                    IO,
                    TP,
                    OCC,
                    ReFree(DefId(0:948 ~ fatfs[f379]::fs::{impl#9}::cluster_iter), BrAnon(0)),
                ],
            },
            OpaqueHiddenType {
                span: rust-fatfs/src/fs.rs:472:9: 472:65 (#0),
                ty: impl fs::ReadWriteSeek + io::IoBase<Error = error::Error<<IO as io::IoBase>::Error>>,
            },
        ),
        (
            OpaqueTypeKey {
                def_id: DefId(0:949 ~ fatfs[f379]::fs::{impl#9}::cluster_iter::{opaque#0}),
                substs: [
                    IO,
                    TP,
                    OCC,
                    ReFree(DefId(0:948 ~ fatfs[f379]::fs::{impl#9}::cluster_iter), BrAnon(0)),
                ],
            },
            OpaqueHiddenType {
                span: rust-fatfs/src/fs.rs:472:9: 472:65 (#0),
                ty: impl fs::ReadWriteSeek + io::IoBase<Error = error::Error<<IO as io::IoBase>::Error>>,
            },
        ),
    ],
) should have just one matching element', /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/compiler/rustc_data_structures/src/vec_map.rs:73:9
stack backtrace:
   0:     0x7f8220dd81dd - std::backtrace_rs::backtrace::libunwind::trace::h7c0513382e856dcd
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8220dd81dd - std::backtrace_rs::backtrace::trace_unsynchronized::hfbd98a434da97507
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8220dd81dd - std::sys_common::backtrace::_print_fmt::h51726a53848f2bc2
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f8220dd81dd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h42dee42c8f9c4223
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f8220e3202c - core::fmt::write::h1b836a6030da7618
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/core/src/fmt/mod.rs:1194:17
   5:     0x7f8220dc9731 - std::io::Write::write_fmt::h0e20df5d0a1ff12d
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/io/mod.rs:1655:15
   6:     0x7f8220ddb2c5 - std::sys_common::backtrace::_print::hef3e7f4b6e8c4703
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f8220ddb2c5 - std::sys_common::backtrace::print::h0d49891b8a1c7aa0
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f8220ddb2c5 - std::panicking::default_hook::{{closure}}::h1be164303b214361
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/panicking.rs:295:22
   9:     0x7f8220ddaf79 - std::panicking::default_hook::h05b86375012ed091
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/panicking.rs:314:9
  10:     0x7f8221558d41 - rustc_driver[347dc621c1486df4]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f8220ddba10 - std::panicking::rust_panic_with_hook::ha6d95641dad8505e
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/panicking.rs:702:17
  12:     0x7f8220ddb847 - std::panicking::begin_panic_handler::{{closure}}::ha42f0ef1b4490fd3
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/panicking.rs:588:13
  13:     0x7f8220dd8694 - std::sys_common::backtrace::__rust_end_short_backtrace::h6b819a9afadb4a4c
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f8220ddb579 - rust_begin_unwind
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/panicking.rs:584:5
  15:     0x7f8220d9f6c3 - core::panicking::panic_fmt::h6056698337b027c1
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/core/src/panicking.rs:143:14
  16:     0x7f8222a509a5 - rustc_typeck[6fd95f0af9e597e2]::collect::type_of::type_of
  17:     0x7f8222ecffde - rustc_query_system[f7eabd9288284674]::query::plumbing::get_query::<rustc_query_impl[4f491867fe8b1385]::queries::type_of, rustc_query_impl[4f491867fe8b1385]::plumbing::QueryCtxt>
  18:     0x7f8222a6138b - rustc_typeck[6fd95f0af9e597e2]::check::check::check_item_type
  19:     0x7f8222a40f9b - <rustc_middle[5108af4071a4b383]::hir::map::Map>::visit_item_likes_in_module::<rustc_typeck[6fd95f0af9e597e2]::check::CheckItemTypesVisitor>
  20:     0x7f8223748a6c - rustc_typeck[6fd95f0af9e597e2]::check::check::check_mod_item_types
  21:     0x7f8222e8f4be - rustc_query_system[f7eabd9288284674]::query::plumbing::try_execute_query::<rustc_query_impl[4f491867fe8b1385]::plumbing::QueryCtxt, rustc_query_system[f7eabd9288284674]::query::caches::DefaultCache<rustc_span[508422916312c451]::def_id::LocalDefId, ()>>
  22:     0x7f822395ffe3 - rustc_query_system[f7eabd9288284674]::query::plumbing::get_query::<rustc_query_impl[4f491867fe8b1385]::queries::check_mod_item_types, rustc_query_impl[4f491867fe8b1385]::plumbing::QueryCtxt>
  23:     0x7f8223728c7c - <rustc_middle[5108af4071a4b383]::hir::map::Map>::for_each_module::<rustc_typeck[6fd95f0af9e597e2]::check_crate::{closure#6}::{closure#0}>
  24:     0x7f82236f70f8 - <rustc_session[96f22c715fe2ba33]::session::Session>::time::<(), rustc_typeck[6fd95f0af9e597e2]::check_crate::{closure#6}>
  25:     0x7f82236e9b18 - rustc_typeck[6fd95f0af9e597e2]::check_crate
  26:     0x7f82234675c7 - rustc_interface[9deadcc41e3e1d97]::passes::analysis
  27:     0x7f822392bade - rustc_query_system[f7eabd9288284674]::query::plumbing::try_execute_query::<rustc_query_impl[4f491867fe8b1385]::plumbing::QueryCtxt, rustc_query_system[f7eabd9288284674]::query::caches::DefaultCache<(), core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>>
  28:     0x7f822396ec7e - rustc_query_system[f7eabd9288284674]::query::plumbing::get_query::<rustc_query_impl[4f491867fe8b1385]::queries::analysis, rustc_query_impl[4f491867fe8b1385]::plumbing::QueryCtxt>
  29:     0x7f822342d331 - <rustc_interface[9deadcc41e3e1d97]::passes::QueryContext>::enter::<rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>
  30:     0x7f82234474f8 - <rustc_interface[9deadcc41e3e1d97]::interface::Compiler>::enter::<rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}::{closure#2}, core[75ba8002d1a2f8a8]::result::Result<core[75ba8002d1a2f8a8]::option::Option<rustc_interface[9deadcc41e3e1d97]::queries::Linker>, rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>
  31:     0x7f822342caef - rustc_span[508422916312c451]::with_source_map::<core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>, rustc_interface[9deadcc41e3e1d97]::interface::create_compiler_and_run<core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>, rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}>::{closure#1}>
  32:     0x7f822345b574 - rustc_interface[9deadcc41e3e1d97]::interface::create_compiler_and_run::<core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>, rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}>
  33:     0x7f822342b282 - <scoped_tls[e4ea34ec8e39d533]::ScopedKey<rustc_span[508422916312c451]::SessionGlobals>>::set::<rustc_interface[9deadcc41e3e1d97]::interface::run_compiler<core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>, rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}>::{closure#0}, core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>
  34:     0x7f8223440e2f - std[44828cfc6226ecc0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9deadcc41e3e1d97]::util::run_in_thread_pool_with_globals<rustc_interface[9deadcc41e3e1d97]::interface::run_compiler<core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>, rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}>::{closure#0}, core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>::{closure#0}, core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>
  35:     0x7f822342c5a9 - <<std[44828cfc6226ecc0]::thread::Builder>::spawn_unchecked_<rustc_interface[9deadcc41e3e1d97]::util::run_in_thread_pool_with_globals<rustc_interface[9deadcc41e3e1d97]::interface::run_compiler<core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>, rustc_driver[347dc621c1486df4]::run_compiler::{closure#1}>::{closure#0}, core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>::{closure#0}, core[75ba8002d1a2f8a8]::result::Result<(), rustc_errors[9df6ff0b021522ae]::ErrorGuaranteed>>::{closure#1} as core[75ba8002d1a2f8a8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7f8220de5c03 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha3103b8979c0f9bf
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/alloc/src/boxed.rs:1861:9
  37:     0x7f8220de5c03 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h40f489084d50ad12
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/alloc/src/boxed.rs:1861:9
  38:     0x7f8220de5c03 - std::sys::unix::thread::Thread::new::thread_start::h7c546e3028c3fa8d
                               at /rustc/60e50fc1cfe0bb693a5f4f93eb83ef70854531e3/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7f8220ba680a - start_thread
  40:     0x7f8220b46430 - __clone3
  41:                0x0 - <unknown>

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.62.0-nightly (60e50fc1c 2022-04-04) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C embed-bitcode=no -C linker=ppc64le-linux-gnu-gcc -C strip=symbols -C link-args=-nostdlib -ffreestanding -fPIC -Ttext 100000 -mbig-endian -C target-feature=+crt-static

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

query stack during panic:
#0 [type_of] computing type of `fs::<impl at rust-fatfs/src/fs.rs:343:1: 624:2>::cluster_iter::{opaque#0}`
#1 [check_mod_item_types] checking item types in module `fs`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `fatfs`
@aruiz aruiz 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 May 7, 2022
@JohnTitor
Copy link
Member

Possibly a duplicate of #95538, could you try updating to newer nightly?

@aruiz
Copy link
Author

aruiz commented May 7, 2022

Indeed, all fixed, thanks!

@JohnTitor
Copy link
Member

Great, closing as fixed.

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

No branches or pull requests

2 participants