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

In "node debug" in a certain reproducible scenario, typing "c" twice causes node to completley hang #4651

Closed
shlomif opened this issue Jan 12, 2016 · 11 comments

Comments

@shlomif
Copy link

shlomif commented Jan 12, 2016

Please see the reproducing test case here: https://github.com/shlomif/node-js-bug--debug-gets-stuck-on-two-c-commands namely doing:

shlomif@telaviv1:~/node-js-debug-gets-stuck-on-two-c$ /home/shlomif/apps/node-js/bin/node debug perlito5.js -I src5/lib -I MyDir/lib -I MyDir/lib/expand-solitaire-multi-card-moves 
< Debugger listening on port 5858
connecting to 127.0.0.1:5858 ... ok
break in perlito5.js:20
 18 // See http://www.perl.com/perl/misc/Artistic.html
 19 
>20 "use strict";
 21 var isNode = typeof require != "undefined";
 22 
debug> c
debug> c

Causes the debugger to hang without being able to interrupt using either ctrl+c or ctrl+z. I'm using node-v5.4.0 on Mageia Linux x86-64 v6. More info can be found in the link.

@zeusdeux
Copy link
Contributor

I am unsure if this is a node debugger issue as opening perlito5.js hangs my node process itself.
Also, it is quite hard to pin point the issue as perlito5.js is >43k loc. :s

@nacho4d
Copy link

nacho4d commented Jan 23, 2016

I am having the same behaviour in a closed-source project. my project is not so big (although it depends in express and other small libraries).

@jasnell
Copy link
Member

jasnell commented Jan 23, 2016

It's possible this is related to #4819

@nacho4d
Copy link

nacho4d commented Jan 23, 2016

I have removd all unrelated sources and reduced perlito5.js to a couple of lines and the bug is still reproducible. Please download the reduced version from my fork:

https://github.com/nacho4d/node-js-bug--debug-gets-stuck-on-two-c-commands

Just run:

node debug perlito5.js

@nacho4d
Copy link

nacho4d commented Jan 23, 2016

I don't know if what I did is enough but I pulled the branch from #4819 and compiled and tried with that node version. I still see the same behaviour :(

I can do c++ but in this case I don't know where to start. If somebody can give me some pointers maybe I can look at this?

@shlomif
Copy link
Author

shlomif commented Jan 23, 2016

@nacho4d : thanks for your help and insights! I can reproduce the problem with your two lines-long program as well here (node-5.4.0 built from source on Mageia x86-64 cauldron).

@Trott
Copy link
Member

Trott commented Apr 23, 2017

FWIW, Node.js 8.0.0-pre gives sensible feedback about what is going on here and does not hang.

$ ./node debug perlito.js 
(node:90329) [DEP0068] DeprecationWarning: `node debug` is deprecated. Please use `node inspect` instead.
< Debugger listening on 127.0.0.1:9229.
< To start debugging, open the following URL in Chrome:
<     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/81a56490-14d3-488b-a726-537da2df7e3a
< Debugger attached.
Break on start in perlito.js:1
> 1 (function (exports, require, module, __filename, __dirname) { 
  2 "use strict";
  3 var isNode = typeof require != "undefined";
debug> c
< Waiting for the debugger to disconnect...
debug> c
Error: Use `run` to start the app again.
    at Promise (node-inspect/lib/internal/inspect_client.js:238:16)
    at Promise (<anonymous>)
    at Client.callMethod (node-inspect/lib/internal/inspect_client.js:236:12)
    at Proxy.callVirtualMethod (node-inspect/lib/_inspect.js:140:23)
    at Object.get cont [as cont] (node-inspect/lib/internal/inspect_repl.js:852:25)
    at repl:1:1
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at Object.runInContext (vm.js:108:6)
    at REPLServer.controlEval (node-inspect/lib/internal/inspect_repl.js:521:25)
    at bound (domain.js:301:14)
debug>

First c goes to the end of the program. Next c is an error because the program has already terminated.

Node.js 8.0.0 is expected to be released mid- or late May.

@jasnell
Copy link
Member

jasnell commented May 30, 2017

This is unlikely to be fixed in older versions and the debugger is now removed in newer versions. Closing. We can reopen if necessary

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

shlomif commented May 30, 2017 via email

@targos
Copy link
Member

targos commented May 30, 2017

@shlomif You can use node inspect script.js instead. The commands are the same. It just uses the V8 inspector instead of the old debugger.

@shlomif
Copy link
Author

shlomif commented May 30, 2017 via email

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

No branches or pull requests

7 participants