Skip to content

Internal Compiler Error when running tests against library/alloc #89725

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
bsodmike opened this issue Oct 10, 2021 · 4 comments
Closed

Internal Compiler Error when running tests against library/alloc #89725

bsodmike opened this issue Oct 10, 2021 · 4 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

@bsodmike
Copy link

bsodmike commented Oct 10, 2021

Hi all, I'm looking to work on the std lib (and I've read the rustc-dev docs). I found when cloning the rust source and running tests on library/alloc against the master branch there is a compiler panic.

Here's the error output whilst running ./x.py test --keep-stage 1 library/alloc/

Updating only changed submodules
Submodules updated in 0.01 seconds
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Testing alloc stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 265 tests
.................................................................................................... 100/265
.................................................................................................... 200/265
.................................................................
test result: ok. 265 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.15s


running 663 tests
.................................................................................................... 100/663
.................................................................................................... 200/663
.................................................................................................... 300/663
.................................................................................................... 400/663
.................................................................................................... 500/663
.................................................................................................... 600/663
...............................................................
test result: ok. 663 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.45s


running 441 tests
.................................................................................................... 100/441
.................................................................................................... 200/441
.................................................................................................... 300/441
.................................................................................................... 400/441
.........................................
test result: ok. 441 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.41s


running 599 tests
.................................................................................................... 100/599
.................................................................................................... 200/599
..................................i................................................................. 300/599
.................................................................................................... 400/599
...................................F................................................................ 500/599
...................................................................................................
failures:

---- src/string.rs - string::String (line 168) stdout ----
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs:696:81
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

note: rustc 1.56.0-beta.1 (e784c962e 2021-09-07) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z force-unstable-if-unmarked -C codegen-units=1 -C embed-bitcode=no --crate-type bin

