Skip to content

Commit

Permalink
test: allow SIGBUS in signal-handler abort test
Browse files Browse the repository at this point in the history
FreeBSD uses SIGBUS after update to v12.4.

Refs: nodejs/build#3134
PR-URL: #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>
  • Loading branch information
targos authored and RafaelGSS committed Jun 19, 2023
1 parent bf3e2c8 commit d6fae8e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/abort/test-signal-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
);
}

0 comments on commit d6fae8e

Please sign in to comment.