`ChildProcess.run` puts `null` or a string into `exitCode : Int` after a timeout, a signal or too much output
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 74/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Start with Gren/Kernel/ChildProcess.js and run the linked 2026-09-14-childprocess-exitcode reproduction in gren-bug-reports. Inspect how execFile errors map err.code, err.killed, and err.signal into ProgramError, then cover normal exit, timeout, signal, and maximum-output cases with regression tests. Done means exitCode consistently matches its declared Int type and the termination cases remain distinguishable.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Found against: gren 0.6.6, gren-lang/core 7.4.2, gren-lang/node 6.1.3, node 22
Reproduction: in https://github.com/gilramir/gren-bug-reports, 2026-09-14-childprocess-exitcode; ./run.sh prints the run
below.
Summary
ChildProcess.run fails with ProgramError { exitCode : Int, … } whenever the
program was started and did not succeed. When the program did not exit with a
code, which is what runDuration and a signal do, and when it wrote more than
maximumBytesWrittenToStreams, exitCode is not an Int:
| how the program ended | String.fromInt e.exitCode |
e.exitCode + 1 |
e.exitCode > 0 |
|---|---|---|---|
sh -c "exit 3" |
3 |
4 |
True |
stopped by runDuration = Milliseconds 100 |
null |
1 |
False |
wrote past maximumBytesWrittenToStreams = 4 |
ERR_CHILD_PROCESS_STDIO_MAXBUFFER |
ERR_CHILD_PROCESS_STDIO_MAXBUFFER1 |
False |
killed by a signal (kill -9 $$) |
null |
1 |
False |
Every value in the last three rows is one no Int can be, so a program that
checks the exit code gets an answer that means nothing, and arithmetic on it
yields a string. A program cannot tell a timeout from a signal, or either from
too much output, except by inspecting a value its type says is a number.
The cause is in Gren/Kernel/ChildProcess.js, where execFile's error becomes
the ProgramError:
__$exitCode: err.code,
Node's err.code is the exit code only when the process exited. After a
timeout or a signal it is null, and err.killed and err.signal say what
happened. When the output passed maxBuffer it is the error's own code, the
string ERR_CHILD_PROCESS_STDIO_MAXBUFFER.
Reproduction
$ node app
exit 3: ProgramError, exitCode = 3, exitCode + 1 = 4, exitCode > 0 = True
killed by runDuration: ProgramError, exitCode = null, exitCode + 1 = 1, exitCode > 0 = False
past maximumBytesWrittenToStreams: ProgramError, exitCode = ERR_CHILD_PROCESS_STDIO_MAXBUFFER, exitCode + 1 = ERR_CHILD_PROCESS_STDIO_MAXBUFFER1, exitCode > 0 = False
killed by a signal: ProgramError, exitCode = null, exitCode + 1 = 1, exitCode > 0 = False
- Lingua principale
- JavaScript
- Stelle
- 13
- Fork
- 6
- Merge medio
- 4g 10h
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gren-lang/node
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
`ChildProcess.spawn` with `NoShell` looks for a program named after the program and its argumentsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
breaking enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
breaking bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
Tutte le issue di gren-lang/node
Issue simili
-
automation models
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
mastra-ai/mastra#25508 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[aw] Upgrade availableApertaagentic-workflows
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
githubnext/gh-aw-cao#15017 ·
I maintainer di solito rispondono entro 1 giorno