-
Notifications
You must be signed in to change notification settings - Fork 7.3k
node debug repl freezes when dumping variables #4244
Comments
The same thing happens when trying to dump |
htop shows nodejs process spinning madly at ~100% cpu while repl is frozen. |
What node version are you referring to? |
(Ubuntu PPA: chris lea) |
I also had to rebuild jsdom to get contextify, otherwise the example wouldn't work at all (different issue) |
much simpler testcase: timeout.js
Freeze as before, have to |
This test works as expected for me (same version). |
I understand, debugger has to communicate with debuggee process, but long or permanent freezes on even small objects are somewhat annoying, particularly if there's no way to interrupt them. |
/tmp > node debug 1.js
< debugger listening on port 5858
connecting... ok
break in 1.js:1
1 setTimeout( function() {
2 var bla = 42;
3 console.log(bla)
debug> c
< 42
break in 1.js:4
2 var bla = 42;
3 console.log(bla)
4 debugger;
5 }, 1000)
6
debug> repl
Press Ctrl + C to leave debug repl
> this
{ _idleTimeout: 1000,
_onTimeout: 'function () {\n var bla = 42;\n console.log(bla)\n debugger;\n}',
_idlePrev: null,
_idleNext: null,
_idleStart: Tue Nov 06 2012 19:09:17 GMT+0400 (MSK) }
debug>
(^C again to quit)
debug> no
debug>
(^C again to quit)
debug>
/tmp > node -v
v0.8.14 Same for me. |
Freezes are little bit expected, data should be serialized/deserialized. And some objects apparently may refer others in their kind, so sending small object may result in sending whole objects list |
Thanks all of you for helping out! |
Working like a charm with self-compiled node. Thanks again! |
Sorry about the spam, I have to reopen. Even with node v0.9.4-pre compiled straight from Git, dumping |
Attaching strace to the spinning |
Link to FlameGraph of spinning process: https://docs.google.com/open?id=0Bw_zs5IJ-GDvN1dncGExSTlRb1k Any help with running the test on a system with DTrace support will be greatly appreciated. |
@ackalker ... is this still an issue for you? |
Using node v0.12.3, I no longer see the issue, i.e. the REPL returns results quickly. |
Thanks for checking! Closing for now |
Wanting to play around with some jQuery selectors from within Node, I modded an http-agent demo to get this:
Running
node debug agent.js
and continuing until the breakpoint in the callback, I wanted to inspect the contents of$('head')
:This freezes the repl and the debugger (or at least it might return something after a very long time, sometimes minutes).
Doing instead:
returns results immediately, although not nicely colour-coded etc.
The text was updated successfully, but these errors were encountered: