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: random from parallel workers shares libc's drand48 state with a racy one-shot seed — cross-worker duplicate draws

Đã đóng
#1,150 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/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
Lĩnh vực
compilers, performance

Hướng nghiên cứu

Start in src/builtins.c around eigs_ensure_random_seeded at lines 2299-2309 and builtin_random at line 2317, then run the worker probes in ~/src/wt/briefs/conc-review/probes-{A,B,C}/. Compare sequential and parallel duplicate counts and TSan reports; done means concurrent draws no longer race or produce the observed cross-worker duplicates while EIGS_SEED behavior remains reproducible.

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}/.

g_random_seeded (src/builtins.c:2299): eigs_ensure_random_seeded :2301 reads and :2309 writes it unsynchronized (TSan reports in every worker probe that touches random); two workers can both srand48 under a running draw; builtin_random :2317 calls drand48() (unlocked glibc global state) from N threads.

Observed

Two workers × 100,000 draws, counting values present in BOTH lists: sequential control 0 of 100,000; parallel 21 / 5 / 31 of 100,000 across three runs.

Fix direction

pthread_once for the seed; a mutex around drand48/lrand48, or per-thread drand48_r state seeded from the process seed plus a thread ordinal (keeps EIGS_SEED reproducible per thread).

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

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.