| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7d1676e commit 94d3fe1
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -566,6 +566,17 @@ Disable the `Object.prototype.__proto__` property. If `mode` is `delete`, the | |||
| 566 | 566 | property is removed entirely. If `mode` is `throw`, accesses to the | |
| 567 | 567 | property throw an exception with the code `ERR_PROTO_ACCESS`. | |
| 568 | 568 | ||
| 569 | + ### `--disable-sigusr1` | ||
| 570 | + | ||
| 571 | + <!-- YAML | ||
| 572 | + added: REPLACEME | ||
| 573 | + --> | ||
| 574 | + | ||
| 575 | + > Stability: 1.2 - Release candidate | ||
| 576 | + | ||
| 577 | + Disable the ability of starting a debugging session by sending a | ||
| 578 | + `SIGUSR1` signal to the process. | ||
| 579 | + | ||
| 569 | 580 | ### `--disable-warning=code-or-type` | |
| 570 | 581 | ||
| 571 | 582 | > Stability: 1.1 - Active development | |
@@ -1446,6 +1457,7 @@ added: v7.6.0 | |||
| 1446 | 1457 | ||
| 1447 | 1458 | Set the `host:port` to be used when the inspector is activated. | |
| 1448 | 1459 | Useful when activating the inspector by sending the `SIGUSR1` signal. | |
| 1460 | + Except when [`--disable-sigusr1`][] is passed. | ||
| 1449 | 1461 | ||
| 1450 | 1462 | Default host is `127.0.0.1`. If port `0` is specified, | |
| 1451 | 1463 | a random available port will be used. | |
@@ -3085,6 +3097,7 @@ one is included in the list below. | |||
| 3085 | 3097 | * `--conditions`, `-C` | |
| 3086 | 3098 | * `--diagnostic-dir` | |
| 3087 | 3099 | * `--disable-proto` | |
| 3100 | + * `--disable-sigusr1` | ||
| 3088 | 3101 | * `--disable-warning` | |
| 3089 | 3102 | * `--disable-wasm-trap-handler` | |
| 3090 | 3103 | * `--dns-result-order` | |
@@ -3670,6 +3683,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12 | |||
| 3670 | 3683 | [`--build-snapshot`]: #--build-snapshot | |
| 3671 | 3684 | [`--cpu-prof-dir`]: #--cpu-prof-dir | |
| 3672 | 3685 | [`--diagnostic-dir`]: #--diagnostic-dirdirectory | |
| 3686 | + [`--disable-sigusr1`]: #--disable-sigusr1 | ||
| 3673 | 3687 | [`--env-file-if-exists`]: #--env-file-if-existsconfig | |
| 3674 | 3688 | [`--env-file`]: #--env-fileconfig | |
| 3675 | 3689 | [`--experimental-default-type=module`]: #--experimental-default-typetype | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -691,7 +691,8 @@ inline bool Environment::no_global_search_paths() const { | |||
| 691 | 691 | } | |
| 692 | 692 | ||
| 693 | 693 | inline bool Environment::should_start_debug_signal_handler() const { | |
| 694 | - return (flags_ & EnvironmentFlags::kNoStartDebugSignalHandler) == 0; | ||
| 694 | + return ((flags_ & EnvironmentFlags::kNoStartDebugSignalHandler) == 0) && | ||
| 695 | + !options_->disable_sigusr1; | ||
| 695 | 696 | } | |
| 696 | 697 | ||
| 697 | 698 | inline bool Environment::no_browser_globals() const { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -389,6 +389,11 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 389 | 389 | " (default: current working directory)", | |
| 390 | 390 | &EnvironmentOptions::diagnostic_dir, | |
| 391 | 391 | kAllowedInEnvvar); | |
| 392 | + AddOption("--disable-sigusr1", | ||
| 393 | + "Disable inspector thread to be listening for SIGUSR1 signal", | ||
| 394 | + &EnvironmentOptions::disable_sigusr1, | ||
| 395 | + kAllowedInEnvvar, | ||
| 396 | + false); | ||
| 392 | 397 | AddOption("--dns-result-order", | |
| 393 | 398 | "set default value of verbatim in dns.lookup. Options are " | |
| 394 | 399 | "'ipv4first' (IPv4 addresses are placed before IPv6 addresses) " | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,6 +116,7 @@ class EnvironmentOptions : public Options { | |||
| 116 | 116 | bool abort_on_uncaught_exception = false; | |
| 117 | 117 | std::vector<std::string> conditions; | |
| 118 | 118 | bool detect_module = true; | |
| 119 | + bool disable_sigusr1 = false; | ||
| 119 | 120 | bool print_required_tla = false; | |
| 120 | 121 | bool require_module = true; | |
| 121 | 122 | std::string dns_result_order; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + console.log('pid is', process.pid); | ||
| 2 | + setInterval(() => {}, 1000); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const fixtures = require('../common/fixtures'); | ||
| 5 | + const { it } = require('node:test'); | ||
| 6 | + const assert = require('node:assert'); | ||
| 7 | + const { NodeInstance } = require('../common/inspector-helper.js'); | ||
| 8 | + | ||
| 9 | + common.skipIfInspectorDisabled(); | ||
| 10 | + | ||
| 11 | + it('should not attach a debugger with SIGUSR1', { skip: common.isWindows }, async () => { | ||
| 12 | + const file = fixtures.path('disable-signal/sigusr1.js'); | ||
| 13 | + const instance = new NodeInstance(['--disable-sigusr1'], undefined, file); | ||
| 14 | + | ||
| 15 | + instance.on('stderr', common.mustNotCall()); | ||
| 16 | + const loggedPid = await new Promise((resolve) => { | ||
| 17 | + instance.on('stdout', (data) => { | ||
| 18 | + const matches = data.match(/pid is (\d+)/); | ||
| 19 | + if (matches) resolve(Number(matches[1])); | ||
| 20 | + }); | ||
| 21 | + }); | ||
| 22 | + | ||
| 23 | + assert.ok(process.kill(instance.pid, 'SIGUSR1')); | ||
| 24 | + assert.strictEqual(loggedPid, instance.pid); | ||
| 25 | + assert.ok(await instance.kill()); | ||
| 26 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments