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 'no entry found for key' in Servo’s style crate #66487

Closed
SimonSapin opened this issue Nov 17, 2019 · 8 comments · Fixed by #66669
Closed

ICE 'no entry found for key' in Servo’s style crate #66487

SimonSapin opened this issue Nov 17, 2019 · 8 comments · Fixed by #66669
Assignees
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Path resolution C-bug Category: This is a bug. 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

@SimonSapin
Copy link
Contributor

Since nightly-2019-11-17. Merges in the regression range:

https://community-tc.services.mozilla.com/tasks/IUGBgA8gSSiAIzFMZWik_Q/runs/0/logs/https%3A%2F%2Fcommunity-tc.services.mozilla.com%2Fapi%2Fqueue%2Fv1%2Ftask%2FIUGBgA8gSSiAIzFMZWik_Q%2Fruns%2F0%2Fartifacts%2Fpublic%2Flogs%2Flive.log#L1459

thread 'rustc' panicked at 'no entry found for key', src/libcore/option.rs:1187:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:84
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:188
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:205
  10: rustc_driver::report_ice
  11: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at /rustc/5c5b8afd80e6fa1d24632153cb2257c686041d41/src/liballoc/boxed.rs:956
  12: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}
             at /rustc/5c5b8afd80e6fa1d24632153cb2257c686041d41/src/libproc_macro/bridge/client.rs:305
  13: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:468
  14: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:373
  15: rust_begin_unwind
             at src/libstd/panicking.rs:302
  16: core::panicking::panic_fmt
             at src/libcore/panicking.rs:82
  17: core::option::expect_failed
             at src/libcore/option.rs:1187
  18: rustc::hir::map::def_collector::DefCollector::collect_field
  19: syntax_expand::expand::AstFragment::visit_with
  20: rustc_resolve::macros::<impl syntax_expand::base::Resolver for rustc_resolve::Resolver>::visit_ast_fragment_with_placeholders
  21: syntax_expand::expand::MacroExpander::collect_invocations
  22: syntax_expand::expand::MacroExpander::fully_expand_fragment
  23: syntax_expand::expand::MacroExpander::expand_crate
  24: rustc_interface::passes::configure_and_expand_inner::{{closure}}
  25: rustc_interface::passes::configure_and_expand_inner
  26: rustc_interface::passes::configure_and_expand::{{closure}}
  27: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  28: rustc_interface::passes::configure_and_expand
  29: rustc_interface::queries::Query<T>::compute
  30: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::expansion
  31: rustc_interface::interface::run_compiler_in_existing_thread_pool
  32: std::thread::local::LocalKey<T>::with
  33: scoped_tls::ScopedKey<T>::set
  34: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.41.0-nightly (5c5b8afd8 2019-11-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C link-args=-fuse-ld=gold --crate-type rlib

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

query stack during panic:
end of query stack
@SimonSapin SimonSapin added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 17, 2019
@SimonSapin
Copy link
Contributor Author

This is not intermittent. I’ve reproduced it locally both in debug and release mode.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. I-nominated 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 Nov 17, 2019
@Mark-Simulacrum
Copy link
Member

Commit bisection points to 5c5b8af, cc @petrochenkov

@dtolnay
Copy link
Member

dtolnay commented Nov 18, 2019

Serde's test suite also hits this ICE. https://travis-ci.org/serde-rs/serde/jobs/613363213

@petrochenkov
Copy link
Contributor

Minimization would be appreciated and may help to get a fix merged sooner.
Otherwise I won't be able to work on this until the weekend.

@petrochenkov petrochenkov self-assigned this Nov 18, 2019
@petrochenkov petrochenkov added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Nov 18, 2019
@jonas-schievink jonas-schievink added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Path resolution labels Nov 18, 2019
@mateon1
Copy link

mateon1 commented Nov 19, 2019

Minified example (From the failing serde test):

enum Foo {
    Bar(
        #[foo]
        #[foo]
        X
    )
}

EDIT: Further minified:

struct Bar(
    #[foo]
    #[foo]
    X
);
$ RUST_BACKTRACE=1 rustc test.rs
thread 'rustc' panicked at 'no entry found for key', src/libcore/option.rs:1187:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:84
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:188
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:205
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:468
  12: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:373
  13: rust_begin_unwind
             at src/libstd/panicking.rs:302
  14: core::panicking::panic_fmt
             at src/libcore/panicking.rs:82
  15: core::option::expect_failed
             at src/libcore/option.rs:1187
  16: rustc::hir::map::def_collector::DefCollector::collect_field
  17: syntax_expand::expand::AstFragment::visit_with
  18: rustc_resolve::macros::<impl syntax_expand::base::Resolver for rustc_resolve::Resolver>::visit_ast_fragment_with_placeholders
  19: syntax_expand::expand::MacroExpander::collect_invocations
  20: syntax_expand::expand::MacroExpander::fully_expand_fragment
  21: syntax_expand::expand::MacroExpander::expand_crate
  22: rustc_interface::passes::configure_and_expand_inner::{{closure}}
  23: rustc_interface::passes::configure_and_expand_inner
  24: rustc_interface::passes::configure_and_expand::{{closure}}
  25: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  26: rustc_interface::passes::configure_and_expand
  27: rustc_interface::queries::Query<T>::compute
  28: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::expansion
  29: rustc_interface::interface::run_compiler_in_existing_thread_pool
  30: std::thread::local::LocalKey<T>::with
  31: scoped_tls::ScopedKey<T>::set
  32: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.41.0-nightly (3e525e3f6 2019-11-18) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

@petrochenkov
Copy link
Contributor

Same ICE on stable:

struct S (
    #[rustfmt::skip]
    #[rustfmt::skip]
    u8
);

fn main() {}

The true source of the ICE is #63468.
#64694 only "unmasked" that ICE for derive helper attributes because they now go through name resolution like other attributes.

@pnkfelix
Copy link
Member

triage: P-high. Removing nomination. Removing E-needs-mcve (I think @petrochenkov 's latest qualifies as such).

@pnkfelix pnkfelix removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Nov 21, 2019
@petrochenkov
Copy link
Contributor

Fixed in #66669.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Path resolution C-bug Category: This is a bug. 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

Successfully merging a pull request may close this issue.

7 participants