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 in _match.rs:1184:21 when building "gfx-backend-metal" on Nightly #72467

Closed
kvark opened this issue May 22, 2020 · 10 comments
Closed

ICE in _match.rs:1184:21 when building "gfx-backend-metal" on Nightly #72467

kvark opened this issue May 22, 2020 · 10 comments
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections O-macos Operating system: macOS 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

@kvark
Copy link
Contributor

kvark commented May 22, 2020

We are seeing a new ICE on macOS/Nightly: https://github.com/gfx-rs/wgpu-native/runs/700057380

Meta

rustc 1.45.0-nightly (9310e3bd4 2020-05-21)

Backtrace:

2020-05-22T15:48:09.2856440Z thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustc_mir_build/hair/pattern/_match.rs:1184:21
2020-05-22T15:48:09.2859080Z stack backtrace:
2020-05-22T15:48:09.4938590Z    0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
2020-05-22T15:48:09.4942910Z    1: core::fmt::write
2020-05-22T15:48:09.4952680Z    2: std::io::Write::write_fmt
2020-05-22T15:48:09.4953030Z    3: std::panicking::default_hook::{{closure}}
2020-05-22T15:48:09.5054570Z    4: std::panicking::default_hook
2020-05-22T15:48:09.5155760Z    5: rustc_driver::report_ice
2020-05-22T15:48:09.5172590Z    6: std::panicking::rust_panic_with_hook
2020-05-22T15:48:09.5173000Z    7: rust_begin_unwind
2020-05-22T15:48:09.5173420Z    8: core::panicking::panic_fmt
2020-05-22T15:48:09.5173790Z    9: core::panicking::panic_bounds_check
2020-05-22T15:48:09.5174910Z   10: rustc_mir_build::hair::pattern::_match::Fields::replace_with_fieldpats
2020-05-22T15:48:09.5175400Z   11: rustc_mir_build::hair::pattern::_match::PatStack::specialize_constructor
2020-05-22T15:48:09.5175790Z   12: rustc_mir_build::hair::pattern::_match::is_useful_specialized
2020-05-22T15:48:09.5176130Z   13: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
2020-05-22T15:48:09.5176540Z   14: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5176870Z   15: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5177250Z   16: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5177670Z   17: rustc_mir_build::hair::pattern::_match::is_useful_specialized
2020-05-22T15:48:09.5178050Z   18: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
2020-05-22T15:48:09.5178420Z   19: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5178750Z   20: rustc_mir_build::hair::pattern::check_match::check_not_useful
2020-05-22T15:48:09.5179140Z   21: <rustc_mir_build::hair::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
2020-05-22T15:48:09.5179540Z   22: <rustc_mir_build::hair::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
2020-05-22T15:48:09.5179930Z   23: rustc_mir_build::hair::pattern::check_match::check_match
2020-05-22T15:48:09.5180310Z   24: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_match>::compute
2020-05-22T15:48:09.5180700Z   25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
2020-05-22T15:48:09.5181080Z   26: rustc_data_structures::stack::ensure_sufficient_stack
2020-05-22T15:48:09.5181460Z   27: rustc_query_system::query::plumbing::get_query_impl
2020-05-22T15:48:09.5181780Z   28: rustc_query_system::query::plumbing::ensure_query_impl
2020-05-22T15:48:09.5182150Z   29: rustc_session::utils::<impl rustc_session::session::Session>::time
2020-05-22T15:48:09.5182740Z   30: rustc_session::utils::<impl rustc_session::session::Session>::time
2020-05-22T15:48:09.5183130Z   31: rustc_interface::passes::analysis
2020-05-22T15:48:09.5183510Z   32: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
2020-05-22T15:48:09.5184600Z   33: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
2020-05-22T15:48:09.5184980Z   34: rustc_query_system::query::plumbing::get_query_impl
2020-05-22T15:48:09.5185360Z   35: rustc_middle::ty::context::tls::enter_global
2020-05-22T15:48:09.5185690Z   36: rustc_interface::interface::run_compiler_in_existing_thread_pool
2020-05-22T15:48:09.5186050Z   37: scoped_tls::ScopedKey<T>::set
2020-05-22T15:48:09.5186410Z   38: rustc_ast::attr::with_globals
2020-05-22T15:48:09.5186760Z note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2020-05-22T15:48:09.5187040Z 
2020-05-22T15:48:09.5187400Z error: internal compiler error: unexpected panic
2020-05-22T15:48:09.5187710Z 
2020-05-22T15:48:09.5188010Z note: the compiler unexpectedly panicked. this is a bug.
2020-05-22T15:48:09.5188330Z 
2020-05-22T15:48:09.5189640Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2020-05-22T15:48:09.5190010Z 
2020-05-22T15:48:09.5190810Z note: rustc 1.45.0-nightly (9310e3bd4 2020-05-21) running on x86_64-apple-darwin
2020-05-22T15:48:09.5191130Z 
2020-05-22T15:48:09.5191900Z note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --crate-type lib
2020-05-22T15:48:09.5192280Z 
2020-05-22T15:48:09.5192600Z note: some of the compiler flags provided by cargo are hidden
2020-05-22T15:48:09.5192870Z 
2020-05-22T15:48:09.5193200Z query stack during panic:
2020-05-22T15:48:09.5193530Z #0 [check_match] processing `soft::Own::own_render`
2020-05-22T15:48:09.5194200Z #1 [analysis] running analysis passes on this crate
2020-05-22T15:48:09.5194640Z end of query stack
2020-05-22T15:48:09.5521870Z error: could not compile `gfx-backend-metal`.
@kvark kvark added the C-bug Category: This is a bug. label May 22, 2020
@Elinvynia Elinvynia added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 22, 2020
@jonas-schievink jonas-schievink added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. 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. A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels May 22, 2020
@ecstatic-morse
Copy link
Contributor

ecstatic-morse commented May 22, 2020

cc @Nadrieril, who wrote replace_with_fieldpats.

@Nadrieril
Copy link
Member

Hmm, I can't figure out what might have gone wrong by just looking at it. I'll try to reduce it over the weekend if no one beats me to it. If it helps, the ICE comes from pattern-matching, and uninhabited types might be involved.

@Nadrieril
Copy link
Member

This only appears on MacOS and I've been unable to get the right cross-compilation magic going on my Linux machine :(

@spastorino
Copy link
Member

We need to bisect and find an mcve.

@rustbot ping cleanup

@rustbot rustbot added the ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections label May 27, 2020
@rustbot
Copy link
Collaborator

rustbot commented May 27, 2020

Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3

cc @AminArria @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke

@spastorino
Copy link
Member

Assigning P-high as discussed as part of the Prioritization Working Group process and removing I-prioritize.

@spastorino spastorino added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 27, 2020
@Nadrieril
Copy link
Member

As mentioned in #72506, I expect that PR to fix this issue. I think it'd make sense to wait for #72506 to be merged before investing too much effort here.

bors added a commit to rust-lang-ci/rust that referenced this issue May 29, 2020
Exhaustiveness checking: work around type normalization issues

This should resolve rust-lang#72476 and probably rust-lang#72467.
This is a bit hacky but that's actually what the code was doing before rust-lang#71930. I'm essentially reverting rust-lang@e5a2cd5. So despite being hacky, it's been tried and tested (so much so that code relies on it now x)).
Only the third commit does anything interesting.
@SimonSapin
Copy link
Contributor

SimonSapin commented May 30, 2020

@Nadrieril
Copy link
Member

@kvark Can you confirm this is fixed for you on latest nightly?

@kvark
Copy link
Contributor Author

kvark commented May 30, 2020

Looks to be passing now, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections O-macos Operating system: macOS 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

8 participants