Repository navigation
Conversation
Restore the startup O_NONBLOCK state of standard descriptors before execve(), preserving other file status flags and terminal settings. Save all flags before changing them so failed calls also restore shared stdout and stderr correctly. Assisted-by: Codex Signed-off-by: MK <fengmk2@gmail.com>
Collaborator
|
Review requested:
|
Save errno and restore the descriptor and status flags before creating an error, whose inherited property setters can execute JavaScript. Check the flags from an inherited setter while the child remains alive. Keep the test cases and assertions in JavaScript and use Python for the POSIX descriptor setup and observations. Assisted-by: Codex Signed-off-by: MK <fengmk2@gmail.com>
Restore stdio explicitly at both failure exits after saving errno and before constructing the JavaScript error. Remove the cleanup scope and error-routing variables while preserving the blocking-mode policy. Clarify that the startup-mode check compares the underlying file. Assisted-by: Codex Signed-off-by: MK <fengmk2@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Opening a standard stream can set
O_NONBLOCKon its file descriptor.process.execve()passes this state to the replacement program, where I/O can fail withEAGAIN.Restore the startup blocking mode for standard descriptors that still refer to their original files or streams. Preserve other status flags and terminal settings. Save all standard stream flags before changes, and restore them if execution fails. This also handles shared
stdoutandstderrdescriptors, such as2>&1.Fixes: #66824
Codex (GPT-6) helped investigate and fix this issue.