镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

DebuggerAgent: unhandled socket error event #781

Description

@3y3

debugger_agent doesn't handle correctly socket closing.

Test case:

node --debug test

Test.js

var spawn = require('child_process').spawn;

function Debugger(port) {
  var connection = require('net').createConnection(port)
    .on('error', console.error.bind(console))
    .on('close', process.exit.bind(process))
    .setEncoding('utf8');

  process.on('exit', connection.end);
}

var _debugger = spawn('node', ['-e', '(' + Debugger + ')(5858)']);
setTimeout(_debugger.kill.bind(_debugger), 1000);

After fix this issue by:

diff --git a/deps/debugger-agent/lib/_debugger_agent.js b/deps/debugger-agent/lib/_debugger_agent.js
index 680c5e9..13f2a9f 100644
--- a/deps/debugger-agent/lib/_debugger_agent.js
+++ b/deps/debugger-agent/lib/_debugger_agent.js
@@ -97,6 +97,7 @@ function Client(agent, socket) {
   this.on('data', this.onCommand);

   var self = this;
+  this.socket.on('error', function() {});
   this.socket.on('close', function() {
     self.destroy();
   });

I receive next error:
Assertion failed: (err) == (0), file src\agent.cc, line 164
UV_EBUSY

So, I'm incompetent to fix uv errors, therefore I opened this issue.
I think this is for @indutny

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions