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 <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
targos committed May 5, 2023
1 parent 0f46a4f commit d25c785
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 d25c785

Please sign in to comment.