nodejs / nodejs/node

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

Offen
#48,476 5 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

child_process
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem mit child_process.execSync("ls", {stdio: "overlapped"}) und untersuche src/spawn_sync.cc, beginnend bei SyncProcessRunner::ParseStdioOption und ParseStdioOptions. Bestätige das Verhalten auf Nicht-Windows-Systemen und stelle sicher, dass die dokumentierte stdio-Behandlung nicht mehr die Assertion auslöst oder zum Abbruch führt; überprüfe die Reproduktion anschließend.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
backend, operating-systems
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
70/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.