- Version: master (8b2c61c)
- Platform: posix
- Subsystem: NA
test case:
'use strict';
const assert = require('assert');
const { spawnSync } = require('child_process');
const child = spawnSync(process.execPath, ['--abort-on-uncaught-exception', '-e', 'throw new Error();']);
assert.strictEqual(child.signal, 'SIGABRT'); // bug, the return signal is SIGILL
assert.strictEqual(child.code, null);
When using --abort-on-uncaught-exception and an error throws, the process should exit with SIGABRT instead it exists with SIGILL (illegal instruction). When using process.abort() directly the process exits with SIGABRT as it should.
This is the abort message:
Uncaught Error
FROM
[eval]:1:1
ContextifyScript.Script.runInThisContext (vm.js:1:1)
Object.runInThisContext (vm.js:1:1)
Object.<anonymous> ([eval]-wrapper:1:1)
Module._compile (module.js:1:1)
evalScript (bootstrap_node.js:1:1)
startup (bootstrap_node.js:1:1)
bootstrap_node.js:1:1
Received signal 4 <unknown> 000100c40b92
==== C stack trace ===============================
[0x000100c3f9c4]
[0x7fffc7388bba]
[0x7fff5fbfd7e0]
[0x00010092034b]
[0x3c3dde7043fd]
[0x3c3dde807c7a]
[0x3c3dde7bbe7c]
[end of stack trace]
test case:
When using
--abort-on-uncaught-exceptionand an error throws, the process should exit withSIGABRTinstead it exists withSIGILL(illegal instruction). When usingprocess.abort()directly the process exits withSIGABRTas it should.This is the abort message: