Skip to content

Commit 6111671

Browse files
committed
test: adapt abort tests for new Windows code
V8 9.1 changed the way it aborts on uncaught exceptions on Windows. It now uses the code 0x80000003 (exception breakpoint) instead of 0xC0000005 (access violation). Refs: v8/v8@26d85ac PR-URL: #38273 Backport-PR-URL: #38991 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
1 parent 1816d46 commit 6111671

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

test/abort/test-abort-uncaught-exception.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function run(flags, argv2, signals) {
2828
child.on('exit', common.mustCall(function(code, sig) {
2929
if (common.isWindows) {
3030
if (signals)
31-
assert.strictEqual(code, 0xC0000005);
31+
assert.strictEqual(code, 0x80000003);
3232
else
3333
assert.strictEqual(code, 1);
3434
} else if (signals) {

test/abort/test-worker-abort-uncaught-exception.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const child = spawn(process.execPath, [
1616
]);
1717
child.on('exit', common.mustCall((code, sig) => {
1818
if (common.isWindows) {
19-
assert.strictEqual(code, 0xC0000005);
19+
assert.strictEqual(code, 0x80000003);
2020
} else {
2121
assert(['SIGABRT', 'SIGTRAP', 'SIGILL'].includes(sig),
2222
`Unexpected signal ${sig}`);

test/common/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,12 +498,12 @@ function nodeProcessAborted(exitCode, signal) {
498498
const expectedSignals = ['SIGILL', 'SIGTRAP', 'SIGABRT'];
499499

500500
// On Windows, 'aborts' are of 2 types, depending on the context:
501-
// (i) Forced access violation, if --abort-on-uncaught-exception is on
502-
// which corresponds to exit code 3221225477 (0xC0000005)
501+
// (i) Exception breakpoint, if --abort-on-uncaught-exception is on
502+
// which corresponds to exit code 2147483651 (0x80000003)
503503
// (ii) Otherwise, _exit(134) which is called in place of abort() due to
504504
// raising SIGABRT exiting with ambiguous exit code '3' by default
505505
if (isWindows)
506-
expectedExitCodes = [0xC0000005, 134];
506+
expectedExitCodes = [0x80000003, 134];
507507

508508
// When using --abort-on-uncaught-exception, V8 will use
509509
// base::OS::Abort to terminate the process.

test/parallel/test-windows-failed-heap-allocation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ const cmd = `"${process.execPath}" --max-old-space-size=3 "${__filename}"`;
2323
exec(`${cmd} heapBomb`, { cwd: tmpdir.path }, common.mustCall((err) => {
2424
const msg = `Wrong exit code of ${err.code}! Expected 134 for abort`;
2525
// Note: common.nodeProcessAborted() is not asserted here because it
26-
// returns true on 134 as well as 0xC0000005 (V8's base::OS::Abort)
26+
// returns true on 134 as well as 0x80000003 (V8's base::OS::Abort)
2727
assert.strictEqual(err.code, 134, msg);
2828
}));

0 commit comments

Comments
 (0)