Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Concurrency: random from parallel workers shares libc's drand48 state with a racy one-shot seed — cross-worker duplicate draws

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c

調査の方向性

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.

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

説明

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).

主要言語
C
スター
3
フォーク
7
平均マージ
4時間 5分
マージ済み PR(30日)
116

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

InauguralSystems/EigenScript のほかの issue

InauguralSystems/EigenScript の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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