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

IPC between Node <= 10.5.0 and Node 10.6.0 crashes #21671

Closed
ventsislav-georgiev opened this issue Jul 5, 2018 · 4 comments
Closed

IPC between Node <= 10.5.0 and Node 10.6.0 crashes #21671

ventsislav-georgiev opened this issue Jul 5, 2018 · 4 comments

Comments

@ventsislav-georgiev
Copy link

  • Version: 10.6.0
  • Platform: Windows x64

Running Node 10.5.0 to spawn a process with Node 10.6.0 and send IPC messages from the child crashes the parent.

Related issue in the Electron repo: electron/electron#13565

Code to reproduce
parent.js (run with node_v10.5.0)

const path = require('path');
const spawn = require('child_process').spawn;

const node10_6 = "C:/nvm/v10.6.0/node.exe";
const childPath = path.resolve('./child.js');

const child = spawn(node10_6, [childPath], {
  stdio: [ 'ignore', 'ignore', 'ignore', 'ipc' ]
});

child.on('message', message => {
  console.log(JSON.stringify(message));
  if (message.exit) process.exit(0);
});

child.send({ msg: "parent->child" });

child.js

process.send({ msg: "child->parent" });
process.on('message', message => {
    process.send({ msg: `from-parent: ${JSON.stringify(message)}` });
    process.send({ exit: true });
});

Result
The parent process crashes with:
Assertion failed: handle->pipe.conn.remaining_ipc_rawdata_bytes >= bytes, file src\win\pipe.c, line 1666

@cjihrig
Copy link
Contributor

cjihrig commented Jul 5, 2018

From a quick glance, based on the assertion location, I'm going to guess the failed assertion comes from libuv/libuv@4e53af9 in the libuv 1.21.0 update.

@bzoz
Copy link
Contributor

bzoz commented Jul 9, 2018

Yep, it is caused by libuv/libuv#1843. It also does not matter if parent is 10.5.0 or 10.6.0.

@joaocgreis
Copy link
Member

@nodejs/lts this should block updating libuv in LTS releases. This is already fixed in libuv (libuv/libuv#1923), but a new version still needs to be released and node updated.

libuv issue: libuv/libuv#1922

cjihrig added a commit to cjihrig/node that referenced this issue Aug 20, 2018
Notable changes:
- Restores compatibility with the old IPC protocol.
- Adds uv_open_osfhandle().
- Adds uv_os_{get,set}priority().

PR-URL: nodejs#22365
Fixes: nodejs#21671
Fixes: nodejs#15433
Refs: nodejs#21675
Refs: nodejs/node-addon-api#304
Refs: nodejs/abi-stable-node#318
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue Aug 21, 2018
Notable changes:
- Restores compatibility with the old IPC protocol.
- Adds uv_open_osfhandle().
- Adds uv_os_{get,set}priority().

PR-URL: #22365
Fixes: #21671
Fixes: #15433
Refs: #21675
Refs: nodejs/node-addon-api#304
Refs: nodejs/abi-stable-node#318
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue Sep 3, 2018
Notable changes:
- Restores compatibility with the old IPC protocol.
- Adds uv_open_osfhandle().
- Adds uv_os_{get,set}priority().

PR-URL: #22365
Fixes: #21671
Fixes: #15433
Refs: #21675
Refs: nodejs/node-addon-api#304
Refs: nodejs/abi-stable-node#318
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit to MylesBorins/node that referenced this issue Nov 5, 2018
Notable changes:
- Restores compatibility with the old IPC protocol.
- Adds uv_open_osfhandle().
- Adds uv_os_{get,set}priority().

PR-URL: nodejs#22365
Fixes: nodejs#21671
Fixes: nodejs#15433
Refs: nodejs#21675
Refs: nodejs/node-addon-api#304
Refs: nodejs/abi-stable-node#318
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this issue Nov 11, 2018
Notable changes:
- Restores compatibility with the old IPC protocol.
- Adds uv_open_osfhandle().
- Adds uv_os_{get,set}priority().

Backport-PR-URL: #24103
PR-URL: #22365
Fixes: #21671
Fixes: #15433
Refs: #21675
Refs: nodejs/node-addon-api#304
Refs: nodejs/abi-stable-node#318
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@maaizelahi
Copy link

maaizelahi commented Apr 25, 2021

This seems to be breaking for node version 10.14.1 and VsCode version 1.55.2 on Mac
However adding "mochaExplorer.nodePath": null to my configuration fixed this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@joaocgreis @maaizelahi @cjihrig @ventsislav-georgiev @bzoz and others