Skip to content

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

Closed
@ventsislav-georgiev

Description

@ventsislav-georgiev
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions