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

Debug process didn't close after finish debugging #1788

Closed
kiddkai opened this issue May 24, 2015 · 35 comments
Closed

Debug process didn't close after finish debugging #1788

kiddkai opened this issue May 24, 2015 · 35 comments
Assignees
Labels
confirmed-bug Issues with confirmed bugs.

Comments

@kiddkai
Copy link

kiddkai commented May 24, 2015

In both io.js and node.js >= 0.12 have this issue.

OS:

osx & ubuntu 14

Reproduce steps:

  • Create a file:

a.js

console.log('debug');
  • run node debug a.js
  • press c to continue

Then the stdout should have:

> debug
> program terminated

But currently, it only have

> debug
  • When I try to press c to continue and make the process close, but it just stuck there waiting for v8 response.

It happen when I write my own debugger. It seems that the debug server should knows that the process is terminated, but it didn't.

@brendanashworth
Copy link
Contributor

cross-ref: nodejs/node-v0.x-archive#25358
i'll mark as confirmed-bug because the joyent folks seem to have also

@pitosalas
Copy link

Trying it on mac, latest atom, Node 0.12.4, and it doesn't seem to work. F5 just says "finish debugging :) "

@kiddkai
Copy link
Author

kiddkai commented Jul 13, 2015

Hey @pitosalas , it seems that your configuration is not correct. Which can not find the node.js binary? Is there any error popup shows up? Anyway, please move the node-debugger conversation to https://github.com/kiddkai/atom-node-debugger.

Here is the issues for io.js.

@micene09
Copy link

Hi, i don't know how...and why...but all shortcuts are disabled.
I don't see any "Enable" checkbox in settings page, what can you do to fix it ?

OS: Windows 7 64bit

Ty

@bnoordhuis
Copy link
Member

#2778 got reverted in 9b02442 so this issue is still relevant.

@johnelliott
Copy link

This is frustrating me too. I end up restarting my terminal (iTerm2 on this machine) to get out and start again...

@lhyhfut
Copy link

lhyhfut commented Feb 3, 2016

OS: OS X EI Capitian
my Node Path: "/Users/liuhongyu/.nvm/versions/node/v4.0.0/bin/node"
error: node executable could not be found

@mithung
Copy link

mithung commented Feb 29, 2016

All shortcuts are disabled.I am using Windows 7 64 bit system.
Can someone help me out.

@jasnell
Copy link
Member

jasnell commented Mar 9, 2016

It's possible that this was fixed recently in v5 and master. Can anyone confirm?

@jasnell
Copy link
Member

jasnell commented Apr 2, 2016

Nope, still an issue unfortunately. /cc @thealphanerd

@MylesBorins MylesBorins self-assigned this Apr 2, 2016
@MylesBorins
Copy link
Contributor

assigned to myself... will dig in next week

@MylesBorins
Copy link
Contributor

I can confirm that this bug is present in v4, v5, and v0.12. v0.10 appears to work as expected (assuming the exepcted behavior is that the debugger informs you of the program terminating

@jjqq2013
Copy link
Contributor

i have confirmed this problem from node 4.4.2 to 6.2.2.

I used "node debug a.js" to test debugger.

This works in old version.

This problem affect other product such as WebStorm.

If this is by design, then should let WebStorm fix it.

@MadaraUchiha
Copy link
Contributor

Any news about this? I'm still affected using Visual Studio Code and Node 6.5.0

@tambry
Copy link

tambry commented Oct 24, 2016

I'm also still affected using Visual Studio Code 1.6.1 and Node 6.9.1.

@darkguy2008
Copy link

darkguy2008 commented Nov 16, 2016

I am having the same experience. Any ideas regarding this development? Node 7.1.0 and VSCode 1.7.1

@adelphes
Copy link

adelphes commented Nov 24, 2016

For those on Linux (esp using VS code) who want a really hacky way to terminate the debugger on process exit, here you go...

process.on('exit', (code) => {
    // this force terminates the debugger by attaching to the debugger socket via it's FD and destroying it!
    try {
        new require('net').Socket({
            fd: parseInt(
                require('child_process').spawnSync('lsof', ['-np', process.pid], {encoding:'utf8'})
                    .stdout.match(/^.+?\sTCP\s+127.0.0.1:\d+->127.0.0.1:\d+\s+\(ESTABLISHED\)/m)[0].split(/\s+/)[3]
                , 10)
        }).destroy();
    } catch(e) {}
});

Skywalker13 added a commit to Skywalker13/wannabe.js that referenced this issue Jan 14, 2017
@jasnell
Copy link
Member

jasnell commented May 30, 2017

Closing this. If this is still an issue that needs to be fixed, we can reopen.

@jasnell jasnell closed this as completed May 30, 2017
@mattflix
Copy link

mattflix commented May 31, 2017

@jasnell, on what basis did you close this bug?

It seems to be a long-standing Node bug that keeps popping up (usually other front-end debugging tools are inappropriately blamed). Why can't it be acknowledged and then fixed?

@jasnell
Copy link
Member

jasnell commented May 31, 2017

The old debugger has been deprecated and removed as of 8.0.0. While this issue may be relevant still in older versions, and while I'd really like to see these older issues addressed, the likelihood that someone with enough domain expertise to resolve the issue is going to pick it issue up and fix it in 6.x or 4.x is fairly low, unfortunately. We can certainly reopen the issue but we would need someone to move it forward.

@mattflix
Copy link

mattflix commented May 31, 2017

@jasnell, so this is fixed in the new debugger?

I am using Visual Studio Code. Do you have any pointers for using the new debugger with it?

Just install node 8.0?

@bnoordhuis
Copy link
Member

@mattflix It's covered in their documentation here: https://code.visualstudio.com/docs/nodejs/nodejs-debugging

@johnelliott
Copy link

johnelliott commented May 31, 2017

I see no problem closing the issue.

Overall I am very happy with the debugging progress in Node. Using the --inspect flag and chrome devtools is an immense boost in productivity. Thanks @jasnell @bnoordhuis and all. ✨🙏✨

@unbornchikken
Copy link

I'm still having this issue by using VS Code 1.13.1 / Node 8.1.1. If I run a gulp task, it won't get finished until I stop the debugger.

@marshallswain
Copy link

I confirm the same problem with code 1.13.1 and node v8.1.2

@millermatt
Copy link

millermatt commented Jun 26, 2017

Still a problem in node v8.1.2. Please re-open. @jasnell

@bnoordhuis
Copy link
Member

What is? Please be specific.

@millermatt
Copy link

Actual behavior
debug session does not stop when node script has finished running

Expected behavior
when a node script has finished running, the debug session should end

Steps to reproduce

  1. Open an empty folder in VSCode
  2. Add a default launch debug configuration (Debug->Add Configurations...)
  3. Create a .js file with contents console.log('test');
  4. Launch the debugger
  5. Observe that the debug toolbar stays active and indicates that the script is executing after 'test' has been written to the console

OS: Ubuntu 17.10 & MacOS Sierra
Node: v8.1.2
Editor: Visual Studio Code 1.13.1

@bnoordhuis

@bnoordhuis
Copy link
Member

@millermatt Thanks. Is there reason to assume it's a node.js issue? It sounds like a tooling issue in VS Code.

@millermatt
Copy link

microsoft/vscode#5831 (comment)

The above issue in the VS Code repo led me to this node.js issue. I can't say for certain whether the problem is with VS Code or node.js. Based on the conversations in both issues it seems more likely that is a node.js problem.

@bnoordhuis

@bnoordhuis
Copy link
Member

@millermatt Right, but that was with the old debugger, which has been removed. The inspector (the new debugger) is completely different so it's unlikely to be the same issue.

I'd take this up with the VS Code people first. If it does turn out to be a node.js issue, file a new issue and I'll take a look.

@millermatt
Copy link

@bnoordhuis Good call - looks like they have a fix for the next release. microsoft/vscode-node-debug2#11

@filmerjarred
Copy link

For anyone googling, couldn't make the process exit with process.exit() when debugger was attached, but process.kill(process.pid) worked

@georgeionita
Copy link

This still happens with node 8.7.0 under Webstorm debugging. Seems to be related to node rather than the IDE.

@MylesBorins
Copy link
Contributor

@georgeionita can you give detailed steps to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs.
Projects
None yet
Development

No branches or pull requests