Skip to content

Crash on windows when passing child process' stdin as other childs stdout #17493

Closed
@mika-fischer

Description

@mika-fischer
  • Version: v8.9.2
  • Platform: Windows 10 64bits

The following simple test crashes the node process on Windows. It works fine on Linux.

const {spawn} = require('child_process');

if (process.argv.length <= 2) {
    // parent
    const child2 = spawn(process.argv0, [process.argv[1], '.'], {
        stdio: ['pipe', 'ignore', 'ignore'],
    });
    const child1 = spawn(process.argv0, [process.argv[1], '.'], {
        stdio: ['pipe', child2.stdin, 'ignore'],
    });
    setInterval(() => child1.stdin.write(`.`), 1);
} else {
    // children
    process.stdin.pipe(process.stdout);
}

The error is:

Exception thrown: write access violation.
req was 0x2275CA37430.

It occurs in deps/uv/src/win/core.c:439.

Call stack:
callstack

Locals:
locals

I got the stack traces from a self-compiled build, but it also crashes with the official binary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.confirmed-bugIssues with confirmed bugs.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions