Closed
Description
I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=02201e00b6564bb0149acccfdf698b9d
I expected to see this happen: Compiles or have some error.
Instead, this happened: Compile won't finish for ever. Commenting out the final line will make it work.
Meta
I tried in my environment and Rust Playground.
rustc --version --verbose
:
rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1
Backtrace
I couldn't get the backtace.
With cargo +nightly rustc --bin symbolic-diffs -- -Z time-passes
I got below.
time: 0.000; rss: 65MB -> 65MB ( +0MB) parse_crate
time: 0.000; rss: 65MB -> 65MB ( +0MB) attributes_injection
time: 0.001; rss: 65MB -> 65MB ( +0MB) incr_comp_prepare_session_directory
time: 0.000; rss: 65MB -> 65MB ( +0MB) incr_comp_garbage_collect_session_directories
time: 0.000; rss: 65MB -> 65MB ( +0MB) recursion_limit
time: 0.000; rss: 65MB -> 65MB ( +0MB) plugin_loading
time: 0.000; rss: 65MB -> 65MB ( +0MB) plugin_registration
time: 0.000; rss: 74MB -> 74MB ( +0MB) crate_injection
time: 0.006; rss: 76MB -> 95MB ( +19MB) expand_crate
time: 0.000; rss: 95MB -> 95MB ( +0MB) check_unused_macros
time: 0.006; rss: 76MB -> 95MB ( +19MB) macro_expand_crate
time: 0.000; rss: 95MB -> 95MB ( +0MB) maybe_building_test_harness
time: 0.000; rss: 95MB -> 95MB ( +0MB) AST_validation
time: 0.000; rss: 95MB -> 95MB ( +0MB) maybe_create_a_macro_crate
time: 0.000; rss: 95MB -> 95MB ( +0MB) finalize_imports
time: 0.000; rss: 95MB -> 96MB ( +2MB) finalize_macro_resolutions
time: 0.002; rss: 96MB -> 97MB ( +1MB) late_resolve_crate
time: 0.000; rss: 97MB -> 97MB ( +0MB) resolve_check_unused
time: 0.000; rss: 97MB -> 97MB ( +0MB) resolve_report_errors
time: 0.000; rss: 97MB -> 97MB ( +0MB) resolve_postprocess
time: 0.002; rss: 95MB -> 97MB ( +3MB) resolve_crate
time: 0.000; rss: 97MB -> 97MB ( +0MB) complete_gated_feature_checking
time: 0.009; rss: 67MB -> 97MB ( +30MB) configure_and_expand
time: 0.000; rss: 97MB -> 97MB ( +0MB) prepare_outputs
time: 0.000; rss: 97MB -> 97MB ( +0MB) blocked_on_dep_graph_loading
time: 0.001; rss: 98MB -> 99MB ( +1MB) hir_lowering
time: 0.000; rss: 99MB -> 99MB ( +0MB) early_lint_checks
time: 0.000; rss: 101MB -> 104MB ( +2MB) setup_global_ctxt
time: 0.001; rss: 99MB -> 104MB ( +5MB) create_global_ctxt
time: 0.000; rss: 104MB -> 107MB ( +4MB) looking_for_entry_point
time: 0.000; rss: 107MB -> 107MB ( +0MB) looking_for_plugin_registrar
time: 0.000; rss: 107MB -> 107MB ( +0MB) looking_for_derive_registrar
time: 0.002; rss: 104MB -> 111MB ( +7MB) misc_checking_1
time: 0.001; rss: 111MB -> 111MB ( +0MB) type_collecting
time: 0.000; rss: 111MB -> 111MB ( +0MB) impl_wf_inference
time: 0.000; rss: 114MB -> 114MB ( +0MB) unsafety_checking
time: 0.000; rss: 114MB -> 114MB ( +0MB) orphan_checking
time: 0.001; rss: 111MB -> 114MB ( +3MB) coherence_checking
time: 0.001; rss: 114MB -> 114MB ( +0MB) wf_checking
time: 0.005; rss: 114MB -> 117MB ( +3MB) item_types_checking
time: 0.004; rss: 117MB -> 119MB ( +2MB) item_bodies_checking
time: 0.012; rss: 111MB -> 119MB ( +8MB) type_check_crate
time: 0.001; rss: 119MB -> 119MB ( +0MB) match_checking
time: 0.001; rss: 119MB -> 119MB ( +0MB) liveness_and_intrinsic_checking
time: 0.002; rss: 119MB -> 119MB ( +0MB) misc_checking_2
time: 0.002; rss: 119MB -> 121MB ( +2MB) MIR_borrow_checking
time: 0.000; rss: 121MB -> 121MB ( +0MB) MIR_effect_checking
time: 0.000; rss: 121MB -> 121MB ( +0MB) layout_testing
time: 0.000; rss: 121MB -> 121MB ( +0MB) death_checking
time: 0.000; rss: 121MB -> 121MB ( +0MB) unused_lib_feature_checking
time: 0.014; rss: 121MB -> 148MB ( +27MB) crate_lints
time: 0.000; rss: 148MB -> 148MB ( +0MB) module_lints
time: 0.015; rss: 121MB -> 148MB ( +27MB) lint_checking
time: 0.001; rss: 148MB -> 148MB ( +0MB) privacy_checking_modules
time: 0.017; rss: 121MB -> 148MB ( +27MB) misc_checking_3
time: 0.000; rss: 148MB -> 148MB ( +0MB) monomorphization_collector_root_collections
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
SNCPlay42 commentedon Apr 11, 2021
Compilation terminates on 1.46 with an error:
@rustbot label I-hang regression-from-stable-to-stable
Frizi commentedon Apr 11, 2021
I've managed to reduce the example code significantly, while still triggering what I believe to be a root issue.
playground link
The error is now about recursion limit while performing drop check.
In order to get back to the original issue (compilation not terminating in reasonable time), more generic arguments have to be added to the
Wrapper
type, then creating more elaboratedyn Wrapable
instance insidedyn_wrap
body. In original code, those are all differentSymbol
types.Then compiler seems to be generating permutations of those impls with infinite depth. Looks like those permutations are causing way slower approach to the depth limit, thus making the compilation not terminate quickly.
SNCPlay42 commentedon Apr 11, 2021
Using this slight reduction, which still hangs:
Bisected using a 30 second timeout:
Regression in nightly-2020-09-19
found 8 bors merge commits in the specified range
commit[0] 2020-09-17UTC: Auto merge of 76645 - fusion-engineering-forks:windows-lock, r=kennytm
commit[1] 2020-09-18UTC: Auto merge of 76790 - ssomers:btree_slice_slasher_returns, r=Mark-Simulacrum
commit[2] 2020-09-18UTC: Auto merge of 76854 - aDotInTheVoid:mir-opt-32-64-diff-name, r=oli-obk
commit[3] 2020-09-18UTC: Auto merge of 76837 - wesleywiser:disable_consideredequal, r=oli-obk
commit[4] 2020-09-18UTC: Auto merge of 72412 - VFLashM:issue-72408-nested-closures-exponential, r=tmandry
commit[5] 2020-09-18UTC: Auto merge of 76575 - lcnr:abstract-const, r=oli-obk
commit[6] 2020-09-18UTC: Auto merge of 76884 - Mark-Simulacrum:fix-macos-ci, r=pietroalbini
commit[7] 2020-09-18UTC: Auto merge of 76782 - lzutao:rd-cap, r=jyn514
ERROR: no commits between f3c923a and bbc6774 within last 167 days
Of these, only #76837 and #72412 landed in 1.47 (as backports), which is the stable version that regressed.
GDB backtrace of the hang
apiraino commentedon Apr 15, 2021
Assigning priority as discussed as part of the Prioritization Working Group procedure and removing
I-prioritize
.@rustbot label -I-prioritize +P-medium
b-naber commentedon Apr 22, 2021
This was fixed in #83406
JohnTitor commentedon Jun 13, 2021
Closing as fixed (backporting was suggested but it didn't happen while it was on nightly).