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: fix debugger blocked main thread #2151

Closed
wants to merge 1 commit into from
Closed

debugger: fix debugger blocked main thread #2151

wants to merge 1 commit into from

Conversation

yjhjstz
Copy link

@yjhjstz yjhjstz commented Jul 10, 2015

see #2110 include a testcase.
when call process._debugEnd() before fixed , it would be blocked, then throw a timeout error.

@thefourtheye @indutny


var nodeProcess;

function doTest() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this function and run as well. Write the contents of the function in the top level itself.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that's good.

@indutny
Copy link
Member

indutny commented Jul 12, 2015

@indutny
Copy link
Member

indutny commented Jul 12, 2015

LGTM, except one nit (see @thefourtheye's comment). Thanks!

@thefourtheye
Copy link
Contributor

Also, the commit message should preferrably include your actual name and a valid email address, so that the commits may be attributed to your name (github account). Please refer https://help.github.com/articles/setting-your-email-in-git/#setting-your-local-git-email-address-using-the-git-config-command and https://help.github.com/articles/setting-your-email-in-git/#commits-on-github-arent-linking-to-my-account

@indutny
Copy link
Member

indutny commented Jul 12, 2015

Looks like the linter is not happy about it too. @yjhjstz have you tried running make test?

@thefourtheye good point, thanks!

@yjhjstz
Copy link
Author

yjhjstz commented Jul 14, 2015

make test & make jshint

@indutny
Copy link
Member

indutny commented Jul 16, 2015

@indutny
Copy link
Member

indutny commented Jul 16, 2015

CI looks green (except unrelated changes).

@indutny
Copy link
Member

indutny commented Jul 16, 2015

@yjhjstz may I ask you to include your name in the commit?

You may do it this way: git commit --amend --author "My Name <my@email>".

Other than that - no comments, looks awesome. Please let me know when I can re-review it ;)

@yjhjstz
Copy link
Author

yjhjstz commented Jul 16, 2015

You mean I should modify "yjhjstz" to "Jianghua Yang" , right?

@indutny
Copy link
Member

indutny commented Jul 16, 2015

This is correct!

@indutny
Copy link
Member

indutny commented Jul 16, 2015

Great! There is one small problem, though. The test hangs, and sometimes crashes:

Assertion failed: ((err) == (0)), function Stop, file ../src/debug-agent.cc, line 155.
Abort trap: 6

It seems that the debuggers tests are not being ran by default. May I ask you to give it a try, and probably figure out what's going on? :)

P.S.

Debugger tests could be run with make test-debugger

@yjhjstz
Copy link
Author

yjhjstz commented Jul 16, 2015

Yes, it's related #781 , and PR #2133 has fix it (about "HandleCleanup"), but not merged. So, in this PR, I don't include the patch.

@indutny
Copy link
Member

indutny commented Jul 16, 2015

Cool, what about the test hanging? ;) It doesn't look like this patch affects the way this test works.

@yjhjstz
Copy link
Author

yjhjstz commented Jul 16, 2015

Any error msg? I always encountered

Assertion failed: ((err) == (0)), function Stop, file ../src/debug-agent.cc, line 155.

if main thread blocked, it would be killed by child process in 5 secs.

@indutny
Copy link
Member

indutny commented Jul 16, 2015

@yjhjstz it just hangs on my computer, whether with your patch, or without it.

@yjhjstz
Copy link
Author

yjhjstz commented Jul 16, 2015

Yes, in mac os, It will block about 5 secs, that's because iojs can't handle SIGABRT, main thread couldn't exit normally. you may apply two patches, otherwise in the bug case, that would be a mess.

@indutny
Copy link
Member

indutny commented Aug 11, 2015

@yjhjstz sorry for delay. The idea of the test is that it should pass everywhere with the patch, and should fail or crash without it. Is there any way to reliably test it?

@yjhjstz
Copy link
Author

yjhjstz commented Aug 31, 2015

resubmit #2622 @indutny

@@ -0,0 +1,28 @@
'use strict';
var common = require('../common');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use const wherever the values are assigned once and never reassigned.

@indutny
Copy link
Member

indutny commented Aug 31, 2015

This will definitely leak some resources. What are the handles that are alive at this time? Let's figure out how to close them properly.

Thanks for the PR, though!

@yjhjstz
Copy link
Author

yjhjstz commented Aug 31, 2015

add close handles , please step to PR #2622

@yjhjstz yjhjstz closed this Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants