Closed as not planned
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