Skip to content

node aborts with --debug when it self-exits #12264

@sam-github

Description

@sam-github
  • Version: 7.x, 6.x, 4.x (there is no --debug in master)
  • Platform: Linux (at least)
  • Subsystem: debugger

node --debug test/fixtures/printA.js (node's test/fixtures), node --debug -p process.features, `node --debug -e "console.log('hi')", all abort on

CHECK_EQ(err, 0);
with UV_EBUSY, because there is still work.

The check seems invalid to me, uv_run() runs with NOWAIT, so its not guaranteed to run til the loop is empty, just until there is nothing that would involve blocking, IIRC.

I tried adding setTimeout() and setImmediate() into printA.js, same thing. I think the debugger just doesn't expect to be used to debug a node process which is not long-lived.

core/node (v8.x *$% u=) % ./node --debug test/fixtures/printA.js
(node:27775) [DEP0062] DeprecationWarning: node --debug is deprecated. Please use node --inspect instead.
Debugger listening on 127.0.0.1:5858
A
err -16/home/sam/w/core/node/out/Release/node[27775]: ../src/debug-agent.cc:148:void node::debugger::Agent::Stop(): Assertion `(err) == (0)' failed.
 1: node::Abort() [./node]
 2: node::Assert(char const* const (*) [4]) [./node]
 3: 0x5645e6a64394 [./node]
 4: node::debugger::Agent::~Agent() [./node]
 5: node::Environment::~Environment() [./node]
 6: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [./node]
 7: node::Start(int, char**) [./node]
 8: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
 9: _start [./node]
zsh: abort (core dumped)  ./node --debug test/fixtures/printA.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions