Skip to content

Process crashes when using child_process.spawnSync(..., {stdio: ['pipe', 'overlapped', 'pipe']}) #52265

Closed as not planned
@ehmicky

Description

Version

v21.7.1

Platform

Linux my-laptop 6.5.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 5 21:19:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

child_process

What steps will reproduce the bug?

import {spawnSync} from 'node:child_process'

spawnSync('node', ['--version'], {stdio: ['pipe', 'overlapped', 'pipe']});
$ node example.js

  #  node[6410]: int node::SyncProcessRunner::ParseStdioOption(int, v8::Local<v8::Object>) at ../src/spawn_sync.cc:941
  #  Assertion failed: "Unreachable code reached" ": " "invalid child stdio type"

----- Native stack trace -----

 1: 0xe2fcb7 node::Assert(node::AssertionInfo const&) [node]
 2: 0xf4cc3f node::SyncProcessRunner::ParseStdioOption(int, v8::Local<v8::Object>) [node]
 3: 0xf4d8ba node::SyncProcessRunner::ParseStdioOptions(v8::Local<v8::Value>) [node]
 4: 0xf4df1b node::SyncProcessRunner::ParseOptions(v8::Local<v8::Value>) [node]
 5: 0xf4e16b node::SyncProcessRunner::TryInitializeAndRunLoop(v8::Local<v8::Value>) [node]
 6: 0xf4e538 node::SyncProcessRunner::Spawn(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 7: 0x7b7167e0eadd 

----- JavaScript stack trace -----

1: spawnSync (node:internal/child_process:1110:29)
2: spawnSync (node:child_process:876:24)
3: file:///home/me/Desktop/a.js:3:1
4: run (node:internal/modules/esm/module_job:222:25)


Aborted (core dumped)

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

I have only tried it on Linux. Since overlapped is intended for Windows, the behavior might differ there.

This only crashes with spawnSync(), not spawn().

What is the expected behavior? Why is that the expected behavior?

This should either behave like pipe, or throw an error. I am not sure which behavior would be the best there.

What do you see instead?

The process crashes.

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions