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 in 1.30 and 1.31 #55846

Closed
daniel-fontaine opened this issue Nov 10, 2018 · 11 comments
Closed

Internal Compiler Error in 1.30 and 1.31 #55846

daniel-fontaine opened this issue Nov 10, 2018 · 11 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@daniel-fontaine
Copy link

daniel-fontaine commented Nov 10, 2018

This library compiled without issue in rust versions prior to 1.30.

error: internal compiler error: broken MIR in DefId(0/0:1339 ~ zeta[1bd0]::cp[0]::solver[0]::sequential[0]::{{impl}}[1]::with_search[0]) (const cp::solver::CPSolver::with_heuristic): bad constant user type Canonical { variables: [], value: fn(std::sync::Arc<modeling::Model>, cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>, F>) -> cp::solver::sequential::CPSequentialSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<<cp::solver::backtracking::copying::CopyingBacktracker as cp::solver::backtracking::Backtracker>::Node>>, F>> {<cp::solver::sequential::CPSequentialSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<<cp::solver::backtracking::copying::CopyingBacktracker as cp::solver::backtracking::Backtracker>::Node>>, F>> as cp::solver::CPSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>, F>>>::with_heuristic} } vs fn(std::sync::Arc<modeling::Model>, cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>, F>) -> cp::solver::sequential::CPSequentialSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>, F>> {<cp::solver::sequential::CPSequentialSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>, F>> as cp::solver::CPSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>, F>>>::with_heuristic}: NoSolution
  --> src/cp/solver/sequential.rs:70:9                                                                                                                                                        
   |                                                                                                                                                                                          
70 | /         <Self as CPSolver<CustomSearchFactory<CPWorker<B, C>, F>>>                                                                                                                     
71 | |             ::with_heuristic(model, heur)                                                                                                                                              
   | |____________________________^                                                                                                                                                           
                                                                                                                                                                                              
error: internal compiler error: broken MIR in DefId(0/0:1385 ~ zeta[1bd0]::cp[0]::solver[0]::parallel[0]::{{impl}}[1]::with_search[0]) (const cp::solver::CPSolver::with_heuristic): bad constant user type Canonical { variables: [], value: fn(std::sync::Arc<modeling::Model>, cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<cp::solver::backtracking::copying::CPCopyingSearchNode, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>>, F>) -> cp::solver::parallel::CPParallelSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<<cp::solver::backtracking::copying::CopyingBacktracker as cp::solver::backtracking::Backtracker>::Node, cp::search::core_controllers::DFSController<<cp::solver::backtracking::copying::CopyingBacktracker as cp::solver::backtracking::Backtracker>::Node>>>, F>> {<cp::solver::parallel::CPParallelSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<<cp::solver::backtracking::copying::CopyingBacktracker as cp::solver::backtracking::Backtracker>::Node, cp::search::core_controllers::DFSController<<cp::solver::backtracking::copying::CopyingBacktracker as cp::solver::backtracking::Backtracker>::Node>>>, F>> as cp::solver::CPSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<cp::solver::backtracking::copying::CPCopyingSearchNode, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>>, F>>>::with_heuristic} } vs fn(std::sync::Arc<modeling::Model>, cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<cp::solver::backtracking::copying::CPCopyingSearchNode, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>>, F>) -> cp::solver::parallel::CPParallelSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<cp::solver::backtracking::copying::CPCopyingSearchNode, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>>, F>> {<cp::solver::parallel::CPParallelSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<cp::solver::backtracking::copying::CPCopyingSearchNode, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>>, F>> as cp::solver::CPSolver<cp::search::builder::CustomSearchFactory<cp::solver::kernel::worker::CPWorker<cp::solver::backtracking::copying::CopyingBacktracker, cp::search::core_controllers::ParallelAdapter<cp::solver::backtracking::copying::CPCopyingSearchNode, cp::search::core_controllers::DFSController<cp::solver::backtracking::copying::CPCopyingSearchNode>>>, F>>>::with_heuristic}: NoSolution
  --> src/cp/solver/parallel.rs:76:9                                                                                                                                                          
   |                                                                                                                                                                                          
76 | /         <Self as CPSolver<CustomSearchFactory<CPWorker<B, C>, F>>>                                                                                                                     
77 | |             ::with_heuristic(model, heur)                                                                                                                                              
   | |____________________________^                                                                                                                                                           
                                                                                                                                                                                              
thread 'main' panicked at 'no errors encountered even though `delay_span_bug` issued', librustc_errors/lib.rs:322:17                                                                          
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.30.1 (1433507eb 2018-11-07) running on x86_64-unknown-linux-gnu                                                                                                                 
                                                                                                                                                                                              
note: compiler flags: -C opt-level=3 --crate-type lib                                                                                                                                         
                                                                                                                                                                                              
note: some of the compiler flags provided by cargo are hidden 
@zackmdavis zackmdavis added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 10, 2018
@pietroalbini
Copy link
Member

Uh, this looks like a regression. What's the library?

@pietroalbini pietroalbini added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Nov 10, 2018
@daniel-fontaine
Copy link
Author

daniel-fontaine commented Nov 10, 2018 via email

@pietroalbini
Copy link
Member

Can you reduce the bug to a subset of the library you can publish? Unfortunately it's hard for us to investigate an error without the code that's causing it.

cc @rust-lang/compiler

@daniel-fontaine
Copy link
Author

daniel-fontaine commented Nov 10, 2018 via email

@eddyb
Copy link
Member

eddyb commented Nov 10, 2018

@nikomatsakis @oli-obk This looks like either trait system or const-evaluation.

@daniel-fontaine
Copy link
Author

daniel-fontaine commented Nov 11, 2018 via email

@daniel-fontaine
Copy link
Author

Below is a rust file with the error.

compiler_error.txt

@estebank
Copy link
Contributor

estebank commented Nov 11, 2018

No longer repros in beta or nightly, present in stable. Would it be reasonable to backport the fix (once we identify it) to stable?

@estebank estebank added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 11, 2018
@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 11, 2018
@pnkfelix
Copy link
Member

Identifying the nightly where this was fixed via bissection would be a good start to determining what fixed it (and thus evaluating whether a backport to stable is reasonable). But a problem has to meet a pretty high bar to justify a backport to the stable channel... a rare ICE may not cut it

@nagisa nagisa added the E-help-wanted Call for participation: Help is requested to fix this issue. label Nov 22, 2018
@varkor varkor added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Nov 22, 2018
@varkor
Copy link
Member

varkor commented Nov 22, 2018

This is now fixed, but we need to make sure it won't regress in the future. Currently the test case is quite large: #55846 (comment). If someone wants to fix this, you just need to try to find the smallest test case you can that still fails on the current version of stable and add it to the test suite in src/test/ui.

@pnkfelix
Copy link
Member

triage. Since this fixed and just needs a test, tagging as P-medium.

@pnkfelix pnkfelix added the P-medium Medium priority label Nov 29, 2018
aelred added a commit to aelred/rust that referenced this issue Dec 10, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Dec 10, 2018
Add regression test for ICE

Fixes rust-lang#55846 with a minimal (or as best as I can manage) test case. I tested this against 1.30.0 manually to confirm it crashes.

The issue seemed to have something to do with associated types. It's possible someone with more knowledge can shrink the test case down further, or make it clearer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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