query stack during panic:
#0 [typeck] type-checking `main::_doctest_main_src_string_rs_168_0`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack
�[0m�[1m�[38;5;9merror: internal compiler error�[0m�[0m�[1m: trimmed_def_paths constructed�[0m
�[0m  �[0m�[0m�[1m�[38;5;12m|�[0m
�[0m  �[0m�[0m�[1m�[38;5;12m= �[0m�[0m�[1mnote�[0m�[0m: delayed at    0: rustc_errors::Handler::delay_good_path_bug�[0m
�[0m             1: rustc_middle::ty::print::pretty::trimmed_def_paths�[0m
�[0m             2: rustc_data_structures::stack::ensure_sufficient_stack�[0m
�[0m             3: rustc_query_system::query::plumbing::get_query_impl�[0m
�[0m             4: rustc_query_system::query::plumbing::get_query�[0m
�[0m             5: <rustc_middle::ty::print::pretty::FmtPrinter<F> as rustc_middle::ty::print::Printer>::print_def_path�[0m
�[0m             6: rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type�[0m
�[0m             7: rustc_middle::ty::print::pretty::<impl rustc_middle::ty::print::Print<P> for rustc_middle::ty::sty::TypeAndMut>::print�[0m
�[0m             8: rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type�[0m
�[0m             9: rustc_middle::ty::print::pretty::<impl rustc_middle::ty::print::Print<P> for rustc_middle::ty::TraitPredicate>::print�[0m
�[0m            10: rustc_middle::ty::print::pretty::<impl rustc_middle::ty::print::Print<P> for rustc_middle::ty::PredicateKind>::print�[0m
�[0m            11: <rustc_middle::ty::print::pretty::FmtPrinter<F> as rustc_middle::ty::print::pretty::PrettyPrinter>::in_binder�[0m
�[0m            12: rustc_middle::ty::print::pretty::<impl core::fmt::Display for rustc_middle::ty::Predicate>::fmt�[0m
�[0m            13: core::fmt::write�[0m
�[0m                       at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/core/src/fmt/mod.rs:1150:17�[0m
�[0m            14: core::fmt::Write::write_fmt�[0m
�[0m                       at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/core/src/fmt/mod.rs:186:9�[0m
�[0m            15: alloc::fmt::format�[0m
�[0m                       at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/alloc/src/fmt.rs:583:5�[0m
�[0m            16: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtExt>::report_selection_error�[0m
�[0m            17: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error�[0m
�[0m            18: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtExt>::report_fulfillment_errors�[0m
�[0m            19: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types�[0m
�[0m            20: rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::confirm_builtin_call�[0m
�[0m            21: rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_call�[0m
�[0m            22: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind�[0m
�[0m            23: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation�[0m
�[0m            24: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt�[0m
�[0m            25: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected�[0m
�[0m            26: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation�[0m
�[0m            27: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_return_expr�[0m
�[0m            28: rustc_typeck::check::check::check_fn�[0m
�[0m            29: rustc_infer::infer::InferCtxtBuilder::enter�[0m
�[0m            30: rustc_typeck::check::typeck�[0m
�[0m            31: rustc_query_system::query::plumbing::get_query_impl�[0m
�[0m            32: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck�[0m
�[0m            33: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners�[0m
�[0m            34: rustc_typeck::check::typeck_item_bodies�[0m
�[0m            35: rustc_query_system::query::plumbing::get_query_impl�[0m
�[0m            36: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies�[0m
�[0m            37: rustc_session::utils::<impl rustc_session::session::Session>::time�[0m
�[0m            38: rustc_typeck::check_crate�[0m
�[0m            39: rustc_interface::passes::analysis�[0m
�[0m            40: rustc_query_system::query::plumbing::get_query_impl�[0m
�[0m            41: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis�[0m
�[0m            42: rustc_interface::passes::QueryContext::enter�[0m
�[0m            43: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter�[0m
�[0m            44: rustc_span::with_source_map�[0m
�[0m            45: scoped_tls::ScopedKey<T>::set�[0m
�[0m            46: std::sys_common::backtrace::__rust_begin_short_backtrace�[0m
�[0m            47: core::ops::function::FnOnce::call_once{{vtable.shim}}�[0m
�[0m            48: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once�[0m
�[0m                       at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/alloc/src/boxed.rs:1636:9�[0m
�[0m            49: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once�[0m
�[0m                       at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/alloc/src/boxed.rs:1636:9�[0m
�[0m            50: std::sys::unix::thread::Thread::new::thread_start�[0m
�[0m                       at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys/unix/thread.rs:106:17�[0m
�[0m            51: start_thread�[0m
�[0m            52: __clone�[0m
�[0m          �[0m

thread 'rustc' panicked at 'no warnings or errors encountered even though `delayed_good_path_bugs` issued', compiler/rustc_errors/src/lib.rs:1166:13
stack backtrace:
   0:     0x7f32db40c4fc - std::backtrace_rs::backtrace::libunwind::trace::h51faa62df48810e4
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f32db40c4fc - std::backtrace_rs::backtrace::trace_unsynchronized::h91de4d8e16d607e4
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f32db40c4fc - std::sys_common::backtrace::_print_fmt::h71b0935f97e4322c
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f32db40c4fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9a78218788c14e18
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f32db46a20c - core::fmt::write::h3381b3176fe2b3d3
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/core/src/fmt/mod.rs:1150:17
   5:     0x7f32db3fd435 - std::io::Write::write_fmt::h1d5220480c7a2437
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/io/mod.rs:1667:15
   6:     0x7f32db40fa60 - std::sys_common::backtrace::_print::h4b77abc4d907ed0e
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f32db40fa60 - std::sys_common::backtrace::print::hb170c60b542377ad
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f32db40fa60 - std::panicking::default_hook::{{closure}}::h12bbda9af8901ee3
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/panicking.rs:210:50
   9:     0x7f32db40f617 - std::panicking::default_hook::h8c6c66d3f3ba6768
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/panicking.rs:227:9
  10:     0x7f32dbbe3861 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::h5d5f6bcd40777e95
  11:     0x7f32db410279 - std::panicking::rust_panic_with_hook::h36f2fa0bb09f4069
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/panicking.rs:628:17
  12:     0x7f32db40fd30 - std::panicking::begin_panic_handler::{{closure}}::h9c42b65a42d06a7a
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/panicking.rs:521:13
  13:     0x7f32db40c9c4 - std::sys_common::backtrace::__rust_end_short_backtrace::hc791bddfe31e532c
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f32db40fc99 - rust_begin_unwind
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/panicking.rs:517:5
  15:     0x7f32db3d481b - std::panicking::begin_panic_fmt::h32ac317c038a272d
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/panicking.rs:460:5
  16:     0x7f32de14054e - rustc_errors::HandlerInner::flush_delayed::hc1a0dc2a3b52b7c5
  17:     0x7f32de13ee41 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::h6b6fa9db3b176321
  18:     0x7f32dd702b16 - core::ptr::drop_in_place<rustc_session::parse::ParseSess>::h0f64c3a6d9ae48b4
  19:     0x7f32dd704b0e - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h38ccacfabbb0cd9a
  20:     0x7f32dd6d6a8d - core::ptr::drop_in_place<rustc_interface::interface::Compiler>::he462bcfe0a585c06
  21:     0x7f32dd6d676c - rustc_span::with_source_map::h42000c6d4d4801a0
  22:     0x7f32dd6e8858 - scoped_tls::ScopedKey<T>::set::h9c4e59a22d2be862
  23:     0x7f32dd6d79db - std::sys_common::backtrace::__rust_begin_short_backtrace::hb112af792d752f1d
  24:     0x7f32dd6d4b95 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h9bf5ff18e54ee278
  25:     0x7f32db41c8c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hbbbb32ef11ea0ad2
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/alloc/src/boxed.rs:1636:9
  26:     0x7f32db41c8c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3b8ef23699fc5385
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/alloc/src/boxed.rs:1636:9
  27:     0x7f32db41c8c3 - std::sys::unix::thread::Thread::new::thread_start::ha57f5cba35f709b7
                               at /rustc/e784c962ea252f0874a4305168077e7048cb39e9/library/std/src/sys/unix/thread.rs:106:17
  28:     0x7f32db33d299 - start_thread
  29:     0x7f32db251353 - __clone
  30:                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.56.0-beta.1 (e784c962e 2021-09-07) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z force-unstable-if-unmarked -C codegen-units=1 -C embed-bitcode=no --crate-type bin

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
Some expected error codes were not found: ["E0277"]

failures:
    src/string.rs - string::String (line 168)

test result: FAILED. 597 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 11.59s



command did not execute successfully: "/opt/code/rust-projects/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "32" "--release" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/opt/code/rust-projects/rust/library/test/Cargo.toml" "-p" "alloc" "--" "--quiet"
expected success, got: exit status: 101


Build completed unsuccessfully in 0:00:13
@bsodmike bsodmike 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 Oct 10, 2021
@bsodmike bsodmike changed the title Compiler panic when running tests against library/alloc Internal Compiler Error when running tests against library/alloc Oct 10, 2021
@bsodmike
Copy link
Author

I was able to get the tests to pass with ./x.py test library/alloc/ --stage 1 though. Any idea as to why this works?

@ehuss
Copy link
Contributor

ehuss commented Oct 11, 2021

Thanks for the report! I believe this is a duplicate of #89725, so closing in favor of that.
There is likely a fix that is missing in the beta compiler that is in the latest master branch. However, I wasn't able to narrow it down to a specific PR.
(Note: other discussion is at https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/ICE.20when.20running.20tests.20against.20.60library.2Falloc.60/near/256924676)

@ehuss ehuss closed this as completed Oct 11, 2021
@the8472
Copy link
Member

the8472 commented Oct 11, 2021

@ehuss

I believe this is a duplicate of #89725,

That is this issue. Did you link the wrong one?

@ehuss
Copy link
Contributor

ehuss commented Oct 11, 2021

Oops, yea, copy-and-paste error. Meant to link #89564.

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

3 participants