-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Description
Reproduction:
- use nightly rustc (with wasm target installed)
- clone https://github.com/ruffle-rs/ruffle
cd web
cargo build --release --verbose -j1 --target=wasm32-unknown-unknown
Result: under a minute into the build, the compiler hangs when compiling the json
dependency, taking increasingly more memory; after 40s it spiked to 1GB, then 2GB and more. The json
crate is tiny with no dependencies of its own, normally it should take <5s to build.
Weirdly, I cannot reproduce it when building the json
crate's repo on its own, but I may be missing some build configuration difference.
Reproduced on builds starting with nightly-2021-09-26
(rustc 1.57.0-nightly (addb4da68 2021-09-25)
), it works fine on earlier build. Also someone else managed to reproduce this on latest nightly too.
Herschel, torokati44 and Toad06
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Projects
Relationships
Development
Select code repository
Activity
saethlin commentedon Oct 8, 2021
This might be the same bug as in #89524, I see the same sort of behavior. I need to be compiling
toml
as a dependency, not just a version oftoml
that produces the very long build time. I also see some memory growth initially, but it stops at ~0.5 GB. I think the biggest difference is that in #89524 memory growth eventually stops and LLVM does its best to optimize a tremendous amount of IR.Also interesting that we're both seeing this related to parsing crates. I wonder if there's something about them that makes whatever pattern is present more likely.
adrian17 commentedon Nov 18, 2021
Do you think this set of issues could be considered a NewPM (I'm assuming it's NewPM-related) blocker?
I just verified that this reproduces on GH Actions and kills the build: https://github.com/adrian17/ruffle/runs/4253768752?check_suite_focus=true#step:8:291
apiraino commentedon Jan 6, 2022
@adrian17 I'm not 100% sure but I'm thinking if a smaller reproducible would help correlating this to #89524 and - by extension - to the new LLVM 13 pass manager. Do some of the debugging done in #89524 also apply to this issue?
adrian17 commentedon Feb 25, 2022
Looks like this regression is now on stable 1.59.
This makes it impossible to build dependencies for our project locally and on CI, so we'll have to lock version to 1.58 for the time being.
@apiraino sorry, I missed the notification back then; but I didn't investigate this further. (I also don't know how to pass
--debug-pass=Details
)apiraino commentedon Feb 26, 2022
Summarizing here (for SEO purposes) from the linked issues the mitigating flags that make the issue disappear: setting the release build profile
opt-level
!= 3 (mentioned here)[profile.release] panic = "abort" +opt-level = 0 # or 2
or disabling the new LLVM pass manager altogether:
nikic commentedon Mar 7, 2022
It looks like ruffle switched away from
json
in the meantime, so this also needs agit checkout fa459f7547e0d13c97394108ed0051956a92a1da
now. It also looks like this reproduced with stable but not nightly -- probably the LLVM 14 upgrade perturbed things enough that it doesn't happen anymore. (The root issue still exists though.)nikic commentedon Mar 10, 2022
This is supposed to be fixed by #94764, but as mentioned above, I already couldn't reproduce this on nightly before that, so I can't verify whether this specific instance of the problem has been addressed.
If someone still sees hangs with the new pass manager, please let me know.