posix_spawn falls back to fork() when create_group = True due to HAVE_DECL_ macro mismatch
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- build-system
調査の方向性
Start in configure.ac at the AC_CHECK_DECLS checks for the POSIX_SPAWN_* constants, then compare the generated HsProcessConfig.h macros with the preprocessor conditions used by the Haskell spawn-selection code. Trace the create_group/new_session path to see where fork() is chosen instead of posix_spawn. Done means those options use posix_spawn on platforms where the relevant constants are available, confirmed by the project's test suite and a spawn-heavy check.
索引モデルが issue の本文から書いたものです。
説明
Benchmark Observation
While profiling a subprocess-heavy workload using create_group = True (for process-group timeout termination), we observed high spawn overhead (~1.5ms per spawn) and memory duplication costs. Tracing with strace revealed that process was executing traditional clone() (fork) instead of posix_spawn (CLONE_VM | CLONE_VFORK).
Root Cause
configure.ac checks constants using AC_CHECK_DECLS, which defines HAVE_DECL_POSIX_SPAWN_*:
/* In generated HsProcessConfig.h */
#define HAVE_DECL_POSIX_SPAWN_SETPGROUP 1
#define HAVE_DECL_POSIX_SPAWN_SETSID 1
As a result, enabling create_group (or new_session) on Linux/macOS always silently falls back to fork().
- 主要言語
- Haskell
- スター
- 91
- フォーク
- 93
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haskell/process のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
HAVE_PIPE2 at compile time but not at runtime causes segfault on macOS対応中かも @alt-romes が 3 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
FreeBSD 15.1 and lower have a linker bug that affects process対応中かも @luite が 43 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
haskell/process の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
haskell/bytestring#730 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
seal-harness/seal-harness#399 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
fmidue/codeworld-tasks#124 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
reflex-frp/reflex#563 ·