-
Notifications
You must be signed in to change notification settings - Fork 1.4k
More fork safety #7380
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
+923
−250
Merged
More fork safety #7380
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6217ad6
apply more allow_threads
youknowone 6b6138b
Simplify STW thread state transitions
youknowone 396fec9
Representable for ThreadHandle
youknowone 9fe70f2
Set ThreadHandle state to Running in parent thread after spawn
youknowone e37b15f
Set ThreadHandle state to Running in parent thread after spawn
youknowone cfd7f01
Add debug_assert for thread state in start_the_world
youknowone 1b97419
Unskip now-passing test_get_event_loop_thread and test_start_new_thre…
youknowone 1ba2821
Wrap IO locks and file ops in allow_threads
youknowone ca41577
Use std::sync for thread start/ready events
youknowone 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
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
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.
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's check if the file exists and get its total line count wc -l crates/vm/src/stdlib/io.rsRepository: RustPython/RustPython
Length of output: 96
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 427
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1218
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1533
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 859
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 114
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 92
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 222
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 360
🏁 Script executed:
# Check the crt_fd module to understand the read function cat crates/common/src/crt_fd.rsRepository: RustPython/RustPython
Length of output: 9961
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1070
Replace
read_to_end()with explicitcrt_fd::read()loop to preserve signal checking on EINTR.The current code uses
std::io::Read::read_to_end(), which internally retries onEINTR, preventing the outer error handler from triggeringvm.check_signals(). This breaks the unbounded-read path (size < 0) signal handling.Use a chunked read loop with
crt_fd::read()instead, which surfacesEINTRto the error handler:Replace read_to_end() with chunked crt_fd::read() loop
🤖 Prompt for AI Agents