Skip to content

Make sure we don't overrun the stack in canonicalizer #136592

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

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

compiler-errors
Copy link
Member

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 5, 2025
@compiler-errors
Copy link
Member Author

I guess we use this in stable now, so wouldn't hurt to test perf:

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 5, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2025
…nical, r=<try>

Make sure we don't overrun the stack in canonicalizer

r? lcnr

Addresses rust-lang/trait-system-refactor-initiative#160
@bors
Copy link
Collaborator

bors commented Feb 5, 2025

⌛ Trying commit 7ba1dc3 with merge ab6c13d...

@bors
Copy link
Collaborator

bors commented Feb 5, 2025

☀️ Try build successful - checks-actions
Build commit: ab6c13d (ab6c13d7471db0ad645648cf083f74ae8abd20b4)

@rust-timer

This comment has been minimized.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after perf

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ab6c13d): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -1.2%, secondary -0.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
6.2% [6.2%, 6.2%] 1
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-3.8% [-4.0%, -3.6%] 2
All ❌✅ (primary) -1.2% [-1.2%, -1.2%] 1

Cycles

Results (primary 1.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 778.541s -> 776.797s (-0.22%)
Artifact size: 328.82 MiB -> 328.88 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 6, 2025
@lcnr
Copy link
Contributor

lcnr commented Feb 6, 2025

@bors r+ rollup=always

@bors
Copy link
Collaborator

bors commented Feb 6, 2025

📌 Commit 7ba1dc3 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2025
@lcnr
Copy link
Contributor

lcnr commented Feb 6, 2025

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 6, 2025
@@ -0,0 +1,84 @@
//@ check-pass
//@ compile-flags: -Znext-solver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of adding a new test, please just add revisions to tests/ui/associated-consts/issue-93775.rs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh lol i didn't realize this was minimized from an existing test 👍

@compiler-errors compiler-errors force-pushed the ensure-stack-in-canonical branch from 7ba1dc3 to 8e7481b Compare February 6, 2025 17:38
@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Feb 6, 2025

📌 Commit 8e7481b has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 6, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 6, 2025
…nonical, r=lcnr

Make sure we don't overrun the stack in canonicalizer

r? lcnr

Addresses rust-lang/trait-system-refactor-initiative#160
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#135973 (fix tail call checks wrt `#[track_caller]`)
 - rust-lang#136191 (compiler: replace few consts arrays with statics to remove const dupes)
 - rust-lang#136565 (compiler: Clean up weird `rustc_abi` reexports)
 - rust-lang#136582 (Revert "CI: build FreeBSD artifacts on FreeBSD 13.4")
 - rust-lang#136592 (Make sure we don't overrun the stack in canonicalizer)
 - rust-lang#136627 (MIR validation: add comment explaining the limitations of CfgChecker)
 - rust-lang#136634 (Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.)
 - rust-lang#136643 (ping me for attribute-related changes)
 - rust-lang#136644 (Add `rustc_hir_pretty::item_to_string` function)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

failed on windows
@bors r-
#136655 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 7, 2025
@lcnr
Copy link
Contributor

lcnr commented Feb 18, 2025

windows probably just needs a separate call to ensure_sufficient_stack, maybe this issue can still be triggered on linux if we increase the depth of the assoc type even further

@compiler-errors
Copy link
Member Author

Oh, lol, no it's because of #134608. That PR essentially papered over another stack overrun.

@compiler-errors compiler-errors force-pushed the ensure-stack-in-canonical branch from 8e7481b to 241a602 Compare February 21, 2025 18:24
@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Feb 21, 2025

📌 Commit 241a602 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 21, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 21, 2025
…nonical, r=lcnr

Make sure we don't overrun the stack in canonicalizer

r? lcnr

Addresses rust-lang/trait-system-refactor-initiative#160
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 21, 2025
…nonical, r=lcnr

Make sure we don't overrun the stack in canonicalizer

r? lcnr

Addresses rust-lang/trait-system-refactor-initiative#160
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136458 (Do not deduplicate list of associated types provided by dyn principal)
 - rust-lang#136474 ([`compiletest`-related cleanups 3/7] Make the distinction between sources root vs test suite sources root in compiletest less confusing)
 - rust-lang#136592 (Make sure we don't overrun the stack in canonicalizer)
 - rust-lang#136787 (Remove `lifetime_capture_rules_2024` feature)
 - rust-lang#137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes)
 - rust-lang#137257 (Ignore fake borrows for packed field check)
 - rust-lang#137348 (More sophisticated span trimming for suggestions)
 - rust-lang#137399 (fix ICE in layout computation with unnormalizable const)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136458 (Do not deduplicate list of associated types provided by dyn principal)
 - rust-lang#136474 ([`compiletest`-related cleanups 3/7] Make the distinction between sources root vs test suite sources root in compiletest less confusing)
 - rust-lang#136592 (Make sure we don't overrun the stack in canonicalizer)
 - rust-lang#136787 (Remove `lifetime_capture_rules_2024` feature)
 - rust-lang#137207 (Add #[track_caller] to Duration Div impl)
 - rust-lang#137245 (Tweak E0277 when predicate comes indirectly from ?)
 - rust-lang#137257 (Ignore fake borrows for packed field check)
 - rust-lang#137399 (fix ICE in layout computation with unnormalizable const)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7f1089e into rust-lang:master Feb 22, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 22, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2025
Rollup merge of rust-lang#136592 - compiler-errors:ensure-stack-in-canonical, r=lcnr

Make sure we don't overrun the stack in canonicalizer

r? lcnr

Addresses rust-lang/trait-system-refactor-initiative#160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants