Skip to content

avoid overflow when generating debuginfo for expanding recursive types #138599

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 2 commits into from
Apr 18, 2025

Conversation

adwinwhite
Copy link
Contributor

@adwinwhite adwinwhite commented Mar 17, 2025

Fixes #135093
Fixes #121538
Fixes #107362
Fixes #100618
Fixes #115994

The overflow happens because expanding recursive types keep creating new nested types when recurring into sub fields.
I fixed that by returning an empty stub node when expanding recursion is detected.

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2025

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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. labels Mar 17, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2025

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@fmease
Copy link
Member

fmease commented Mar 27, 2025

overloaded rn r? compiler

@rustbot rustbot assigned Noratrieb and unassigned fmease Mar 27, 2025
@Noratrieb
Copy link
Member

sorry for the bouncing, but I'm not familiar enough with this code to judge whether this is a good solution or not.
r? @wesleywiser

@rustbot rustbot assigned wesleywiser and unassigned Noratrieb Apr 6, 2025
Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

Yes, I think this is a pretty reasonable solution.

@wesleywiser
Copy link
Member

Thanks @adwinwhite! Nice to see all of those issues fixed 🥇

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 18, 2025

📌 Commit d5c4ed0 has been approved by wesleywiser

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 Apr 18, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#137881 (Add `copy_within` to `IndexSlice`)
 - rust-lang#138599 (avoid overflow when generating debuginfo for expanding recursive types)
 - rust-lang#139934 (Update `compiler-builtins` to 0.1.155)
 - rust-lang#139976 (run-make: drop `os_pipe` workaround now that `anonymous_pipe` is stable on beta)
 - rust-lang#139989 (tests: adjust 101082 test for LLVM 21 fix)
 - rust-lang#139991 (remove stray file)

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

Rollup of 6 pull requests

Successful merges:

 - rust-lang#137881 (Add `copy_within` to `IndexSlice`)
 - rust-lang#138599 (avoid overflow when generating debuginfo for expanding recursive types)
 - rust-lang#139934 (Update `compiler-builtins` to 0.1.155)
 - rust-lang#139976 (run-make: drop `os_pipe` workaround now that `anonymous_pipe` is stable on beta)
 - rust-lang#139989 (tests: adjust 101082 test for LLVM 21 fix)
 - rust-lang#139991 (remove stray file)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 68b439c into rust-lang:master Apr 18, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 18, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2025
Rollup merge of rust-lang#138599 - adwinwhite:recursive-overflow, r=wesleywiser

avoid overflow when generating debuginfo for expanding recursive types

Fixes rust-lang#135093
Fixes rust-lang#121538
Fixes rust-lang#107362
Fixes rust-lang#100618
Fixes rust-lang#115994

The overflow happens because expanding recursive types keep creating new nested types when recurring into sub fields.
I fixed that by returning an empty stub node when expanding recursion is detected.
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.
Projects
None yet
7 participants