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

'rustc' panicked at 'internal error: entered unreachable code', src/libsyntax/ast.rs:668:6 while bootstrapping #61200

Closed
matthiaskrgr opened this issue May 25, 2019 · 10 comments
Assignees
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented May 25, 2019

git checkout 02f5786
./x.py build
git checkout f492693
./x.py build
=> ICE'd

Click for build log and stack trace
Updating only changed submodules
Submodules updated in 0.02 seconds
    Finished dev [unoptimized] target(s) in 0.28s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.34s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.28s
Copying stage0 test from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.33s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
    Finished release [optimized] target(s) in 0.30s
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.39s
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.39s
Copying stage1 test from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling serde_json v1.0.33
   Compiling syn v0.15.22
   Compiling rls-data v0.19.0
   Compiling rustc-rayon v0.2.0
   Compiling rand v0.6.1
   Compiling parking_lot_core v0.4.0
   Compiling tempfile v3.0.5
thread 'rustc' panicked at 'internal error: entered unreachable code', src/libsyntax/ast.rs:668:66ore, tempfile
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: serialize::serialize::Decoder::read_struct
   8: serialize::serialize::Decoder::read_enum
   9: serialize::serialize::Decoder::read_struct
  10: <alloc::boxed::Box<T> as serialize::serialize::Decodable>::decode
  11: serialize::serialize::Decoder::read_enum
  12: serialize::serialize::Decoder::read_seq
  13: <rustc::mir::TerminatorKind as serialize::serialize::Decodable>::decode::{{closure}}::{{closure}}
  14: serialize::serialize::Decoder::read_struct
  15: serialize::serialize::Decoder::read_option
  16: serialize::serialize::Decoder::read_struct
  17: serialize::serialize::Decoder::read_seq
  18: <rustc::mir::Mir as serialize::serialize::Decodable>::decode::{{closure}}
  19: rustc_metadata::decoder::<impl rustc_metadata::schema::Lazy<T>>::decode
  20: rustc_metadata::cstore_impl::provide_extern::optimized_mir
  21: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::optimized_mir>::compute
  22: rustc::dep_graph::graph::DepGraph::with_task_impl
  23: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  24: rustc_mir::monomorphize::collector::collect_items_rec
  25: rustc_mir::monomorphize::collector::collect_items_rec
  26: rustc_mir::monomorphize::collector::collect_items_rec
  27: rustc_mir::monomorphize::collector::collect_items_rec
  28: rustc_mir::monomorphize::collector::collect_items_rec
  29: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  30: rustc::util::common::time
  31: rustc_mir::monomorphize::collector::collect_crate_mono_items
  32: rustc::util::common::time
  33: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  34: rustc::ty::query::__query_compute::collect_and_partition_mono_items
  35: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_and_partition_mono_items>::compute
  36: rustc::dep_graph::graph::DepGraph::with_task_impl
  37: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  38: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  39: rustc::util::common::time
  40: rustc_interface::passes::start_codegen
  41: rustc::ty::context::tls::enter_global
  42: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  43: rustc_interface::passes::create_global_ctxt::{{closure}}
  44: rustc_interface::passes::BoxedGlobalCtxt::enter
  45: rustc_interface::queries::Query<T>::compute
  46: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::ongoing_codegen
  47: rustc_interface::interface::run_compiler_in_existing_thread_pool
  48: std::thread::local::LocalKey<T>::with
  49: scoped_tls::ScopedKey<T>::set
  50: syntax::with_globals
query stack during panic:
#0 [optimized_mir] processing `<proc_macro2::stable::Ident as std::cmp::PartialEq<T>>::eq`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.36.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options -Z force-unstable-if-unmarked -C opt-level=2 -C debuginfo=0 --crate-type lib

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

error: Could not compile `syn`.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--features" "" "--manifest-path" "/home/matthias/vcs/github/rust/src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
failed to run: /home/matthias/vcs/github/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:15

config.toml:

[llvm]
[build]
submodules = true
extended = true
tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]
sanitizers = true
profiler = true
low-priority = true
[install]
[rust]
[target.x86_64-unknown-linux-gnu]
[dist]
@Centril Centril 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. I-nominated T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-codegen Area: Code generation labels May 26, 2019
@matthiaskrgr
Copy link
Member Author

I retried the recipe with a clean build now and could not reproduce... :/
Could this be a another incremental compilation related bug?

@hellow554
Copy link
Contributor

This sounds like a incremental bug, but I can't see that you are using incremental compiling (neither incremental = true in your config.toml, nor the -i switch in your x.py build), so I guess it isn't. Must be something else?!

@pnkfelix
Copy link
Member

pnkfelix commented Jun 6, 2019

@hellow554 Isn't incremental turned on by default at this point? (Is that only for debug builds? We do not know from this bug report whether this is a debug build or not... oh, they included their config.toml at the bottom, and it does not have debug = true ... so I would assume that there is no incremental compilation involved here. Odd...)

@pnkfelix
Copy link
Member

pnkfelix commented Jun 6, 2019

hmm, re-reading #60228, it seems like that has the same config.toml that is being used here.

Am I simply incorrect about (or more charitably, "mis-remembering") when our rustbuild bootstrap process will use incremental compilation?

@pnkfelix
Copy link
Member

pnkfelix commented Jun 6, 2019

triage: Not sure there is any action we can take here, given that this bug might not be readily reproducible.

I'm going to assign priority P-medium and assign to self, with intent to close as not-reproducible if I cannot reproduce it within a week or so.

@matthiaskrgr
Copy link
Member Author

Well, I hit these "ICE while bootstrapping, but x.py clean ; x.py build makes it disappear" bugs almost daily :/

@pnkfelix
Copy link
Member

pnkfelix commented Jun 6, 2019

@matthiaskrgr right, I understand that (and inferred as much from your bug report history).

To be clear, I am planning to leave open the bugs where we have enough information to actually reproduce the issue at hand, such as #60228.

@pnkfelix
Copy link
Member

pnkfelix commented Jun 6, 2019

@matthiaskrgr or is your response regarding the priority assignment of P-medium? I suppose I could mark it P-high with the same intent to close...

@pnkfelix pnkfelix self-assigned this Jun 6, 2019
@pnkfelix
Copy link
Member

pnkfelix commented Jun 6, 2019

Okay I talked myself into marking as P-high just so I don't let this slide too long.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Jun 6, 2019
@pnkfelix
Copy link
Member

pnkfelix commented Jun 7, 2019

I tried to reproduce locally, and like @matthiaskrgr , I was not able to do so on a clean build. Presumably the problem stems from something with old build artifacts.

Closing as non-reproducible. We should instead focus our efforts on either resolving the issues where we have enough information to reproduce (like #60228), or on finding a replacement for rustbuild.

@pnkfelix pnkfelix closed this as completed Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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

4 participants