mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
3c82d48cc0
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>
28 lines
931 B
JavaScript
28 lines
931 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (common.isWindows)
|
|
common.skip('No signals on Window');
|
|
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
|
|
// Test that a hard crash does not cause an endless loop.
|
|
|
|
if (process.argv[2] === 'child') {
|
|
const { internalBinding } = require('internal/test/binding');
|
|
const { causeSegfault } = internalBinding('process_methods');
|
|
|
|
causeSegfault();
|
|
} else {
|
|
const child = spawnSync(process.execPath,
|
|
['--expose-internals', __filename, 'child'],
|
|
{ stdio: 'inherit' });
|
|
// 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(
|
|
allowedSignals.includes(child.signal),
|
|
`child.signal = ${child.signal}`,
|
|
);
|
|
}
|