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 <santiago.gimeno@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Michaël Zasso 2023-05-05 13:03:38 +02:00 committed by GitHub
parent 3d003543b7
commit 3c82d48cc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}`,
);
}