Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Concurrency: exit of N inside a spawned worker does not stop the program — with the main thread blocked in recv it hangs forever; the doc never says what a worker's exit means

Đang mở
#1,149 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c

Hướng nghiên cứu

Reproduce the probes in ~/src/wt/briefs/conc-review/probes-{A,B,C}/, then inspect builtin_exit at src/builtins.c:768-782 and builtin_recv at :4743-4745. Trace channel cleanup in handle_table_drain at :5282-5299 and review docs/SPEC.md §Concurrency and docs/CONCURRENCY.md. Done means the reproduced hang is resolved or the documented worker-exit semantics are enforced, with coverage for the blocked-recv and busy-loop cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:concurrency bug

Found by the 2026-09-14 whole-runtime concurrency review (three independent reviewers, every finding below reproduced by execution on main @ a18deac unless marked reading). Probe files live in ~/src/wt/briefs/conc-review/probes-{A,B,C}/.

builtin_exit (src/builtins.c:768-782) sets the CALLING thread's flags and the state latch; nothing wakes the main thread blocked in builtin_recv's pthread_cond_wait (:4743-4745). Channels are broadcast-closed only in handle_table_drain (:5282-5299), which runs after main returns — never here.

Observed

c is channel of 1
define w() as:
    usleep of 20000
    exit of 5
h is spawn of w
v is recv of c
print of f"main woke: {v}"

Release: hung, killed at 20 s. Companion (main busy in a loop instead of recv): rc=3 at the end, but main printed its MARK_END AFTER the worker's exit — a worker's exit means "set the status, keep running". docs/SPEC.md §Concurrency and docs/CONCURRENCY.md ("decides its own status") never say this.

Fix direction

Either: a worker's exit closes+broadcasts every channel and sets a state flag every blocking builtin (recv, recv_timeout, thread_join, usleep) checks so main unwinds promptly; or document the real semantics ("exit from a worker records a status; the program ends when main returns") and make recv refuse to block forever when no thread can ever send (all other threads finished).

Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
3 giờ 56 phút
Pull request đã merge (30 ngày)
102

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.