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

Do not unref debug handle to avoid debug process stuck #2778

Closed
wants to merge 1 commit into from

Conversation

viirya
Copy link
Contributor

@viirya viirya commented Sep 9, 2015

For a simple javascript file:

 console.log('debug');

Run node debug a.js to launch debug process. Press first c and the program outputs > debug. After that, press c again the process just gets stuck and has no response so we have to kill it.

This is because debug handle has been unrefed. Once the program is finished, the event loop will be exited and the debug process will be stuck when debug sends commend again. We shouldn't unref the debug handle because even the script is finished, we can still send more debug command such as restart.

Fixes #1788.

@mscdex mscdex added c++ Issues and PRs that require attention from people who are familiar with C++. debugger labels Sep 9, 2015
@bnoordhuis
Copy link
Member

Before we go into details, have you checked that it passes make test?

@viirya
Copy link
Contributor Author

viirya commented Sep 10, 2015

Thanks. I've noticed this patch would cause some tests failed. I will try to fix that.

@Fishrock123 Fishrock123 mentioned this pull request Sep 13, 2015
7 tasks
@Fishrock123
Copy link
Contributor

@bnoordhuis
Copy link
Member

Change itself LGTM but the commit log needs to confirm to the guidelines from CONTRIBUTING.md.

The debug process running "node debug a.js" will be stuck when the
script ends. This is because the debug handler has been unrefed.
We shouldn't unref the debug handler to avoid this problem.
@viirya
Copy link
Contributor Author

viirya commented Oct 11, 2015

@bnoordhuis Thanks for reminding the commit log format.

@viirya
Copy link
Contributor Author

viirya commented Oct 13, 2015

ping @bnoordhuis I've updated the commit log. Any other comments?

bnoordhuis pushed a commit that referenced this pull request Oct 13, 2015
The debug process running "node debug a.js" will be stuck when the
script ends. This is because the debug handler has been unrefed.
We shouldn't unref the debug handler to avoid this problem.

PR-URL: #2778
Reviewed-By: Ben Noordhuis <[email protected]>
@bnoordhuis
Copy link
Member

Landed in ff877e9, thanks.

@bnoordhuis bnoordhuis closed this Oct 13, 2015
jasnell pushed a commit that referenced this pull request Oct 28, 2015
The debug process running "node debug a.js" will be stuck when the
script ends. This is because the debug handler has been unrefed.
We shouldn't unref the debug handler to avoid this problem.

PR-URL: #2778
Reviewed-By: Ben Noordhuis <[email protected]>
@jasnell
Copy link
Member

jasnell commented Oct 28, 2015

Landed in v4.x-staging in dee9c74

@bnoordhuis
Copy link
Member

Just a heads up but this PR introduced a regression and I'm moving to revert it, please see #3585.

@jasnell
Copy link
Member

jasnell commented Oct 29, 2015

@bnoordhuis ... ugh... ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants