Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger crashes with "autoAttachChildProcesses": true set when debugging the extension host and a debugged child process exits quickly #1289

Closed
segevfiner opened this issue Jun 2, 2022 · 1 comment · Fixed by #1290
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@segevfiner
Copy link
Contributor

Describe the bug
The debugger crashes with "autoAttachChildProcesses": true set when debugging the extension host and a debugged child process exits quickly.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/segevfiner/vscode-jest-extension-debug-crash.
  2. npm install in both the repos root directory and jest subdirectory.
  3. Open in VS Code.
  4. Run the "Run extension" debug configuration
  5. Open the jest subdirectory in the extension development host.
  6. The extension development host exits/crashes a short time after the jest extension activates.

Log File

vscode-debugadapter-724d8689.json.gz

VS Code Version: 1.67.2

Additional context
See jest-community/vscode-jest#873

@segevfiner segevfiner added the bug Issue identified by VS Code Team member as probable bug label Jun 2, 2022
@connor4312
Copy link
Member

connor4312 commented Jun 6, 2022

Good find, this is actually reproducable when any debugged child process in the ext host ends, for example adding this to the "hello world" sample will cause a crash too

cp.spawn('node', ['-e', 'setTimeout(() => { console.log(42) }, 1000)']);

connor4312 added a commit that referenced this issue Jun 6, 2022
Fixes #1289

We weren't properly attributing child processes in the extension host to
the extension host process that created them. This caused them all to
be treated as if they _were_ the extension host process, so closing
any one of them resulted in the debugger thinking the extension host had
gone away and clearing up all sessions.
@connor4312 connor4312 added this to the June 2022 milestone Jun 6, 2022
@roblourens roblourens added the verified Verification succeeded label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants