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

Internal compiler error: unexpected panic #55186

Closed
gibsond opened this issue Oct 18, 2018 · 4 comments
Closed

Internal compiler error: unexpected panic #55186

gibsond opened this issue Oct 18, 2018 · 4 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@gibsond
Copy link

gibsond commented Oct 18, 2018

Hello,

I apologize up front if I am raising this issue incorrectly. The compiler says it would appreciate a bug report. Below is what it printed out:

hread 'main' panicked at 'cannot access a scoped thread local variable without calling `set` first', /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:186:9
note: Run with `RUST_BACKTRACE=1` for 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/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.29.2 (17a9dc751 2018-10-05) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `state2_test`.
To learn more, run the command again with --verbose.

It happened, for the first time, when declaring a reference in a function:

let ref tok_prediction:HashSet<u16>;

and then assigning it in each branch of an if condition:
if is_data {
tok_prediction = &self.data_predictions;
} else {
tok_prediction = &self.next_cwa.1;
}
if tok_prediction.contains(&cwa) {

};

It does not always fail on a cargo build, but generally will fail after a cargo clean, cargo build.
It generally always fails on a cargo build --release.

Let me know if this issue report is acceptable,
Daniel Gibson

@Centril Centril added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 18, 2018
@ExpHP
Copy link
Contributor

ExpHP commented Oct 18, 2018

I deleted some of my earlier replies which were incorrect. As the OP reports, the issue is transient and difficult to reproduce. I noticed that the ICE occurs on the playground in stable yet not in beta or nightly... but then when I tried on my local machine, compilers from all three channels handle it fine.

(note: one of the deleted posts asked the OP to try the beta compiler)

Here is a backtrace procured from the playground.

thread 'main' panicked at 'cannot access a scoped thread local variable without calling `set` first', /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:186:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:479
   6: std::panicking::begin_panic
   7: <scoped_tls::ScopedKey<T>>::with
   8: syntax_pos::<impl syntax_pos::span_encoding::Span>::macro_backtrace
   9: rustc_errors::emitter::EmitterWriter::fix_multispan_in_std_macros
  10: <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit
  11: rustc_errors::Handler::emit_db
  12: <rustc_errors::Handler as core::ops::drop::Drop>::drop
  13: core::ptr::drop_in_place
  14: core::ptr::drop_in_place
  15: core::ptr::drop_in_place
  16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  17: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  18: rustc_driver::run
  19: rustc_driver::main
  20: std::rt::lang_start::{{closure}}
  21: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  22: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  23: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  24: main
  25: __libc_start_main
  26: <unknown>
query stack during panic:
end of query stack

@ExpHP
Copy link
Contributor

ExpHP commented Oct 18, 2018

Hmmm, maybe this WAS fixed: #53469 (seemingly completely different issue, but look at the error and backtrace)

@gibsond
Copy link
Author

gibsond commented Oct 18, 2018

As requested, I tried it with +beta and so far I have not been able to reproduce the problem.

Daniel Gibson

@gibsond
Copy link
Author

gibsond commented Oct 29, 2018

Appears fixed on rustc 1.30.0

@gibsond gibsond closed this as completed Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants