-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed as not planned
Closed as not planned
Copy link
Labels
lib / srcIssues and PRs related to general changes in the lib or src directory.Issues and PRs related to general changes in the lib or src directory.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
Description
process.on('SIGSEGV', (s) => {
console.log(`program crashed with ${signum}`)
})
// some code that causes node to hard crash, not abort (such as *(int *) 0 = 0;)
this causes node to loop tight with high CPU. On the first look I was thinking it keeps calling the handler but that was not the case.
in libuv, the signals (internal or external) are intercepted in uv__signal_handler
.
- After all the processing, it returns from the signal stack, which causes the faulty instruction to be re-entered, leading to the tight loop.
- it writes to the signal's pipefd, but the thread is never able to reach there to process it and invoke the callback.
These questions come to my mind:
- Is it meaningful to resume to the execution context on internal fatal signals?
- If yes, where should it resume?
- If no, what it should do?
IMO the embedder should decide / control these?
@nodejs/libuv @nodejs/process
Metadata
Metadata
Assignees
Labels
lib / srcIssues and PRs related to general changes in the lib or src directory.Issues and PRs related to general changes in the lib or src directory.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.