nodejs / nodejs/node

unexpected breaking changes with `process.exitCode`/`process.exit()`

オープン
#45,683 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

confirmed-bug
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

Version

20.0.0-pre (nightly)

Platform

Darwin dib.lan 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64

Subsystem

process

What steps will reproduce the bug?
const assert = require('assert')

process.exitCode = 2
delete process.exitCode // REMOVE
assert(process.exitCode === undefined) // REMOVE
process.exit(undefined)
How often does it reproduce? Is there a required condition?

reproduces on all node versions built after landing #44711

What is the expected behavior?

the assertion should pass, and if the two lines marked REMOVE are commented out the process should exit with code 2

What do you see instead?

the assertion throws, and if the two lines marked REMOVE are commented out the process exits with code 0

Additional information

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、#44711 より後のビルドで再現手順を実行し、process.exitCode の削除と process.exit(undefined) を比較します。マークされた行を削除したときにアサーションが成功し、プロセスが引き続きコード 2 で終了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, node.js
領域
operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。