Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#1,150 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
C
Stars
3
Forks
7
Avg merge
4h 15m
Merged PRs (30d)
106

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InauguralSystems/EigenScript

All issues in InauguralSystems/EigenScript

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.