posix_spawn falls back to fork() when create_group = True due to HAVE_DECL_ macro mismatch
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- build-system
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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().
- Ngôn ngữ chính
- Haskell
- Star
- 91
- Fork
- 93
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của haskell/process
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
HAVE_PIPE2 at compile time but not at runtime causes segfault on macOSCó thể đã có người làm @alt-romes đã nhận 3 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
FreeBSD 15.1 and lower have a linker bug that affects processCó thể đã có người làm @luite đã nhận 43 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Tất cả issue của haskell/process
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
haskell/bytestring#730 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
seal-harness/seal-harness#399 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
add previously overlooked rulesĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
fmidue/codeworld-tasks#124 ·
-
allow haskell-src-exts-1.24Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
reflex-frp/reflex#563 ·