process: throw on execve(2) failure instead of aborting#62878
Open
bengl wants to merge 1 commit intonodejs:mainfrom
Open
process: throw on execve(2) failure instead of aborting#62878bengl wants to merge 1 commit intonodejs:mainfrom
bengl wants to merge 1 commit intonodejs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62878 +/- ##
==========================================
- Coverage 89.62% 89.62% -0.01%
==========================================
Files 706 706
Lines 219165 219170 +5
Branches 41989 42000 +11
==========================================
+ Hits 196435 196439 +4
+ Misses 14621 14615 -6
- Partials 8109 8116 +7
🚀 New features to boost your workflow:
|
When the underlying execve(2) system call fails, process.execve() previously printed an error to stderr and called ABORT(), preventing JS code from detecting or recovering from common failures such as a missing binary. Throw an ErrnoException instead, carrying the standard code, errno, syscall, and path properties. To leave the process in a clean state when execve(2) fails, no longer run native AtExit callbacks before the call (their in-memory effects are discarded on success anyway), and snapshot and restore the FD_CLOEXEC flags on stdio so a failed call has no observable side effects. Rename and update test-process-execve-abort.js accordingly and document the new behavior. Signed-off-by: Bryan English <bryan@bryanenglish.com>
55e9403 to
55e4b8f
Compare
ShogunPanda
approved these changes
Apr 22, 2026
Collaborator
Collaborator
Collaborator
Member
Author
|
@jasnell adding you as a reviewer since you had the initial suggestion to just abort when execve fails. The approach I took here is a bit of a departure, since RunAtExit is no longer called. I think this approach makes sense because the process isn't so much "exiting" as being replaced entirely, as is the nature of execve. The benefit of being able to recover from |
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.
When the underlying execve(2) system call fails, process.execve() previously printed an error to stderr and called ABORT(), preventing JS code from detecting or recovering from common failures such as a missing binary. Throw an ErrnoException instead, carrying the usual code, errno, syscall, and path properties.
To leave the process in a clean state when execve(2) fails, no longer run native AtExit callbacks before the call (their in-memory effects are discarded on success anyway), and snapshot and restore the FD_CLOEXEC flags on stdio so a failed call has no observable side effects. Rename and update test-process-execve-abort.js accordingly and document the new behaviour.