Skip to content

Socket.connect results in an abort in v12.x and v10.x #38105

@zyscoder

Description

@zyscoder

What steps will reproduce the bug?

Setup a node instance,

» node

and run the following javascript code.

socket = new net.Socket({fd:10});
new net.Socket({fd:10}).resume();
socket.connect('str',()=>{});

Then an abort occurs.

How often does it reproduce? Is there a required condition?

This problem can always be triggered following the steps above.

What is the expected behavior?

If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.

What do you see instead?

» node
Welcome to Node.js v12.21.0.
Type ".help" for more information.
> socket = new net.Socket({fd:10});
Socket {
...
}
> new net.Socket({fd:10}).resume();
Socket {
...
}
> socket.connect('str',()=>{});
Socket {
...
}
> node: ../deps/uv/src/unix/core.c:930: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
[2]    3060074 abort      /home/zys/Toolchains/node-v12.21.0/node

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    libuvIssues and PRs related to the libuv dependency or the uv binding.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions