Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2021-05-19 19:20:56 +0300
committerMichaël Zasso <targos@protonmail.com>2021-06-10 12:11:54 +0300
commit82b44f465b830f2a131cd78e6dcb8cb261b17084 (patch)
tree6ec9950afe398968ee841feb98bc6a83ae8822c5 /test
parentce4b4cc0aff75cc91dc9cf61b09aedc5fbb061c3 (diff)
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: https://github.com/v8/v8/commit/26d85acee2c052aa128b77e2e5fde1d4c9306910 PR-URL: https://github.com/nodejs/node/pull/38273 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>
Diffstat (limited to 'test')
-rw-r--r--test/abort/test-abort-uncaught-exception.js2
-rw-r--r--test/abort/test-worker-abort-uncaught-exception.js2
-rw-r--r--test/common/index.js6
-rw-r--r--test/parallel/test-windows-failed-heap-allocation.js2
4 files changed, 6 insertions, 6 deletions
diff --git a/test/abort/test-abort-uncaught-exception.js b/test/abort/test-abort-uncaught-exception.js
index 718f456c973..d2735822401 100644
--- a/test/abort/test-abort-uncaught-exception.js
+++ b/test/abort/test-abort-uncaught-exception.js
@@ -28,7 +28,7 @@ function run(flags, argv2, signals) {
child.on('exit', common.mustCall(function(code, sig) {
if (common.isWindows) {
if (signals)
- assert.strictEqual(code, 0xC0000005);
+ assert.strictEqual(code, 0x80000003);
else
assert.strictEqual(code, 1);
} else if (signals) {
diff --git a/test/abort/test-worker-abort-uncaught-exception.js b/test/abort/test-worker-abort-uncaught-exception.js
index 141e2cacdbe..d8f8d181818 100644
--- a/test/abort/test-worker-abort-uncaught-exception.js
+++ b/test/abort/test-worker-abort-uncaught-exception.js
@@ -16,7 +16,7 @@ const child = spawn(process.execPath, [
]);
child.on('exit', common.mustCall((code, sig) => {
if (common.isWindows) {
- assert.strictEqual(code, 0xC0000005);
+ assert.strictEqual(code, 0x80000003);
} else {
assert(['SIGABRT', 'SIGTRAP', 'SIGILL'].includes(sig),
`Unexpected signal ${sig}`);
diff --git a/test/common/index.js b/test/common/index.js
index 14d47cf0574..a5d74a3c5b4 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -498,12 +498,12 @@ function nodeProcessAborted(exitCode, signal) {
const expectedSignals = ['SIGILL', 'SIGTRAP', 'SIGABRT'];
// On Windows, 'aborts' are of 2 types, depending on the context:
- // (i) Forced access violation, if --abort-on-uncaught-exception is on
- // which corresponds to exit code 3221225477 (0xC0000005)
+ // (i) Exception breakpoint, if --abort-on-uncaught-exception is on
+ // which corresponds to exit code 2147483651 (0x80000003)
// (ii) Otherwise, _exit(134) which is called in place of abort() due to
// raising SIGABRT exiting with ambiguous exit code '3' by default
if (isWindows)
- expectedExitCodes = [0xC0000005, 134];
+ expectedExitCodes = [0x80000003, 134];
// When using --abort-on-uncaught-exception, V8 will use
// base::OS::Abort to terminate the process.
diff --git a/test/parallel/test-windows-failed-heap-allocation.js b/test/parallel/test-windows-failed-heap-allocation.js
index 1681f0d871e..56a941ce58d 100644
--- a/test/parallel/test-windows-failed-heap-allocation.js
+++ b/test/parallel/test-windows-failed-heap-allocation.js
@@ -23,6 +23,6 @@ const cmd = `"${process.execPath}" --max-old-space-size=3 "${__filename}"`;
exec(`${cmd} heapBomb`, { cwd: tmpdir.path }, common.mustCall((err) => {
const msg = `Wrong exit code of ${err.code}! Expected 134 for abort`;
// Note: common.nodeProcessAborted() is not asserted here because it
- // returns true on 134 as well as 0xC0000005 (V8's base::OS::Abort)
+ // returns true on 134 as well as 0x80000003 (V8's base::OS::Abort)
assert.strictEqual(err.code, 134, msg);
}));