-
-
Notifications
You must be signed in to change notification settings - Fork 161
fix(transform): route labeled breaks through yielding switches #9189
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fd9e64a
fix(transform): route labeled breaks through yielding switches (#9186)
3494c5e
fix(ci): classify string array length suite (#9171)
0a033b6
docs(changelog): record labeled switch fix (#9189)
33e5601
fix(hir): keep loop hoist off recursive stack (#9194)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Fixed async functions that used `await` inside a labeled `switch` and then | ||
| executed `break <label>`; the generated binary could previously spin forever | ||
| instead of continuing after the switch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fixed a compiler stack overflow while lowering some JavaScript dependency | ||
| graphs with the loop-property-array optimization enabled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 8633
🌐 Web query:
Rust std::process Child try_wait piped stdout stderr deadlock wait_with_output documentation💡 Result:
When using std::process::Child with Stdio::piped for stdout or stderr, a deadlock can occur if the child process fills the OS pipe buffer and the parent process does not concurrently read from the pipe [1][2][3]. The operating system imposes a limit on the pipe buffer size. If the child process attempts to write more data to its stdout or stderr than the buffer can hold, it will block until the parent consumes that data [2][3]. If the parent is simultaneously waiting for the child to exit (e.g., using wait or a loop with try_wait) without reading the output streams, both processes will block indefinitely—the child waiting for the parent to read, and the parent waiting for the child to exit [1][2]. Key mechanisms to avoid this include: 1. Use wait_with_output: The most straightforward way to avoid this deadlock is to use Child::wait_with_output, which consumes the child process's stdout and stderr streams while simultaneously waiting for the process to exit [4][5][6]. It handles the concurrent reading required to prevent pipe-buffer-related deadlocks [1][3]. 2. Concurrent Reading: If you need streaming access to output rather than waiting for completion, you must read from stdout and stderr concurrently, typically by spawning separate threads for each stream to avoid blocking the main thread [7][8]. 3. Difference between wait and try_wait: Unlike wait_with_output, standard methods like wait or try_wait do not automatically consume output pipes [4][6]. If you use these methods, you are responsible for manually draining the pipes to ensure they do not fill up [2]. Note that try_wait specifically is useful for non-blocking checks on the process status, but it does not resolve the underlying deadlock risk associated with piped streams [7][4]. Additionally, the Rust documentation notes that wait and wait_with_output close the child's stdin handle before waiting to help prevent deadlocks where the child is waiting for input that the parent never intends to provide [4][5]. In contrast, try_wait does not automatically drop stdin [4][9].
Citations:
Drain piped output while enforcing the timeout.
Child::try_wait()does not readstdoutorstderr. If the generated binary fills either pipe, it can block before exit, causing the helper to report a false timeout. Drain both streams concurrently while enforcing the deadline.🤖 Prompt for AI Agents
Source: MCP tools