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

node 4.2.6: util.inspect() will terminate the program when there is a breakpoint #4906

Closed
Corey600 opened this issue Jan 27, 2016 · 5 comments
Labels
util Issues and PRs related to the built-in util module.

Comments

@Corey600
Copy link

var util = require('util');
console.log(util.inspect({ff:9}));
console.log('1');
debugger;
console.log('2');
debugger;
console.log('3');
debugger;

code is like above.

when i execute the command : node debug demo.js
result like this:

E:\workspace\web\node\koa-auth>node debug demo.js
< Debugger listening on port 5858
debug> . ok
break in E:\workspace\web\node\koa-auth\demo.js:1
> 1 var util = require('util');
  2 console.log(util.inspect({ff:9}));
  3 console.log('1');
debug> c
< { ff: 9 }
< 1
program terminated
program terminated
program terminated
program terminated
program terminated
program terminated
program terminated
program terminated
program terminated
debug> . failed, please retry

E:\workspace\web\node\koa-auth>

when i program without debug, it run well.
but it can not run with debug.

my node version is 4.2.6
my system is windows 8.1

please solve this problem. thx!

@bnoordhuis
Copy link
Member

I speculate you're running into a variation on #4221, which was fixed recently in #4731 and is scheduled for the next LTS release. Maybe you can give the latest nightly a try?

@mscdex mscdex added the util Issues and PRs related to the built-in util module. label Jan 27, 2016
@Corey600
Copy link
Author

I found node v5.5.0 or v6.0.0 can run well with debug.
But when i use Webstorm10 or Visual Studio Code to debug with node v5.5.0 or v6.0.0, it still can not run well.
I think that maybe the problem is about Webstorm10 or Visual Studio Code.

@vaunus
Copy link

vaunus commented Feb 3, 2016

I am experiencing the same issue here where the debugger gets stuck on any line with util.inspect() on it.

In a very simple example with app.js containing the following it works as you would expect:

var util = require('util');
var f = function () {
    //breakpoint #1 below
    var abc = '123';
    console.log(util.inspect(abc));
    //breakpoint #2 below
    var def = '456';
};

f();

However in a more complex app it seems not to and the debugger and app hang at any line containing this. I have tested adding a simple console.log(util.inspect({abc: '123'})) lines in various places throughout my project and it consistently causes this problem.

Verified to still be an issue in the latest 5.5.1 nightly and 6.0.0 nightlies from the 27th Jan 2016.

@evanlucas
Copy link
Contributor

@Corey600 This should have been fixed in more recent releases. Could you see if this is still a problem for you? Thanks!

@MylesBorins
Copy link
Contributor

This should have been fixed a while back in v4.3.1 and v5.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

No branches or pull requests

6 participants