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

error: internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[30a9]::ops[0]::drop[0]::Drop[0]) #59731

Closed
bjorn3 opened this issue Apr 5, 2019 · 8 comments
Assignees
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Apr 5, 2019

Repro at https:/bjorn3/rustc_codegen_cranelift/tree/rustc_ice_coherent_trait_force

$ git clone https:/bjorn3/rustc_codegen_cranelift.git
[...]
$ git checkout rustc_ice_coherent_trait_force
[...]
$ rm -r target/debug/incremental
$ git checkout HEAD~ .
$ cargo build # all fine
[...]
$ git reset HEAD .
$ git checkout -- .
$ cargo build
[...]
   Compiling rustc_codegen_cranelift v0.1.0 (/home/bjorn/Documenten/rustc_codegen_cranelift)
warning: unused import: `rustc::session::config::OptLevel`
   --> src/lib.rs:388:9
    |
388 |     use rustc::session::config::OptLevel;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(unused_imports)] on by default

error: internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[30a9]::ops[0]::drop[0]::Drop[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:635:9
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
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::query::plumbing::force_from_dep_node
  15: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  16: rustc::dep_graph::graph::DepGraph::try_mark_green
  17: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  18: rustc::ty::context::GlobalCtxt::enter_local
  19: rustc::ty::util::<impl rustc::ty::ParamEnv>::can_type_implement_copy
  20: rustc_typeck::coherence::builtin::check_trait
  21: rustc_typeck::coherence::coherent_trait
  22: rustc::ty::query::__query_compute::coherent_trait
  23: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::coherent_trait>::compute
  24: rustc::dep_graph::graph::DepGraph::with_task_impl
  25: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  26: rustc_typeck::check_crate::{{closure}}::{{closure}}
  27: rustc::util::common::time
  28: rustc_typeck::check_crate
  29: rustc_interface::passes::analysis
  30: rustc::ty::query::__query_compute::analysis
  31: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::analysis>::compute
  32: rustc::dep_graph::graph::DepGraph::with_task_impl
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  34: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  35: rustc_interface::passes::create_global_ctxt::{{closure}}
  36: rustc_interface::interface::run_compiler_in_existing_thread_pool
  37: std::thread::local::LocalKey<T>::with
  38: scoped_tls::ScopedKey<T>::set
  39: syntax::with_globals
query stack during panic:
#0 [adt_destructor] processing `abi::PassMode`
#1 [coherent_trait] coherence checking all impls of trait `std::marker::Copy`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https:/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.35.0-nightly (53f2165c5 2019-04-04) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type dylib

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

error: Could not compile `rustc_codegen_cranelift`.

To learn more, run the command again with --verbose.
$ cargo build
[...] # ice again
$ rm -r target/debug/incremental
$ cargo build # all fine again

Edit: added instructions to reproduce from scratch

@jonas-schievink jonas-schievink 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 5, 2019
@ZacLiveEarth
Copy link

I'm experiencing the same issue since upgrading the latest version of nightly. It may be worth adding that for my project, cargo build and cargo build --release both work, but wasm-pack test --node produces the same error as in the original issue and wasm-pack test --node --release fails with the following...


LinkError: WebAssembly Instantiation: Import #24 module="./wasm-bindgen-test" function="__wbg_buffer_859770b344faa681" error: function import requires a callable
    at Object.<anonymous> (C:\git\replay-web\libsrc\rust\le-core\target\wasm32-unknown-unknown\wbg-tmp\wasm-bindgen-test_bg.js:8:22)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\git\replay-web\libsrc\rust\le-core\target\wasm32-unknown-unknown\wbg-tmp\wasm-bindgen-test.js:818:8)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
error: test failed, to rerun pass '--lib'
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit code: 1

@torkleyy
Copy link

torkleyy commented Apr 5, 2019

Also experienced this issue:

/home/thomas/.cargo/bin/cargo test --color=always --no-run --package ron --test large_number test_large_number -- --exact
   Compiling ron v0.5.1 (/home/thomas/Workspace/ron)
error: internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[30a9]::ops[0]::drop[0]::Drop[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:635:9
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
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::query::plumbing::force_from_dep_node
  15: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  16: rustc::dep_graph::graph::DepGraph::try_mark_green
  17: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  18: rustc::ty::context::GlobalCtxt::enter_local
  19: rustc::ty::util::<impl rustc::ty::ParamEnv>::can_type_implement_copy
  20: rustc_typeck::coherence::builtin::check_trait
  21: rustc_typeck::coherence::coherent_trait
  22: rustc::ty::query::__query_compute::coherent_trait
  23: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::coherent_trait>::compute
  24: rustc::dep_graph::graph::DepGraph::with_task_impl
  25: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  26: rustc_typeck::check_crate::{{closure}}::{{closure}}
  27: rustc::util::common::time
  28: rustc_typeck::check_crate
  29: rustc_interface::passes::analysis
  30: rustc::ty::query::__query_compute::analysis
  31: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::analysis>::compute
  32: rustc::dep_graph::graph::DepGraph::with_task_impl
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  34: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  35: rustc_interface::passes::create_global_ctxt::{{closure}}
  36: rustc_interface::interface::run_compiler_in_existing_thread_pool
  37: std::thread::local::LocalKey<T>::with
  38: scoped_tls::ScopedKey<T>::set
  39: syntax::with_globals
query stack during panic:
#0 [adt_destructor] processing `value::Number`
#1 [coherent_trait] coherence checking all impls of trait `std::marker::Copy`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https:/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.35.0-nightly (53f2165c5 2019-04-04) running on x86_64-unknown-linux-gnu

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

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

error: Could not compile `ron`.

To learn more, run the command again with --verbose.

Process finished with exit code 101

Deleting the target directory fixed the error.

@ZacLiveEarth
Copy link

I have found that deleting the target directory does indeed fix the error, but after some time coding the error may return. This information may be useful to rule out the possibility the issue was caused by having something in the target directory from an older nightly build. (If you recall, I had first experienced this issue after upgrading, but now I see the issue when only using rustc 1.35.0-nightly (53f2165c5 2019-04-04) from a clean target directory)

@bjorn3
Copy link
Member Author

bjorn3 commented Apr 6, 2019

Deleting the target directory fixed the error.

Only deleting target/*/incremental is necessary it seems.

@jonas-schievink
Copy link
Contributor

Nominating for discussion since I forgot to do this initially and this seems to have a somewhat high impact

@jonas-schievink jonas-schievink added the A-incr-comp Area: Incremental compilation label May 13, 2019
@pnkfelix
Copy link
Member

triage: P-high, as this does seem to have high impact and resolving it would have similarly high value. Removing nomination tag as I don't think there's much to discuss beyond finding someone to resolve this (as we should do for all unassigned P-high issues).

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels May 16, 2019
@michaelwoerister
Copy link
Member

This should be for by #59723, which already landed a while ago. Could you check if it still reproduces on nightly?

@michaelwoerister michaelwoerister self-assigned this May 16, 2019
@Zoxc
Copy link
Contributor

Zoxc commented May 17, 2019

Duplicate of #59716.

@Zoxc Zoxc closed this as completed May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority 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

7 participants