Skip to content

a simple script to crash Node.js with an assertion failure: (loop->watchers[w->fd] == w) #3604

Description

@pmq20

This crash was reported several times in [1] [2] [3] [4], I also devised a simple script to reproduce the crash as below.

var fd = 3;
while (fd<1000) {
  try {
    var stream = new net.Socket({
      fd: fd,
      readable: false,
      writable: true
    });
    stream.on('error', function() {});
    stream.write('might crash');
  } catch(e) {}
  fd += 1;
}

[1] joyent/libuv#838
[2] joyent/libuv#1348
[3] jeremycx/node-LDAP#33
[4] serialport/node-serialport#262

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues and PRs for confirmed bugs.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.libuvIssues and PRs related to the libuv dependency or the uv binding.netIssues and PRs related to the net subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions