Skip to content

rustc fails randomly with (signal: 11, SIGSEGV: invalid memory reference) #84245

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
nappa85 opened this issue Apr 16, 2021 · 21 comments
Closed
Labels
C-defective-hardware Category: Issue that was filed as a possible software bug but is actually defective hardware I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nappa85
Copy link

nappa85 commented Apr 16, 2021

I know this bug doesn't forllow the template, I'll try to be as precise as possible, but I can't reproduce systematically the problem...
I've created a really big project, almost made completely of serde proc-macros, you can find it here: https://github.com/nappa85/serde_fix/
As soon as the project started getting bigger, the builds started failing, I've split it in a workspace, but I haven't solved completely the problem.

The fails are random, and seems to happen more often on a "dirty" environment, where with "dirty" I mean without calling cargo clean before.

I noticed the failure rate is kind of inverse proportional to the number (or the kind) of errors in the code.
For example, before implementing Default for every enum in the code, and therefore having an error for missing Default for every non Option-wrapped enum, it was really hard to get a non failing build.

Now that the code is cleaner, to trigger the failure I created a script that adds a comment to a shared crate and then restarts ¢argo check for all toolchains: https://github.com/nappa85/serde_fix/blob/master/runtest.sh
I run it like I=0; while ./runtest.sh; do :; done

Normally rustc fails with something like:

  process didn't exit successfully: `rustc --crate-name fixt11 --edition=2018 fixt11/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=045522708ff761af -C extra-filename=-045522708ff761af --out-dir /home/marcon/Progetti/serde_fix/target/debug/deps -C incremental=/home/marcon/Progetti/serde_fix/target/debug/incremental -L dependency=/home/marcon/Progetti/serde_fix/target/debug/deps --extern fix_common=/home/marcon/Progetti/serde_fix/target/debug/deps/libfix_common-b432d750f411466d.rmeta --extern serde=/home/marcon/Progetti/serde_fix/target/debug/deps/libserde-3d4d15af8ef49c31.rmeta --extern serde_fix=/home/marcon/Progetti/serde_fix/target/debug/deps/libserde_fix-798dff9103619a78.rmeta` (signal: 11, SIGSEGV: invalid memory reference)

Sometimes, after a failure, I'm not able to restart a build until I run cargo clean, the build fails with:

memory allocation of 104733814464 bytes failed
Aborted (core dumped)

Only once it failed with a backtrace, that is:

Backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 30 but the index is 1127271296', compiler/rustc_metadata/src/creader.rs:134:21
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.52.0-beta.3 (215738137 2021-04-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
thread 'rustc' panicked at 'index out of bounds: the len is 30 but the index is 1127271296', compiler/rustc_metadata/src/creader.rs:134:21
stack backtrace:
   0:     0x7fc8e99fbb00 - std::backtrace_rs::backtrace::libunwind::trace::hc65bb72b4a549d12
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fc8e99fbb00 - std::backtrace_rs::backtrace::trace_unsynchronized::h6e6089972b3c123e
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc8e99fbb00 - std::sys_common::backtrace::_print_fmt::h6a259ed64281b14e
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fc8e99fbb00 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hada463cae5e69c09
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fc8e9a6a22f - core::fmt::write::hd526fa92c7915d40
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1092:17
   5:     0x7fc8e99efc12 - std::io::Write::write_fmt::h6bc7fe34c0e5e633
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/io/mod.rs:1572:15
   6:     0x7fc8e99ff835 - std::sys_common::backtrace::_print::h2485fe440d733b74
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fc8e99ff835 - std::sys_common::backtrace::print::hfe9bf64cf6d5131b
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fc8e99ff835 - std::panicking::default_hook::{{closure}}::h9da41c6d765e6d84
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:208:50
   9:     0x7fc8e99ff2e3 - std::panicking::default_hook::h12592fd0ecea94ff
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:225:9
  10:     0x7fc8ea1d015b - rustc_driver::report_ice::h14075d822d976f42
  11:     0x7fc8c94c7013 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3c569397dd37cb4f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/alloc/src/boxed.rs:1560:9
  12:     0x7fc8c953b856 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hbab5ec22efadb322
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7fc8e99fffa0 - std::panicking::rust_panic_with_hook::h48e31a52a6a5e11f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:595:17
  14:     0x7fc8e99ffb17 - std::panicking::begin_panic_handler::{{closure}}::h74f000b3d866b063
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:497:13
  15:     0x7fc8e99fbfbc - std::sys_common::backtrace::__rust_end_short_backtrace::h1dcb6d2a32dff0c7
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7fc8e99ffa79 - rust_begin_unwind
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:493:5
  17:     0x7fc8e99c5d71 - core::panicking::panic_fmt::h2ffa803fe69f2062
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/panicking.rs:92:14
  18:     0x7fc8e99c5d32 - core::panicking::panic_bounds_check::h5773bda7b4a076e6
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/panicking.rs:69:5
  19:     0x7fc8ebab862c - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_key::h1eeb2356d4a28b3d
  20:     0x7fc8ebd7a0ef - <rustc_middle::ty::print::pretty::FmtPrinter<F> as rustc_middle::ty::print::Printer>::print_def_path::h3bb922496dadfb41
  21:     0x7fc8eb26dc99 - <rustc_middle::ty::print::pretty::TraitRefPrintOnlyTraitPath as core::fmt::Display>::fmt::h4a04071e8290f357
  22:     0x7fc8e9a6a22f - core::fmt::write::hd526fa92c7915d40
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1092:17
  23:     0x7fc8eb1a8683 - rustc_middle::ty::print::pretty::<impl rustc_middle::ty::print::Print<P> for rustc_middle::ty::sty::TraitRef>::print::h9521597995ad138a
  24:     0x7fc8eb1a9610 - rustc_middle::ty::print::pretty::<impl core::fmt::Display for rustc_middle::ty::sty::TraitRef>::fmt::h26da59f47c87408c
  25:     0x7fc8eb26fd50 - std::thread::local::LocalKey<T>::with::h68d1568c0faa00d6
  26:     0x7fc8eb1a2d2f - rustc_middle::ty::structural_impls::<impl core::fmt::Debug for rustc_middle::ty::sty::TraitRef>::fmt::h8a3645189c9ebbcc
  27:     0x7fc8e9a6a22f - core::fmt::write::hd526fa92c7915d40
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1092:17
  28:     0x7fc8e9a6b404 - core::fmt::Formatter::write_fmt::h065f17fef40bc6c2
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1535:9
  29:     0x7fc8eb259467 - rustc_middle::ty::structural_impls::<impl core::fmt::Debug for rustc_middle::ty::PredicateKind>::fmt::ha8923a8a7af3bbd3
  30:     0x7fc8e9a66eee - core::fmt::builders::DebugTuple::field::{{closure}}::h399721513d1e5c1f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:345:17
  31:     0x7fc8e9a66eee - core::result::Result<T,E>::and_then::hfef0617aa62e9568
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/result.rs:704:22
  32:     0x7fc8e9a66eee - core::fmt::builders::DebugTuple::field::hf6cdfea1b13336ce
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:332:23
  33:     0x7fc8eb1ab45c - <rustc_middle::ty::sty::Binder<T> as core::fmt::Debug>::fmt::he45a983435a30287
  34:     0x7fc8e9a6a22f - core::fmt::write::hd526fa92c7915d40
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1092:17
  35:     0x7fc8e9a6b404 - core::fmt::Formatter::write_fmt::h065f17fef40bc6c2
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1535:9
  36:     0x7fc8eb24d0a8 - <&T as core::fmt::Debug>::fmt::h1aabd3b18a66933c
  37:     0x7fc8e9a6709a - core::fmt::builders::DebugInner::entry::{{closure}}::h48f301b78689925a
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:417:17
  38:     0x7fc8e9a6709a - core::result::Result<T,E>::and_then::ha138ac621db2bd1e
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/result.rs:704:22
  39:     0x7fc8e9a6709a - core::fmt::builders::DebugInner::entry::h7bfe5b8dcccf238e
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:403:23
  40:     0x7fc8e9a67169 - core::fmt::builders::DebugSet::entry::ha731768ebd0e8466
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:492:9
  41:     0x7fc8eb1f64cb - core::fmt::builders::DebugList::entries::h61aaca8ba055eb1e
  42:     0x7fc8eb25026e - <[T] as core::fmt::Debug>::fmt::h25f46d002945aa4b
  43:     0x7fc8e9a66c4e - core::fmt::builders::DebugStruct::field::{{closure}}::h593a8be22597e88b
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:154:17
  44:     0x7fc8e9a66c4e - core::result::Result<T,E>::and_then::h7bb0007399fd060f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/result.rs:704:22
  45:     0x7fc8e9a66c4e - core::fmt::builders::DebugStruct::field::h569d908b4e5aeafe
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:137:23
  46:     0x7fc8eb25adca - <rustc_middle::ty::ParamEnv as core::fmt::Debug>::fmt::hb568634497a886cd
  47:     0x7fc8e9a66c4e - core::fmt::builders::DebugStruct::field::{{closure}}::h593a8be22597e88b
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:154:17
  48:     0x7fc8e9a66c4e - core::result::Result<T,E>::and_then::h7bb0007399fd060f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/result.rs:704:22
  49:     0x7fc8e9a66c4e - core::fmt::builders::DebugStruct::field::h569d908b4e5aeafe
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:137:23
  50:     0x7fc8ea7d589e - <&T as core::fmt::Debug>::fmt::h645ead9d504051b6
  51:     0x7fc8e9a66c4e - core::fmt::builders::DebugStruct::field::{{closure}}::h593a8be22597e88b
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:154:17
  52:     0x7fc8e9a66c4e - core::result::Result<T,E>::and_then::h7bb0007399fd060f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/result.rs:704:22
  53:     0x7fc8e9a66c4e - core::fmt::builders::DebugStruct::field::h569d908b4e5aeafe
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/builders.rs:137:23
  54:     0x7fc8ea881fcc - <rustc_middle::infer::canonical::Canonical<V> as core::fmt::Debug>::fmt::h7cde9e99c95c7130
  55:     0x7fc8e9a6a22f - core::fmt::write::hd526fa92c7915d40
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:1092:17
  56:     0x7fc8e9a5cacc - core::fmt::Write::write_fmt::h451c56ba82d6e1f2
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/fmt/mod.rs:182:9
  57:     0x7fc8e9a5cacc - alloc::fmt::format::hebf2b2426874b3ab
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/alloc/src/fmt.rs:578:5
  58:     0x7fc8ea861e8e - std::thread::local::LocalKey<T>::with::h3cf8c01b4104782a
  59:     0x7fc8ea96e2f3 - rustc_middle::ty::print::pretty::with_no_trimmed_paths::h3b3ec82570b1ec62
  60:     0x7fc8ea8707e8 - std::thread::local::LocalKey<T>::with::hc0ef46ad7cc87747
  61:     0x7fc8ea96fc96 - rustc_middle::ty::print::pretty::with_forced_impl_filename_line::h108438a8f664d238
  62:     0x7fc8ea96b809 - rustc_query_impl::make_query::type_op_prove_predicate::h9220fc01f9f25825
  63:     0x7fc8ea9efa21 - <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::h40129cc4908fdd14
  64:     0x7fc8ea9d0fee - <hashbrown::map::HashMap<K,V,S,A> as core::iter::traits::collect::Extend<(K,V)>>::extend::h8f2fc321eb2c02f3
  65:     0x7fc8ea74a982 - rustc_query_system::query::plumbing::QueryState<D,K>::try_collect_active_jobs::h863c9c6d29de8915
  66:     0x7fc8ea88d58a - rustc_query_impl::Queries::try_collect_active_jobs::hd38829f4a212615d
  67:     0x7fc8ea954950 - <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::try_collect_active_jobs::hb23e4fd740dc5332
  68:     0x7fc8ea7ad38c - rustc_query_system::query::job::print_query_stack::h03d1a6b10b1d44fc
  69:     0x7fc8ea29f3e8 - rustc_interface::interface::try_print_query_stack::h926cd20fc6bdd631
  70:     0x7fc8ea1d0568 - rustc_driver::report_ice::h14075d822d976f42
  71:     0x7fc8c94c7013 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3c569397dd37cb4f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/alloc/src/boxed.rs:1560:9
  72:     0x7fc8c953b856 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hbab5ec22efadb322
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/proc_macro/src/bridge/client.rs:320:21
  73:     0x7fc8e99fffa0 - std::panicking::rust_panic_with_hook::h48e31a52a6a5e11f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:595:17
  74:     0x7fc8e99ffb17 - std::panicking::begin_panic_handler::{{closure}}::h74f000b3d866b063
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:497:13
  75:     0x7fc8e99fbfbc - std::sys_common::backtrace::__rust_end_short_backtrace::h1dcb6d2a32dff0c7
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys_common/backtrace.rs:141:18
  76:     0x7fc8e99ffa79 - rust_begin_unwind
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:493:5
  77:     0x7fc8e99c5d71 - core::panicking::panic_fmt::h2ffa803fe69f2062
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/panicking.rs:92:14
  78:     0x7fc8e99c5d32 - core::panicking::panic_bounds_check::h5773bda7b4a076e6
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/panicking.rs:69:5
  79:     0x7fc8ebab894c - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_path_hash::hdeb4797963c3acdb
  80:     0x7fc8ebcfb448 - rustc_middle::ich::impls_ty::<impl rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext> for rustc_middle::ty::sty::Binder<T>>::hash_stable::h0bc8e5fa48caf7ef
  81:     0x7fc8ec7416b8 - <[T] as rustc_data_structures::stable_hasher::HashStable<CTX>>::hash_stable::hb2ff12798e00d2cf
  82:     0x7fc8ebd86f95 - std::thread::local::LocalKey<T>::with::h026ca23f210d852a
  83:     0x7fc8ebd6f13a - <rustc_middle::ty::ParamEnv as rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext>>::hash_stable::hadda05d1178338a7
  84:     0x7fc8ec28a69c - <T as rustc_query_system::dep_graph::dep_node::DepNodeParams<Ctxt>>::to_fingerprint::h5698ecf1313e3882
  85:     0x7fc8eb723a9b - rustc_query_system::query::plumbing::get_query_impl::h72f3bbe3292ffc38
  86:     0x7fc8eb7902e2 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_op_prove_predicate::h04b6f050f5152004
  87:     0x7fc8ebc55517 - rustc_trait_selection::traits::query::type_op::prove_predicate::<impl rustc_trait_selection::traits::query::type_op::QueryTypeOp for rustc_middle::traits::query::type_op::ProvePredicate>::perform_query::h397428cd22c8c9fd
  88:     0x7fc8eb98dcf0 - rustc_trait_selection::traits::query::type_op::QueryTypeOp::fully_perform_into::h94dcc2be82a9aeaa
  89:     0x7fc8eb9c136f - <rustc_middle::ty::ParamEnvAnd<Q> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::h04e0cc5568411883
  90:     0x7fc8eba1d78a - rustc_mir::borrow_check::type_check::TypeChecker::prove_predicate::hfc839dbb47558707
  91:     0x7fc8eba1e55a - rustc_mir::borrow_check::type_check::TypeChecker::typeck_mir::hb537c1493bbbc772
  92:     0x7fc8eba0cda7 - rustc_mir::borrow_check::type_check::type_check::h3ef8589778be93bb
  93:     0x7fc8eb8d5505 - rustc_mir::borrow_check::nll::compute_regions::hdd67fe62f7968159
  94:     0x7fc8eb9cc548 - rustc_mir::borrow_check::do_mir_borrowck::hdb3499e3f0ebcb3b
  95:     0x7fc8eb8c3741 - rustc_infer::infer::InferCtxtBuilder::enter::hfa814de4c996f100
  96:     0x7fc8eb9cb8c4 - rustc_mir::borrow_check::mir_borrowck::hb3eca2a663210af2
  97:     0x7fc8eb9c58be - core::ops::function::FnOnce::call_once::h35eb2fbe226edf89
  98:     0x7fc8ec2fdaab - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hf474419eae80c4c6
  99:     0x7fc8eb7952cc - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h28fda917f446592e
 100:     0x7fc8eb74d64e - rustc_query_system::query::plumbing::force_query_with_job::hd140b4d540507fce
 101:     0x7fc8eb717ac3 - rustc_query_system::query::plumbing::get_query_impl::h48229917e4bc1a4a
 102:     0x7fc8eb78e5ed - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck::h984bfd92206b0b45
 103:     0x7fc8eb47adf5 - rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners::h792122383dbfd12e
 104:     0x7fc8ebe3b3d7 - rustc_interface::passes::analysis::h391678db2ed31e9c
 105:     0x7fc8ea98ba4a - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hd0507447f9fbb9af
 106:     0x7fc8ec2ada90 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h447795d359c1b960
 107:     0x7fc8ec30d8f7 - rustc_data_structures::stack::ensure_sufficient_stack::h419f23b903c263df
 108:     0x7fc8ec1dfc01 - rustc_query_system::query::plumbing::force_query_with_job::h36761774af3a5891
 109:     0x7fc8ec1c945b - rustc_query_system::query::plumbing::get_query_impl::hf9f05e7ca537c4ce
 110:     0x7fc8ec294def - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::he5fdc9b8bdc0c796
 111:     0x7fc8ebe2927b - rustc_interface::passes::QueryContext::enter::hef42bd104aedbb85
 112:     0x7fc8ebdfff05 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h60cfe93b7b0e1e5f
 113:     0x7fc8ebdfa521 - rustc_span::with_source_map::hd8e0dcfd833db880
 114:     0x7fc8ebe00ede - rustc_interface::interface::create_compiler_and_run::h016141feddeec777
 115:     0x7fc8ebdfb3d8 - scoped_tls::ScopedKey<T>::set::h251cc53c4edaefe8
 116:     0x7fc8ebe01294 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8e422294f8c54ce3
 117:     0x7fc8ebe188f5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h9d09c7ff9f326ef9
 118:     0x7fc8e9a0f8e8 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h36b08298aa835de6
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/alloc/src/boxed.rs:1546:9
 119:     0x7fc8e9a0f8e8 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h39c1de95e16a780f
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/alloc/src/boxed.rs:1546:9
 120:     0x7fc8e9a0f8e8 - std::sys::unix::thread::Thread::new::thread_start::ha33b608c43829834
                               at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/sys/unix/thread.rs:71:17
 121:     0x7fc8e9935450 - start_thread
 122:     0x7fc8e9843d53 - clone
 123:                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.52.0-beta.3 (215738137 2021-04-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
error: could not compile `fix50sp2`

Caused by:
  process didn't exit successfully: `rustc --crate-name fix50sp2 --edition=2018 fix50sp2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=7a0544dae5cc1f1e -C extra-filename=-7a0544dae5cc1f1e --out-dir /home/marco/Progetti/temp/target/debug/deps -C incremental=/home/marco/Progetti/temp/target/debug/incremental -L dependency=/home/marco/Progetti/temp/target/debug/deps --extern fix_common=/home/marco/Progetti/temp/target/debug/deps/libfix_common-87626cf92204a1bc.rmeta --extern fixt11=/home/marco/Progetti/temp/target/debug/deps/libfixt11-69bd0e267a8a01af.rmeta --extern serde=/home/marco/Progetti/temp/target/debug/deps/libserde-3d4b116345418cef.rmeta --extern serde_fix=/home/marco/Progetti/temp/target/debug/deps/libserde_fix-b1f436314963cc65.rmeta` (signal: 4, SIGILL: illegal instruction)

My machine is an AMD Ryzen 7 4700U with 16GB of RAM running Kubuntu 21.04 (same problems with 20.04 and 20.10).
If you need any additional info, just ask me, my goal is to help improve the compiler.

@nappa85 nappa85 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 Apr 16, 2021
@nappa85
Copy link
Author

nappa85 commented Apr 16, 2021

I've been able to create a core dump, the backtrace is:

#0  atomic_load_p (a=0x27478, mo=atomic_memory_order_relaxed) at ../jemalloc/include/jemalloc/internal/atomic.h:55
#1  rtree_leaf_elm_bits_read (tsdn=<optimized out>, rtree=<optimized out>, elm=0x27478, dependent=true) at ../jemalloc/include/jemalloc/internal/rtree.h:175
#2  rtree_szind_slab_read (tsdn=0x7fd63c1fde40, rtree=<optimized out>, rtree_ctx=0x7fd63c1fde68, key=140558255847381, dependent=true, r_szind=<optimized out>, r_slab=<optimized out>)
    at ../jemalloc/include/jemalloc/internal/rtree.h:464
#3  ifree (tsd=<optimized out>, ptr=0x7fd644e8f7d5 <proc_macro::Punct::as_char+37>, tcache=0x7fd63c1fe000, slow_path=false) at ../jemalloc/src/jemalloc.c:2206
#4  free (ptr=0x7fd644e8f7d5 <proc_macro::Punct::as_char+37>) at ../jemalloc/src/jemalloc.c:2393
#5  0x00007fd643192418 in core::ptr::drop_in_place<proc_macro::bridge::buffer::Buffer<u8>> () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#6  0x00007fd6442761cf in <proc_macro::bridge::server::Dispatcher<proc_macro::bridge::server::MarkedTypes<S>> as proc_macro::bridge::server::DispatcherTrait>::dispatch ()
   from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#7  0x00007fd644282f33 in _$LT$proc_macro..bridge..closure..Closure$LT$A$C$R$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$F$GT$$GT$::from::call::h2b7103ad48cadfdc ()
   from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#8  0x00007fd644e8fc94 in proc_macro::bridge::closure::Closure::call<proc_macro::bridge::buffer::Buffer<u8>,proc_macro::bridge::buffer::Buffer<u8>> ()
    at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/closure.rs:27
#9  proc_macro::bridge::client::{{impl}}::as_char::{{closure}} () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:244
#10 proc_macro::bridge::client::{{impl}}::with::{{closure}}<char,closure-0> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:336
#11 proc_macro::bridge::client::{{impl}}::with::{{closure}}::{{closure}}<char,closure-0> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:293
#12 proc_macro::bridge::scoped_cell::ScopedCell::replace<proc_macro::bridge::client::BridgeStateL,char,closure-0> ()
    at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/scoped_cell.rs:75
#13 proc_macro::bridge::client::{{impl}}::with::{{closure}}<char,closure-0> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:291
#14 std::thread::local::LocalKey::try_with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>,closure-0,char> ()
    at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/thread/local.rs:272
#15 std::thread::local::LocalKey::with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>,closure-0,char> ()
    at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/thread/local.rs:248
#16 proc_macro::bridge::client::BridgeState::with<char,closure-0> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:290
#17 proc_macro::bridge::Bridge::with<char,closure-0> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:329
#18 proc_macro::bridge::client::Punct::as_char () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/bridge/client.rs:237
--Type <RET> for more, q to quit, c to continue without paging--c
#19 proc_macro::Punct::as_char () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/proc_macro/src/lib.rs:791
#20 0x00007fd632ffd1cf in proc_macro2::imp::{{impl}}::next (self=0x7fd63c1e8e08) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/proc-macro2-1.0.26/src/wrapper.rs:332
#21 0x00007fd63300bf37 in proc_macro2::token_stream::{{impl}}::next (self=0x7fd63c1e8e08) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/proc-macro2-1.0.26/src/lib.rs:1240
#22 0x00007fd632f9fb07 in syn::buffer::TokenBuffer::inner_new (stream=..., up=0x7fd632854900) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/buffer.rs:53
#23 0x00007fd632fa0203 in syn::buffer::TokenBuffer::inner_new (stream=..., up=0x7fd63b596b80) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/buffer.rs:89
#24 0x00007fd632fa0203 in syn::buffer::TokenBuffer::inner_new (stream=..., up=0x0) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/buffer.rs:89
#25 0x00007fd632fa06cd in syn::buffer::TokenBuffer::new2 (stream=...) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/buffer.rs:112
#26 0x00007fd632e966a3 in syn::parse::{{impl}}::parse2<fn(&syn::parse::ParseBuffer) -> core::result::Result<syn::derive::DeriveInput, syn::error::Error>,syn::derive::DeriveInput> (self=0x4, tokens=...) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/parse.rs:1207
#27 0x00007fd632e9656a in syn::parse::Parser::parse<fn(&syn::parse::ParseBuffer) -> core::result::Result<syn::derive::DeriveInput, syn::error::Error>> (self=0x7fd632ed5450 <proc_macro::bridge::client::{{impl}}::expand1::run<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>, tokens=...) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/parse.rs:1161
#28 0x00007fd632e96278 in syn::parse_macro_input::parse<syn::derive::DeriveInput> (token_stream=...) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.69/src/parse_macro_input.rs:139
#29 0x00007fd632eaadb2 in serde_derive::derive_deserialize (input=...) at /home/marco/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/serde_derive-1.0.125/src/lib.rs:93
#30 0x00007fd632e97d05 in core::ops::function::FnOnce::call_once<fn(proc_macro::TokenStream) -> proc_macro::TokenStream,(proc_macro::TokenStream)> () at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
#31 0x00007fd632ed54f6 in proc_macro::bridge::client::{{impl}}::expand1::run::{{closure}}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream> (input=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:410
#32 0x00007fd632ed4b4f in proc_macro::bridge::client::run_client::{{closure}}::{{closure}}<proc_macro::bridge::client::TokenStream,proc_macro::bridge::client::TokenStream,closure-0> () at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:377
#33 0x00007fd632e95188 in proc_macro::bridge::scoped_cell::{{impl}}::set::{{closure}}<proc_macro::bridge::client::BridgeStateL,(),closure-0> () at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:80
#34 0x00007fd632e9539d in proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::replace<proc_macro::bridge::client::BridgeStateL,(),closure-0> (self=0x7fd63c1fdb28, replacement=..., f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:75
#35 0x00007fd632e95161 in proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::set<proc_macro::bridge::client::BridgeStateL,(),closure-0> (self=0x7fd63c1fdb28, value=..., f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:80
#36 0x00007fd632ed52bf in proc_macro::bridge::client::{{impl}}::enter::{{closure}}<(),closure-0> (state=0x7fd63c1fdb28) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:325
#37 0x00007fd632e863ed in std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::try_with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>,closure-1,()> (self=0x7fd633222f00, f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272
#38 0x00007fd632e85eed in std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>,closure-1,()> (self=0x7fd633222f00, f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:248
#39 0x00007fd632e855dd in proc_macro::bridge::Bridge::enter<(),closure-0> (self=..., f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:325
#40 0x00007fd632ed4a44 in proc_macro::bridge::client::run_client::{{closure}}<proc_macro::bridge::client::TokenStream,proc_macro::bridge::client::TokenStream,closure-0> () at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:370
#41 0x00007fd632e92f62 in std::panic::{{impl}}::call_once<(),closure-0> (self=..., _args=()) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344
#42 0x00007fd632ed6330 in std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure-0>,()> (data=0x7fd63c1eb808) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379
#43 0x00007fd632ee007d in __rust_try () from /home/marco/Progetti/temp/target/debug/deps/libserde_derive-0445a282a2c7250e.so
#44 0x00007fd632ed6250 in std::panicking::try<(),std::panic::AssertUnwindSafe<closure-0>> (f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343
#45 0x00007fd632e96232 in std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure-0>,()> (f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431
#46 0x00007fd632ed489c in proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream,proc_macro::bridge::client::TokenStream,closure-0> (bridge=..., f=...) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:369
#47 0x00007fd632ed54b1 in proc_macro::bridge::client::{{impl}}::expand1::run<fn(proc_macro::TokenStream) -> proc_macro::TokenStream> (bridge=..., f=0x7fd632eaad80 <serde_derive::derive_deserialize>) at /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:410
#48 0x00007fd644e0bd50 in proc_macro::bridge::server::run_server () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#49 0x00007fd644ddb840 in <rustc_expand::proc_macro::ProcMacroDerive as rustc_expand::base::MultiItemModifier>::expand () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#50 0x00007fd64423ae0b in rustc_expand::expand::MacroExpander::fully_expand_fragment () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#51 0x00007fd644dd5e50 in rustc_expand::expand::MacroExpander::expand_crate () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#52 0x00007fd64461f7da in rustc_session::utils::<impl rustc_session::session::Session>::time () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#53 0x00007fd644633932 in rustc_interface::passes::configure_and_expand_inner () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#54 0x00007fd644629eb5 in rustc_interface::passes::configure_and_expand::_$u7b$$u7b$closure$u7d$$u7d$::h3a41a297ff107384 () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#55 0x00007fd64462344d in rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#56 0x00007fd644632e4b in rustc_interface::passes::configure_and_expand () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#57 0x00007fd6446477ea in rustc_interface::queries::Queries::expansion () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#58 0x00007fd6445dcba8 in rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#59 0x00007fd6445d6643 in rustc_span::with_source_map () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#60 0x00007fd6445ddeca in rustc_interface::interface::create_compiler_and_run () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#61 0x00007fd6445d6d05 in rustc_span::with_session_globals () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#62 0x00007fd6445de36a in std::sys_common::backtrace::__rust_begin_short_backtrace () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#63 0x00007fd6445fac4a in core::ops::function::FnOnce::call_once{{vtable-shim}} () from /home/marco/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7ea116e55de24565.so
#64 0x00007fd641a47c8a in alloc::boxed::{{impl}}::call_once<(),FnOnce<()>,alloc::alloc::Global> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/alloc/src/boxed.rs:1521
#65 alloc::boxed::{{impl}}::call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/alloc/src/boxed.rs:1521
#66 std::sys::unix::thread::{{impl}}::new::thread_start () at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/std/src/sys/unix/thread.rs:71
#67 0x00007fd64196d450 in start_thread (arg=0x7fd63c1ff640) at pthread_create.c:473
#68 0x00007fd64187bd53 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@jyn514 jyn514 added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Apr 16, 2021
@Aaron1011
Copy link
Member

@nappa85: How many runs of runtest.sh did it take to reproduce the crash? The project is compiling very slowly for me, and taking large amounts of memory (~4-5 GB)

@nappa85
Copy link
Author

nappa85 commented Apr 16, 2021

@nappa85: How many runs of runtest.sh did it take to reproduce the crash? The project is compiling very slowly for me, and taking large amounts of memory (~4-5 GB)

As I already told, it's completely random.
The core dump I attached happened on first try, for example.
I'm actually using another machine to exclude the hardware problem, at the beginning of the sixth iteration of runtest.sh I had this failure:

  process didn't exit successfully: `rustc --crate-name fix50sp2 --edition=2018 fix50sp2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=a28a0a3657aedba2 -C extra-filename=-a28a0a3657aedba2 --out-dir /home/nappa85/temp/target/debug/deps -C incremental=/home/nappa85/temp/target/debug/incremental -L dependency=/home/nappa85/temp/target/debug/deps --extern fix_common=/home/nappa85/temp/target/debug/deps/libfix_common-b432d750f411466d.rmeta --extern fixt11=/home/nappa85/temp/target/debug/deps/libfixt11-045522708ff761af.rmeta --extern serde=/home/nappa85/temp/target/debug/deps/libserde-3d4d15af8ef49c31.rmeta --extern serde_fix=/home/nappa85/temp/target/debug/deps/libserde_fix-798dff9103619a78.rmeta` (signal: 9, SIGKILL: kill)

Seems like a kill for timeout or for memory consumption, but I don't understand why on the 5 previous iterations it was ok...

@jgarvin
Copy link

jgarvin commented Apr 16, 2021

If it was killed by the linux OOM killer, there should be a message in the kernel log which you can see by running dmesg. This would also explain the randomness, b/c whether you hit it would depend on how much memory all other applications on the system are using.

@nagisa
Copy link
Member

nagisa commented Apr 17, 2021

Just to make sure, the system this was originally reproduced with is running at stock, no memory/CPU overclock? Asking because it is extremely popular to run Ryzen with overclocked memory via XMP or a similar technology and sometimes such overclocks do result in issues like these being reported against this repository.

@nappa85
Copy link
Author

nappa85 commented Apr 17, 2021

Just to make sure, the system this was originally reproduced with is running at stock, no memory/CPU overclock? Asking because it is extremely popular to run Ryzen with overclocked memory via XMP or a similar technology and sometimes such overclocks do result in issues like these being reported against this repository.

No overclock at all, it's a brand new notebook

@nappa85
Copy link
Author

nappa85 commented Apr 17, 2021

An update on the topic:
I've run my script for more than 12 hours on another machine without a problem, only now it has been killed, but I think it's a load problem.
It must be said that this machine is slower than mine, a full project builds here takes 30 minutes, on my machine it takes only 6 minutes.

I'm stress-testing my machine in every way to exclude an hardware problem, but at the moment without luck.
Memtest86 says the memory is ok, I've tried stress (http://manpages.ubuntu.com/manpages/hirsute/man1/stress.1.html) with stress --cpu 8 --io 8 --vm 20 --vm-bytes 1024M --vm-keep without a single problem...
If you know how to exclude hardware problems, just tell me

@nappa85
Copy link
Author

nappa85 commented Apr 17, 2021

I've run RUSTFLAGS='-Z time-passes' cargo +nightly check on the workspace, this is the result:
time_passes.txt

As you can see, there are several point where more than 3GB of RAM is taken, a point takes almost 5GB...
I don't know if it can be considered normal on a crate made only of serde structs...

@nappa85
Copy link
Author

nappa85 commented Apr 19, 2021

Trying to use fix_message as a dependency of another crate (that is the purpose of the project):

memory allocation of 3357031879003488 bytes failed
error: could not compile `fix50sp2`

Caused by:
  process didn't exit successfully: `rustc --crate-name fix50sp2 --edition=2018 /home/marco/.cargo/git/checkouts/serde_fix-8dbbdecc2774ced0/77dd8ea/fix50sp2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=ed09c736436959db -C extra-filename=-ed09c736436959db --out-dir /home/marco/Progetti/therockfixer/target/debug/deps -L dependency=/home/marco/Progetti/therockfixer/target/debug/deps --extern fix_common=/home/marco/Progetti/therockfixer/target/debug/deps/libfix_common-8c1604d5a22c4f95.rmeta --extern fixt11=/home/marco/Progetti/therockfixer/target/debug/deps/libfixt11-5f2f118e94a7ecba.rmeta --extern serde=/home/marco/Progetti/therockfixer/target/debug/deps/libserde-1bc36b13d54a445b.rmeta --extern serde_fix=/home/marco/Progetti/therockfixer/target/debug/deps/libserde_fix-5ac183259d5eaa3a.rmeta --cap-lints allow` (signal: 6, SIGABRT: process abort signal)```

@sammko
Copy link

sammko commented Apr 19, 2021

This looks like an OOM condition to me. The build takes almost 12 GiB of memory here. FWIW, attached is the output of RUSTFLAGS='-Z time-passes' cargo +nightly build 2>&1 | tee time on my machine.

time.txt

@nappa85
Copy link
Author

nappa85 commented Apr 19, 2021

I don't think it's an OOM, the error is randomic like an UB.
I've just replicated the error on windows, on the same hardware, at the fifth build (the first four correct).
On windows it's a bit slower and it doesn't even reach 100% RAM usage

@nappa85
Copy link
Author

nappa85 commented Apr 20, 2021

The problem has been replicated also by rust-analyzer mantainer, that has a better machine than mine

@nagisa
Copy link
Member

nagisa commented Apr 20, 2021

Can you see if this is a regression and if it is, narrow down the regression range?

@flodiebold
Copy link
Member

The problem has been replicated also by rust-analyzer mantainer, that has a better machine than mine

The rust-analyzer panic is unrelated (and just a normal panic).

@nappa85
Copy link
Author

nappa85 commented Apr 20, 2021

Can you see if this is a regression and if it is, narrow down the regression range?

Is it possible to bisect on something that happens randomly?

@nappa85
Copy link
Author

nappa85 commented Apr 20, 2021

The problem has been replicated also by rust-analyzer mantainer, that has a better machine than mine

The rust-analyzer panic is unrelated (and just a normal panic).

Tomorrow I'll have access to another ryzen7 machine, to see if I replicate the problem here too

@nagisa
Copy link
Member

nagisa commented Apr 20, 2021

Is it possible to bisect on something that happens randomly?

Since the issue presents itself more reliably over multiple runs of the compiler, you can make a script that runs the a given task N times before declaring a commit to be "good".

@nappa85
Copy link
Author

nappa85 commented May 4, 2021

Sorry for the long silence, it took me more than 10 days to prove Lenovo support that there were hardware problems even if tests passes. Now with a brand new hardware everything is stable. Closing the issue

@nappa85 nappa85 closed this as completed May 4, 2021
@leleliu008
Copy link

leleliu008 commented May 26, 2023

I bumped into the same issue today.

My Machine's CPU is: AMD Ryzen 7 5800H with Radeon Graphics
My Machine's host OS is: Ubuntu 23.04
My Machine's guest OS is: alpine 3.17

I build cargo-c via docker, podman, virtualbox, kvm+qemu respectively, all failed due to this. finally, I build it using GitHub Actions: https://github.com/leleliu008/test/actions/runs/4769013342/jobs/8478957739 , it failed too.

@DirkLaurenz
Copy link

same here:

error: could not compile syn

Caused by:
process didn't exit successfully: rustc --crate-name build_script_build --edition=2018 /root/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/syn-1.0.109/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=237 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' --cfg 'feature="visit"' --cfg 'feature="visit-mut"' -C metadata=b768e7845a651bf8 -C extra-filename=-b768e7845a651bf8 --out-dir /root/checkmk/packages/cmk-agent-ctl/target/debug/build/syn-b768e7845a651bf8 -L dependency=/root/checkmk/packages/cmk-agent-ctl/target/debug/deps --cap-lints allow (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
root@dc03:~/checkmk/packages/cmk-agent-ctl# cargo build
Compiling proc-macro2 v1.0.51
Compiling quote v1.0.23
Compiling syn v1.0.109
Compiling libc v0.2.139
Compiling cfg-if v1.0.0
Compiling version_check v0.9.4
error: could not compile libc

Caused by:
process didn't exit successfully: rustc --crate-name build_script_build /root/.cargo/registry/src/git.cakeli.workers.dev-1ecc6299db9ec823/libc-0.2.139/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=237 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="extra_traits"' --cfg 'feature="std"' -C metadata=0a647af3405cec8e -C extra-filename=-0a647af3405cec8e --out-dir /root/checkmk/packages/cmk-agent-ctl/target/debug/build/libc-0a647af3405cec8e -L dependency=/root/checkmk/packages/cmk-agent-ctl/target/debug/deps --cap-lints allow (signal: 11, SIGSEGV: invalid memory reference)

system: raspberry pi 3b Linux dc03 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

@riking
Copy link

riking commented Jun 14, 2024

@rustbot label C-defective-hardware
Adding the label because replacing the machine did actually fix the issue. The reports 2 years later are likely unrelated.

@rustbot rustbot added the C-defective-hardware Category: Issue that was filed as a possible software bug but is actually defective hardware label Jun 14, 2024
@saethlin saethlin removed the C-bug Category: This is a bug. label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-defective-hardware Category: Issue that was filed as a possible software bug but is actually defective hardware I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. 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