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

Unreachable code reached when using {stdio: "overlapped"} #48476

Open
madebr opened this issue Jun 16, 2023 · 1 comment · May be fixed by #48479
Open

Unreachable code reached when using {stdio: "overlapped"} #48476

madebr opened this issue Jun 16, 2023 · 1 comment · May be fixed by #48479
Labels
child_process Issues and PRs related to the child_process subsystem.

Comments

@madebr
Copy link

madebr commented Jun 16, 2023

Version

18.16.0

Platform

Linux fedora 6.3.5-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 30 15:44:17 UTC 2023 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

child_process.execSync("ls", {stdio: "overlapped"})

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

Always

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

Execute the subprocess, and return some object.
According to the documentation, pipe should be used on non-Windows systems.

What do you see instead?

A segfault.

node[107754]: ../../src/spawn_sync.cc:934:int node::SyncProcessRunner::ParseStdioOption(int, v8::Local<v8::Object>): Assertion `"Unreachable code reached" ": " "invalid child stdio type"' failed.
 1: 0x7ff7073fde1c node::Abort() [/lib64/libnode.so.108]
 2: 0x7ff7073fdeab  [/lib64/libnode.so.108]
 3: 0x7ff7074dbbe9 node::SyncProcessRunner::ParseStdioOption(int, v8::Local<v8::Object>) [/lib64/libnode.so.108]
 4: 0x7ff7074dbeda node::SyncProcessRunner::ParseStdioOptions(v8::Local<v8::Value>) [/lib64/libnode.so.108]
 5: 0x7ff7074dcc5d node::SyncProcessRunner::ParseOptions(v8::Local<v8::Value>) [/lib64/libnode.so.108]
 6: 0x7ff7074dce53 node::SyncProcessRunner::TryInitializeAndRunLoop(v8::Local<v8::Value>) [/lib64/libnode.so.108]
 7: 0x7ff7074dd008 node::SyncProcessRunner::Run(v8::Local<v8::Value>) [/lib64/libnode.so.108]
 8: 0x7ff7074dd127 node::SyncProcessRunner::Spawn(v8::FunctionCallbackInfo<v8::Value> const&) [/lib64/libnode.so.108]
 9: 0x7ff7086c60f6 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/lib64/libnode.so.108]
10: 0x7ff7086c66b1  [/lib64/libnode.so.108]
11: 0x7ff7086c6fad v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/lib64/libnode.so.108]
12: 0x7ff708559539  [/lib64/libnode.so.108]
Aborted (core dumped)

Additional information

No response

@bnoordhuis bnoordhuis added the child_process Issues and PRs related to the child_process subsystem. label Jun 17, 2023
@bnoordhuis
Copy link
Member

That's an oversight in #29412. It added the 'overlapped' flag to src/process_wrap.cc but not src/spawn_sync.cc. Pull request welcome.

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Jun 17, 2023
Fix an oversight in the pull request that introduced the 'overlapped'
option to the asynchronous child process methods, and also add it to
the synchronous methods, like child_process.spawnSync().

Fixes: nodejs#48476
Refs: nodejs#29412
@bnoordhuis bnoordhuis linked a pull request Jun 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants