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

ICE with incremental compiling when renaming variable #57692

Closed
hellow554 opened this issue Jan 17, 2019 · 5 comments
Closed

ICE with incremental compiling when renaming variable #57692

hellow554 opened this issue Jan 17, 2019 · 5 comments
Assignees
Labels
A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@hellow554
Copy link
Contributor

Consider this code

fn foo() {
    static map: u64 = 0;
}

Because the compiler complained, that map should be ALL_UPPERCASE, I renamed the variable to MAP and it ICEs.

Steps to reproduce:

  1. create a new cargo project (doesn't matter if lib or main)
  2. Use the snippet above
  3. cargo build
  4. change the case of any/all letters of map (e.g. change it to MAP)
  5. cargo build
  6. 💥
error: internal compiler error: src/librustc/dep_graph/graph.rs:610: DepNode Hir(1ab623b223f48ebe-bfb096ebac3aaa81) should have been pre-allocated but wasn't.

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:588: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:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   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::dep_graph::graph::DepGraph::try_mark_green
  15: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
  16: rustc::session::Session::track_errors
  17: rustc::util::common::time
  18: rustc_typeck::check_crate
  19: <std::thread::local::LocalKey<T>>::with
  20: rustc::ty::context::TyCtxt::create_and_enter
  21: rustc_driver::driver::compile_input
  22: rustc_driver::run_compiler_with_pool
  23: <scoped_tls::ScopedKey<T>>::set
  24: rustc_driver::run_compiler
  25: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
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://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-nightly (ceb251214 2019-01-16) 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

Was introduced at nightly-2019-01-14 so some of the commits between 75a369c...2fadb0a are to blame

@hellow554
Copy link
Contributor Author

Maybe 69d18a3 ? @Zoxc

@Zoxc Zoxc added the A-incr-comp Area: Incremental compilation label Jan 17, 2019
@Zoxc
Copy link
Contributor

Zoxc commented Jan 17, 2019

cc @michaelwoerister

@Centril Centril added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 17, 2019
@michaelwoerister michaelwoerister added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 17, 2019
@michaelwoerister
Copy link
Member

Thanks for the bug report, @hellow554! That commit certainly could have caused this. I'll try to reproduce.

@michaelwoerister
Copy link
Member

Looks like this is an existing bug that was just uncovered by @Zoxc's PR. This should be dep_dep_node instead of dep_node here:

if dep_node.extract_def_id(tcx).is_none() {

I'll have a PR ready soon.

@pnkfelix
Copy link
Member

triage: P-high. Assigning to @michaelwoerister

@pnkfelix pnkfelix added the P-high High priority label Jan 17, 2019
Centril added a commit to Centril/rust that referenced this issue Jan 18, 2019
Fix typo bug in DepGraph::try_mark_green().

r? @Zoxc

Fixes rust-lang#57692.
Centril added a commit to Centril/rust that referenced this issue Jan 18, 2019
Fix typo bug in DepGraph::try_mark_green().

r? @Zoxc

Fixes rust-lang#57692.
Centril added a commit to Centril/rust that referenced this issue Jan 19, 2019
Fix typo bug in DepGraph::try_mark_green().

r? @Zoxc

Fixes rust-lang#57692.
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 I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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

5 participants