`ChildProcess.run` puts `null` or a string into `exitCode : Int` after a timeout, a signal or too much output
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 13
- フォーク
- 6
- 平均マージ
- 4日 10時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gren-lang/node のほかの issue
-
`ChildProcess.spawn` with `NoShell` looks for a program named after the program and its argumentsオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
Design only Leadership Survey SLFS
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bcgov/digital-journeys#2293 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
tursodatabase/turso#9405 ·
メンテナーはふだん 1 日以内に返信
-
Toolkit
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
API Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ProjectSidewalk/SidewalkWebpage#5556 ·
メンテナーはふだん 1 日以内に返信