From eb4bd358da7033129acb26c634db5bc6aa7997d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 4 May 2023 08:37:16 +0200 Subject: [PATCH 1/3] test: allow SIGBUS in signal-handler abort test FreeBSD uses SIGBUS after update to v12.4. Refs: https://github.com/nodejs/build/issues/3134 --- test/abort/test-signal-handler.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/abort/test-signal-handler.js b/test/abort/test-signal-handler.js index 6ee7e4098af702..48c919f0c32b0a 100644 --- a/test/abort/test-signal-handler.js +++ b/test/abort/test-signal-handler.js @@ -17,8 +17,11 @@ if (process.argv[2] === 'child') { const child = spawnSync(process.execPath, ['--expose-internals', __filename, 'child'], { stdio: 'inherit' }); - // FreeBSD uses SIGILL for this kind of crash. + // FreeBSD uses SIGILL (v12.2) or SIGBUS (v12.4) for this kind of crash. // macOS uses SIGILL or SIGTRAP (arm64) for this kind of crash. - assert(child.signal === 'SIGSEGV' || child.signal === 'SIGILL' || - child.signal === 'SIGTRAP', `child.signal = ${child.signal}`); + const allowedSignals = ['SIGSEGV', 'SIGILL', 'SIGTRAP', 'SIGBUS']; + assert( + allowedSignals.includes(child.signal), + `child.signal = ${child.signal}` + ); } From bdcc60542d8130902c2fb88201a9f0b43a470a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 4 May 2023 08:45:29 +0200 Subject: [PATCH 2/3] fixup --- test/abort/test-signal-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/abort/test-signal-handler.js b/test/abort/test-signal-handler.js index 48c919f0c32b0a..37742cdbabf3ba 100644 --- a/test/abort/test-signal-handler.js +++ b/test/abort/test-signal-handler.js @@ -22,6 +22,6 @@ if (process.argv[2] === 'child') { const allowedSignals = ['SIGSEGV', 'SIGILL', 'SIGTRAP', 'SIGBUS']; assert( allowedSignals.includes(child.signal), - `child.signal = ${child.signal}` + `child.signal = ${child.signal}`, ); } From 99559185dfefec131a0d61dfafc874aaa86da898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 4 May 2023 10:28:22 +0200 Subject: [PATCH 3/3] Update test/abort/test-signal-handler.js Co-authored-by: Santiago Gimeno --- test/abort/test-signal-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/abort/test-signal-handler.js b/test/abort/test-signal-handler.js index 37742cdbabf3ba..a99a84647470c4 100644 --- a/test/abort/test-signal-handler.js +++ b/test/abort/test-signal-handler.js @@ -17,7 +17,7 @@ if (process.argv[2] === 'child') { const child = spawnSync(process.execPath, ['--expose-internals', __filename, 'child'], { stdio: 'inherit' }); - // FreeBSD uses SIGILL (v12.2) or SIGBUS (v12.4) for this kind of crash. + // FreeBSD uses SIGILL (v12.2) or SIGBUS (v12.4 and greater) for this kind of crash. // macOS uses SIGILL or SIGTRAP (arm64) for this kind of crash. const allowedSignals = ['SIGSEGV', 'SIGILL', 'SIGTRAP', 'SIGBUS']; assert(