Uh oh!
There was an error while loading. Please reload this page.
Ensure stack when type checking and building MIR for large if expressions - #74708
Conversation
rust-highfive
commented
Jul 24, 2020
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
davidtwco
commented
Jul 24, 2020
@bors r+ |
bors
commented
Jul 24, 2020
📌 Commit f64e58c has been approved by |
Ensure stack when type checking and building MIR for large if expressions Fixesrust-lang#74564
mati865
commented
Jul 24, 2020
Is is safe for rollups, perf wise? |
davidtwco
commented
Jul 24, 2020
I'm not sure, I'd assume so? |
mati865
commented
Jul 24, 2020
Docs are not that convincing 😅:
|
JohnTitor
commented
Jul 24, 2020
Failed in rollup: #74719 (comment) |
kanru
commented
Jul 25, 2020
Hmm, the test passed locally on my machine. I wonder what makes the rollup to fail 🤔 |
JohnTitor
commented
Jul 25, 2020
@kanru I can reproduce the failure on my local, you should rebase. |
kanru
commented
Jul 25, 2020
I can reproduce with stage 2. Investigating... |
davidtwco
commented
Jul 26, 2020
@bors r+ |
bors
commented
Jul 26, 2020
📌 Commit 0e2ec8c has been approved by |
davidtwco
commented
Jul 26, 2020
@bors rollup=never (in case there is a perf impact) |
bors
commented
Jul 26, 2020
bors
commented
Jul 27, 2020
☀️ Test successful - checks-actions, checks-azure |
In Fedora, when we built rustc with PGO on ppc64le, we started failing the test `issue-74564-if-expr-stack-overflow.rs`. This could also be reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so it's probably just unlucky that ppc64le PGO created a large stack frame somewhere in this recursion path. Adding an `ensure_sufficient_stack` solves the stack overflow. Historically, that test and its fix were added in rust-lang#74708, which was also an `ensure_sufficient_stack` in this area of code at the time. However, the refactor in rust-lang#92573 basically left that to the general `MutVisitor`, and then rust-lang#142240 removed even that ensure call. It may be luck that our tier-1 tested targets did not regress the original issue across those refactors.
rustc_expand: ensure stack in `InvocationCollector::visit_expr` In Fedora, when we built rustc with PGO on ppc64le, we started failing the test `issue-74564-if-expr-stack-overflow.rs`. This could also be reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so it's probably just unlucky that ppc64le PGO created a large stack frame somewhere in this recursion path. Adding an `ensure_sufficient_stack` solves the stack overflow. Historically, that test and its fix were added in #74708, which was also an `ensure_sufficient_stack` in this area of code at the time. However, the refactor in #92573 basically left that to the general `MutVisitor`, and then #142240 removed even that ensure call. It may be luck that our tier-1 tested targets did not regress the original issue across those refactors.
rustc_expand: ensure stack in `InvocationCollector::visit_expr` In Fedora, when we built rustc with PGO on ppc64le, we started failing the test `issue-74564-if-expr-stack-overflow.rs`. This could also be reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so it's probably just unlucky that ppc64le PGO created a large stack frame somewhere in this recursion path. Adding an `ensure_sufficient_stack` solves the stack overflow. Historically, that test and its fix were added in rust-lang/rust#74708, which was also an `ensure_sufficient_stack` in this area of code at the time. However, the refactor in rust-lang/rust#92573 basically left that to the general `MutVisitor`, and then rust-lang/rust#142240 removed even that ensure call. It may be luck that our tier-1 tested targets did not regress the original issue across those refactors.
rustc_expand: ensure stack in `InvocationCollector::visit_expr` In Fedora, when we built rustc with PGO on ppc64le, we started failing the test `issue-74564-if-expr-stack-overflow.rs`. This could also be reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so it's probably just unlucky that ppc64le PGO created a large stack frame somewhere in this recursion path. Adding an `ensure_sufficient_stack` solves the stack overflow. Historically, that test and its fix were added in rust-lang/rust#74708, which was also an `ensure_sufficient_stack` in this area of code at the time. However, the refactor in rust-lang/rust#92573 basically left that to the general `MutVisitor`, and then rust-lang/rust#142240 removed even that ensure call. It may be luck that our tier-1 tested targets did not regress the original issue across those refactors.
rustc_expand: ensure stack in `InvocationCollector::visit_expr` In Fedora, when we built rustc with PGO on ppc64le, we started failing the test `issue-74564-if-expr-stack-overflow.rs`. This could also be reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so it's probably just unlucky that ppc64le PGO created a large stack frame somewhere in this recursion path. Adding an `ensure_sufficient_stack` solves the stack overflow. Historically, that test and its fix were added in rust-lang/rust#74708, which was also an `ensure_sufficient_stack` in this area of code at the time. However, the refactor in rust-lang/rust#92573 basically left that to the general `MutVisitor`, and then rust-lang/rust#142240 removed even that ensure call. It may be luck that our tier-1 tested targets did not regress the original issue across those refactors.
Fixes#74564