Commit e3f8993
fix(node): prevent logAndExitProcess from recursing on a broken pipe
logAndExitProcess writes the error to the console before shutting down.
When stderr is a closed pipe that write raises EPIPE, which surfaces as
another uncaught exception and re-enters the handler. calledFatalError is
already set by then, so onuncaughtexception routes straight back into
logAndExitProcess and the cycle repeats, allocating an Error with a
captured stack and a pending client.close() on every pass until V8
aborts with a heap OOM.
Guard the function itself rather than the calledFatalError branch, so
every caller is covered.
Fixes #24337
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent fd00e5d commit e3f8993
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
11 | 23 | | |
12 | 24 | | |
13 | 25 | | |
| |||
0 commit comments