Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zyscoder opened this issue Apr 6, 2021 · 5 comments
Closed

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

zyscoder opened this issue Apr 6, 2021 · 5 comments
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding.

Comments

@zyscoder
Copy link

zyscoder commented Apr 6, 2021

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

@marsonya marsonya added net Issues and PRs related to the net subsystem. v10.x labels Apr 6, 2021
@EladKeyshawn
Copy link

EladKeyshawn commented Apr 6, 2021

@zyscoder Is this normal on OSX ? (trying to reproduce the problem)

> socket = new net.Socket({fd:10});
Uncaught Error: ENOTTY: inappropriate ioctl for device, uv_pipe_open
    at new Socket (node:net:320:24) {
  errno: -25,
  code: 'ENOTTY',
  syscall: 'uv_pipe_open'
}

Edit:
Another fd=4 works...

@EladKeyshawn
Copy link

@marsonya This problem is fixed with latest 'uv' dep (v1.41.0 ), should I created a PR to upgrade 'uv' at 10.x and 12.x branches ?

@aduh95 aduh95 added libuv Issues and PRs related to the libuv dependency or the uv binding. and removed net Issues and PRs related to the net subsystem. labels Apr 6, 2021
@targos
Copy link
Member

targos commented Apr 11, 2021

v10.x is not going to have another release before EoL (end of this month).
It may still make sense to upgrade libuv in v12.x, but it should ideally only happend after we do it in v14.x.

@jasnell
Copy link
Member

jasnell commented Apr 26, 2021

Given that 10x is reaching end of life and won't be seeing another release. Removing the 10x label.

@santigimeno
Copy link
Member

Already fixed as the libuv version in v14.21.1 is 1.42.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding.
Projects
None yet
Development

No branches or pull requests

7 participants