Skip to content

[Debugger] cannot connect to runtime process when fork child with --inspect-brk #49865

@atian25

Description

@atian25

Issue Type: Bug

image

// index.js
const cp = require('child_process');

cp.fork('./agent', [], {
  execArgv: process.execArgv.concat([ '--debug-port=5800' ]),
});
// agent.js
setInterval(() => {
  console.log('I am agent', process.pid);
}, 5000);
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "npm",
      "windows": {
        "runtimeExecutable": "npm.cmd"
      },
      "runtimeArgs": [
        "run",
        "debug",
        "--",
        "--inspect-brk"
      ],
      "console": "integratedTerminal",
      "protocol": "auto",
      "restart": true,
      "port": 9229,
      "autoAttachChildProcesses": true
    }
  ]
}
{
  "name": "vscode-debug-brk",
  "version": "1.0.0",
  "description": "",
  "dependencies": {
  },
  "devDependencies": {
  },
  "engines": {
    "node": ">=8.0.0"
  },
  "scripts": {
    "debug": "node --inspect-brk index.js"
  }
}

VS Code version: Code 1.23.0 (7c7da59, 2018-05-03T15:23:14.634Z)
OS version: Darwin x64 17.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz (4 x 3100)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 6, 15
Memory (System) 16.00GB (0.03GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_53261
Screen Reader no
VM 0%
Extensions (33)
Extension Author (truncated) Version
vscode-markdownlint Dav 0.16.0
beautify Hoo 1.3.0
output-colorizer IBM 0.1.2
vscode-mocha-two Mys 1.2.1
vscode-docker Pet 0.0.26
Bookmarks ale 0.19.1
project-manager ale 0.25.2
copy-syntax ati 0.5.1
eggjs ati 0.3.1
vscode-gpm axe 0.16.2
vscode-custom-css be5 2.7.0
vscode-eslint dba 1.4.8
vscode-npm-source dku 1.0.0
githistory don 0.4.1
gitlens eam 8.2.4
tslint eg2 1.0.28
vscode-statusbar-debugger fab 1.4.1
code-runner for 0.9.3
path-autocomplete ion 1.9.0
search-node-modules jas 1.3.0
plantuml jeb 2.6.3
vscode-mocha-sidebar mat 0.19.0
vsliveshare ms- 0.3.114
debugger-for-chrome msj 4.4.3
node-modules-resolve nau 1.0.2
vetur oct 0.11.8
gitlink qez 0.4.2
unittest-navigate rob 0.0.2
preview-vscode sea 1.4.2
es6-mocha-snippets spo 0.1.3
code-navigation vik 0.2.0
JavaScriptSnippets xab 1.6.0
vscode-proto3 zxh 0.2.1

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions