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 using new attributes(..) section of #[proc_macro_derive] #37788

Closed
sfackler opened this issue Nov 15, 2016 · 4 comments
Closed

ICE using new attributes(..) section of #[proc_macro_derive] #37788

sfackler opened this issue Nov 15, 2016 · 4 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@sfackler
Copy link
Member

I'm seeing an ICE at this commit: sfackler/rust-postgres-derive@50d93bd

Not sure if it's a derive issue or an issue with that lint - cc @keeperofdakeys

error: internal compiler error: ../src/librustc_metadata/decoder.rs:490: entry: id not found: DefIndex(1) in crate "postgres_derive" with number 12

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: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:424
stack backtrace:
   1:        0x106b7d4ea - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
   2:        0x106b8a77f - std::panicking::default_hook::{{closure}}::h6875a2976258b020
   3:        0x106b8a32d - std::panicking::default_hook::h88ffbc5922643264
   4:        0x106b8ac46 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
   5:        0x10431bf2a - std::panicking::begin_panic::h264cdc75d51b518b
   6:        0x10432cd34 - rustc_errors::Handler::bug::h620f7270292f0095
   7:        0x103690ecc - rustc::session::opt_span_bug_fmt::{{closure}}::h4a9b70c3df8b4b3a
   8:        0x103690cd9 - rustc::session::opt_span_bug_fmt::h7d83586c6e2c7ae6
   9:        0x10369085a - rustc::session::bug_fmt::he2d2f00a4afa9d1e
  10:        0x102bc7b73 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry::h5e3d8114267e9116
  11:        0x102bd04ab - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visibility::h2949b511f18961ee
  12:        0x102bd8f66 - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visible_parent_map::hab53861eb74bce8d
  13:        0x1036da1c4 - rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path::haa7f7a9afda5f72a
  14:        0x1037262d5 - rustc::util::ppaux::parameterized::h7bcfb1fd3d8a947a
  15:        0x10372cde1 - rustc::util::ppaux::<impl core::fmt::Display for rustc::ty::sty::TypeVariants<'tcx>>::fmt::haeadfb9e15605fa1
  16:        0x106bcecb5 - core::fmt::write::h01739b8f12f355f9
  17:        0x106bcfb6d - core::fmt::Formatter::write_fmt::h50f274f007b40806
  18:        0x10372e600 - rustc::util::ppaux::<impl core::fmt::Display for rustc::ty::TyS<'tcx>>::fmt::h996bb925a7d044a6
  19:        0x106bcecb5 - core::fmt::write::h01739b8f12f355f9
  20:        0x106b8df6e - collections::fmt::format::h2e5dd97da45bd3ab
  21:        0x102ee2e65 - rustc_lint::builtin::BoxPointers::check_heap_type::h95cba4228b2cf853
  22:        0x102ee30cb - <rustc_lint::builtin::BoxPointers as rustc::lint::LateLintPass>::check_expr::hcb948f4ae841d1ba
  23:        0x10361b61f - rustc::lint::context::LintContext::with_lint_attrs::h979dbacc7007af3e
  24:        0x1036246ea - <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_fn::h09fb437fbbacb211
  25:        0x103575e88 - rustc::hir::intravisit::walk_impl_item::hef51e524491a11f7
  26:        0x1036159db - rustc::lint::context::LintContext::with_lint_attrs::h69c0c82b5b2484fd
  27:        0x1036234fa - <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item::h6b7c9b9fdd4d4734
  28:        0x103625b9e - <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_block::hf87d7e961ad31ef2
  29:        0x10357a9c1 - rustc::hir::intravisit::walk_expr::hb7389a396e853290
  30:        0x10361b657 - rustc::lint::context::LintContext::with_lint_attrs::h979dbacc7007af3e
  31:        0x1036246ea - <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_fn::h09fb437fbbacb211
  32:        0x103623251 - <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item::h6b7c9b9fdd4d4734
  33:        0x10362579b - <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_mod::h0650ead2ce14ae2d
  34:        0x10362c174 - rustc::lint::context::check_crate::h133ae6a0f266d11d
  35:        0x102481b67 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h97a3a12d948df547
  36:        0x10247b37d - rustc_driver::driver::phase_3_run_analysis_passes::hb0ad9de18d423e67
  37:        0x102462bc5 - rustc_driver::driver::compile_input::h8e119234b60571d5
  38:        0x1024a8229 - rustc_driver::run_compiler::hbdfc4f84e2e0f4b9
  39:        0x1023c7988 - std::panicking::try::do_call::hf679f17bf3b43b0b
  40:        0x106b8d1fa - __rust_maybe_catch_panic
  41:        0x1023ebaaf - <F as alloc::boxed::FnBox<A>>::call_box::h506fb5d7b8891cd4
  42:        0x106b898d4 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
  43:     0x7fff9ac4399c - _pthread_body
  44:     0x7fff9ac43919 - _pthread_start
@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 15, 2016
@keeperofdakeys
Copy link
Contributor

I can confirm that this ICE also happens with my own derive crate, which worked on the original PR that I submitted. So I suspect that another PR may have changed something. However, there are rpass-fulldeps tests, so I'm not sure how this snuck through. Note that the derive crate itself compiles fine, the ICE only happens when compiling a crate which uses a derive crate.

When I get some time, I'll start investigating this. I'm unfamiliar with the code where the panic is happening, but it must be related to my PR somehow.

@SergioBenitez
Copy link
Contributor

Happened upon this bug on a project using Serde:

error: internal compiler error: ../src/librustc_metadata/decoder.rs:490: entry: id not found: DefIndex(1) in crate "serde_derive" with number 41

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: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:424
stack backtrace:
   1:        0x111d774ea - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
   2:        0x111d8477f - std::panicking::default_hook::{{closure}}::h6875a2976258b020
   3:        0x111d8432d - std::panicking::default_hook::h88ffbc5922643264
   4:        0x111d84c46 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
   5:        0x10f508f2a - std::panicking::begin_panic::h264cdc75d51b518b
   6:        0x10f519d34 - rustc_errors::Handler::bug::h620f7270292f0095
   7:        0x10e87fecc - rustc::session::opt_span_bug_fmt::{{closure}}::h4a9b70c3df8b4b3a
   8:        0x10e87fcd9 - rustc::session::opt_span_bug_fmt::h7d83586c6e2c7ae6
   9:        0x10e87f85a - rustc::session::bug_fmt::he2d2f00a4afa9d1e
  10:        0x10ddcab73 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry::h5e3d8114267e9116
  11:        0x10ddd34ab - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visibility::h2949b511f18961ee
  12:        0x10dddbf66 - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visible_parent_map::hab53861eb74bce8d
  13:        0x10e8c91c4 - rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path::haa7f7a9afda5f72a
  14:        0x10e9152d5 - rustc::util::ppaux::parameterized::h7bcfb1fd3d8a947a
  15:        0x111dc8cb5 - core::fmt::write::h01739b8f12f355f9
  16:        0x10e8b1c4c - rustc::traits::specialize::specialization_graph::Graph::insert::h62250bf0632d4218
  17:        0x10e8e5d12 - rustc::ty::trait_def::TraitDef::add_impl_for_specialization::h39896639aba068c7
  18:        0x10dbc6b67 - <rustc_typeck::coherence::overlap::OverlapChecker<'cx, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item::h5ba64bfdace3da91
  19:        0x10dbcfaab - rustc_typeck::coherence::check_coherence::h7b433ad2f4520d1a
  20:        0x10dbd66a1 - rustc_typeck::check_crate::h4045752b69a796e8
  21:        0x10d67e1ac - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h97a3a12d948df547
  22:        0x10d67b37d - rustc_driver::driver::phase_3_run_analysis_passes::hb0ad9de18d423e67
  23:        0x10d662bc5 - rustc_driver::driver::compile_input::h8e119234b60571d5
  24:        0x10d6a8229 - rustc_driver::run_compiler::hbdfc4f84e2e0f4b9
  25:        0x10d5c7988 - std::panicking::try::do_call::hf679f17bf3b43b0b
  26:        0x111d871fa - __rust_maybe_catch_panic
  27:        0x10d5ebaaf - <F as alloc::boxed::FnBox<A>>::call_box::h506fb5d7b8891cd4
  28:        0x111d838d4 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
  29:     0x7fff859de99c - _pthread_body
  30:     0x7fff859de919 - _pthread_start

@jseyfried jseyfried self-assigned this Nov 15, 2016
@jseyfried
Copy link
Contributor

This was caused by #37542 -- I'll fix today.

@jseyfried
Copy link
Contributor

Fixed in #37793.

bors added a commit that referenced this issue Nov 17, 2016
Fix proc macro def ids

Update some `CStore` methods to also work correctly with proc macro def ids.
Fixes #37788.
r? @nrc
This was referenced Nov 18, 2016
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

4 participants