node icon indicating copy to clipboard operation
node copied to clipboard

util.inspect({level: "info"}) exits the debug session

Open learnerbyheart opened this issue 10 years ago • 43 comments

When debugging in node.js 5.3.0 the script bug.js

var util = require('util');
util.inspect({level: "info "});
console.log("Test");

with node debug bug.js, the debugging session exits. I tried the same in node.js 4.2.4 and it doesn't. When debugging the difference in lib/util.js, line 324 in 5.3.0 looks like this:

var promiseInternals = inspectPromise(value);

and line 319 in 4.2.4 looks like:

var promiseInternals = value instanceof Promise && inspectPromise(value);

As value is not an instance of Promise, inspectPromise(value) is called in 5.3.0. Then inspectPromise calls ensureDebugIsInitialized() which on the other hand calls require('vm').runInDebugContext('Debug'). This causes the debugging session to exit. The issue was tested in Ubuntu 14.04 LTS.

learnerbyheart avatar Dec 27 '15 20:12 learnerbyheart

Yes, v4.3.0 was a security fix that only included the fixes for the security issues. It bumped all other fixes to the next LTS release which we'll be working on soon. On Feb 11, 2016 1:35 AM, "atom0s" [email protected] wrote:

The comment just above yours mentioned already that it will be fixed at a later time for LTS.

— Reply to this email directly or view it on GitHub https://github.com/nodejs/node/issues/4440#issuecomment-182781801.

jasnell avatar Feb 11 '16 13:02 jasnell

This isn't TOP priority? https://github.com/nodejs/node/issues/4382

rainabba avatar Feb 17 '16 03:02 rainabba

As mentioned above 4.3.1 has been released with the fix for this bug!

MylesBorins avatar Feb 17 '16 19:02 MylesBorins