From b77000f4d7b2378aec2eac45035ed8eec07bb1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 5 May 2023 13:03:38 +0200 Subject: [PATCH] test: allow SIGBUS in signal-handler abort test FreeBSD uses SIGBUS after update to v12.4. Refs: https://github.com/nodejs/build/issues/3134 PR-URL: https://github.com/nodejs/node/pull/47851 Reviewed-By: Santiago Gimeno Reviewed-By: Benjamin Gruenbaum Reviewed-By: Michael Dawson Reviewed-By: Luigi Pinca Reviewed-By: Ben Noordhuis --- 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..a99a84647470c4 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 and greater) 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}`, + ); }