-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: add --disable-sigusr1 to prevent signal i/o thread
This commit adds a new flag `--disable-sigusr1` to prevent the SignalIOThread to be up listening the SIGUSR1 events and then starting the debugging session. PR-URL: #56441 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
Showing
6 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
console.log('pid is', process.pid); | ||
setInterval(() => {}, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const fixtures = require('../common/fixtures'); | ||
const { it } = require('node:test'); | ||
const assert = require('node:assert'); | ||
const { NodeInstance } = require('../common/inspector-helper.js'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
it('should not attach a debugger with SIGUSR1', { skip: common.isWindows }, async () => { | ||
const file = fixtures.path('disable-signal/sigusr1.js'); | ||
const instance = new NodeInstance(['--disable-sigusr1'], undefined, file); | ||
|
||
instance.on('stderr', common.mustNotCall()); | ||
const loggedPid = await new Promise((resolve) => { | ||
instance.on('stdout', (data) => { | ||
const matches = data.match(/pid is (\d+)/); | ||
if (matches) resolve(Number(matches[1])); | ||
}); | ||
}); | ||
|
||
assert.ok(process.kill(instance.pid, 'SIGUSR1')); | ||
assert.strictEqual(loggedPid, instance.pid); | ||
assert.ok(await instance.kill()); | ||
}); |