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: Trying to create type name for unexpected type [debuginfo] #58945

Closed
magnet opened this issue Mar 5, 2019 · 12 comments
Labels
A-async-await Area: Async & Await A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) AsyncAwait-Polish Async-await issues that are part of the "polish" area 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.

Comments

@magnet
Copy link

magnet commented Mar 5, 2019

I get this ICE since nightly-2019-03-03 (until nightly-2019-03-05, i.e today's nightly). I can't test on earlier nightlies due to compilation errors on 3rd party crates but the same unchanged code worked fine on nightlies from early February (the only differences are updates to tokio and futures-preview to adapt to recent changes to the task API).

mysql_async is from the mysql_async crate, version 0.17.2. The same unchanged version used to compile and run fine.

error: internal compiler error: src/librustc_codegen_llvm/debuginfo/type_names.rs:176: debuginfo: Trying to create type name for unexpected type: impl mysql_async::MyFuture<mysql_async::conn::Conn>


thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
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_codegen_llvm::debuginfo::type_names::push_debuginfo_type_name
  15: rustc_codegen_llvm::debuginfo::type_names::push_debuginfo_type_name::push_type_params
  16: rustc_codegen_llvm::debuginfo::type_names::push_debuginfo_type_name
  17: rustc_codegen_llvm::debuginfo::metadata::type_metadata
  18: rustc_codegen_llvm::debuginfo::<impl rustc_codegen_ssa::traits::debuginfo::DebugInfoBuilderMethods<'tcx> for rustc_codegen_llvm::builder::Builder<'a, 'll, 'tcx>>::declare_local
  19: core::iter::traits::iterator::Iterator::fold::{{closure}}
  20: <core::iter::adapters::Map<I, F> as core::iter::traits::iterator::Iterator>::fold
  21: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  22: rustc_codegen_ssa::mir::codegen_mir
  23: rustc_codegen_ssa::base::codegen_instance
  24: rustc_codegen_ssa::mono_item::MonoItemExt::define
  25: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  26: rustc::dep_graph::graph::DepGraph::with_task
  27: rustc_codegen_llvm::base::compile_codegen_unit
  28: rustc_codegen_ssa::base::codegen_crate
  29: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  30: rustc::util::common::time
  31: rustc_driver::driver::phase_4_codegen
  32: <std::thread::local::LocalKey<T>>::with
  33: rustc::ty::context::TyCtxt::create_and_enter
  34: rustc_driver::driver::compile_input
  35: rustc_driver::run_compiler_with_pool
  36: <scoped_tls::ScopedKey<T>>::set
  37: rustc_driver::run_compiler
  38: syntax::with_globals
  39: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  40: <F as alloc::boxed::FnBox<A>>::call_box
  41: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/a9da8fc9c267c08cfdb8cf5b39da14f154d12939/src/liballoc/boxed.rs:759
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:80
  42: start_thread
  43: __clone
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.35.0-nightly (a9da8fc9c 2019-03-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
@jonas-schievink jonas-schievink added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) 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. C-bug Category: This is a bug. labels Mar 5, 2019
@jonas-schievink
Copy link
Contributor

Are you saying this happens when compiling mysql_async, or is this happening in another codebase? Are you using async/await?

cc @Nemo157, this might be related to #58888

@magnet magnet changed the title internal compiler error: Trying to create type name for unexpected type internal compiler error: Trying to create type name for unexpected type [debuginfo] Mar 5, 2019
@magnet
Copy link
Author

magnet commented Mar 5, 2019

That happens with another codebase using mysql_async. I am using async/await though I am not sure it's related here.
Since it's a debuginfo issue, there's no ICE when compiling with --release. When doing so, I get to the same compilation errors that happen with nightly-2019-03-02. It would seem the ICE results from commits between nightly-2019-03-02 and nightly-2019-03-03.

@jonas-schievink jonas-schievink added the A-async-await Area: Async & Await label Mar 5, 2019
@nikomatsakis
Copy link
Contributor

@Nemo157 this looks vaguely similar to #58888, any chance that your fix might apply here? Can you easily test?

@nikomatsakis nikomatsakis added the AsyncAwait-Polish Async-await issues that are part of the "polish" area label Mar 5, 2019
@nikomatsakis
Copy link
Contributor

I'm marking this as Blocking -- it seems like it could be pretty bad. If @Nemo157's PR fixes it, great! If not, we should try to reduce this to a standalone example or at least try to understand what's going on here.

@magnet
Copy link
Author

magnet commented Mar 5, 2019

For the record I fixed the unrelated compilation errors and confirm my code builds (and runs fine!) with nightly-2019-03-02. The ICE starts at nightly-2019-03-03.

@nikomatsakis
Copy link
Contributor

@magnet if you are able to bisect with cargo-bisect-rustc, that'd be great!

@magnet
Copy link
Author

magnet commented Mar 5, 2019

@nikomatsakis Cool, I will try! :)

@nikomatsakis
Copy link
Contributor

In particular, that should be able to narrow it down to a PR

@magnet
Copy link
Author

magnet commented Mar 5, 2019

searched toolchains f3730f9 through 7dbba3d
regression in 9cfed5d

@Nemo157
Copy link
Member

Nemo157 commented Mar 5, 2019

This looks like it should be fixed by #58906 as well then.

@magnet
Copy link
Author

magnet commented Mar 10, 2019

I confirm the latest nightly where #58906 has been merged fixes the issue. 👍

@nikomatsakis
Copy link
Contributor

going to close this as fixed then, thanks @magnet !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) AsyncAwait-Polish Async-await issues that are part of the "polish" area 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.
Projects
None yet
Development

No branches or pull requests

4 participants