-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: fix process.abort() interaction with V8
Since V8 5.9 V8 installs a default signal handler for some signals when creating a default platform instance that prints a stack trace. However, Node already does the same thing, so it would seem like the two different stack traces would be printed; also, the V8 handler would lead to a `SIGSEGV` under some circumstances, rather than letting the abort continue normally. Resolve this by disabling V8’s signal handler by default. Fixes: #13865
- Loading branch information
Showing
3 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
|
||
// This test makes sure that an aborted node process | ||
// exits with code 3 on Windows, and SIGABRT on POSIX. | ||
// Spawn a child, force an abort, and then check the | ||
// exit code in the parent. | ||
|
||
const spawn = require('child_process').spawn; | ||
if (process.argv[2] === 'child') { | ||
process.abort(); | ||
} else { | ||
const child = spawn(process.execPath, [__filename, 'child']); | ||
child.on('exit', common.mustCall((code, signal) => { | ||
if (common.isWindows) { | ||
assert.strictEqual(code, 3); | ||
assert.strictEqual(signal, null); | ||
} else { | ||
assert.strictEqual(code, null); | ||
assert.strictEqual(signal, 'SIGABRT'); | ||
} | ||
})); | ||
} |
This file was deleted.
Oops, something went wrong.