Concurrency: "messages copy" is false for buffer, text_builder and closures — shared by reference through send and thread_join, with a real data race between sender and receiver
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- distributed-systems
Research direction
Run the probe files under ~/src/wt/briefs/conc-review/probes-{A,B,C}/ and reproduce the race with TSan. Read chan_clone_rec in src/eigenscript.c:2235-2308, its send/thread_entry callers, and the buffer operations in builtins_buf.c:116-148. Done means the reported sharing and race are resolved, with the aliasing, depth-cutoff, and closure behavior documented in docs/CONCURRENCY.md.
Written by the indexing model from the issue text.
Description
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}/.
docs/CONCURRENCY.md: "A value sent through a channel, or returned through thread_join, is COPIED … share-nothing". chan_clone_rec (src/eigenscript.c:2302-2308) shares VAL_FN/VAL_BUILTIN/VAL_BUFFER/VAL_TEXT_BUILDER/VAL_JSON_RAW by refcount (used by send :4711, thread_entry :4484, task_spawn :4940). Only a C comment says so.
Observed
c is channel of 4
b is buffer of 4
buf_set of [b, 0, 1.5]
send of [c, b]
buf_set of [b, 0, 99.0]
got is recv of c
print of f"buffer recv[0] after post-send mutation (expect 1.5): {buf_get of [got, 0]}"
tb is text_builder_new of []
text_builder_append of [tb, "before"]
send of [c, tb]
text_builder_append of [tb, "+AFTER"]
got2 is recv of c
print of f"text_builder recv (expect 'before'): {text_builder_to_string of got2}"
buffer recv[0] after post-send mutation (expect 1.5): 99
text_builder recv (expect 'before'): before+AFTER
dict.buffer recv[0] (expect 99 if copied at send): -7 # nested in a dict: same
A closure sent inside a dict still mutates the sender's captured list (101) while the sibling list in the same dict was copied ([0]). With the receiver reading while the sender writes, TSan reports the data race the doc promises cannot exist: builtin_buf_set builtins_buf.c:148 (main) vs builtin_buf_get :116 (T1). Note also that copies split internal aliasing (a joined [d, inner] with d.xs IS inner comes back as two independent lists) and the depth-64 cutoff in chan_clone_rec :2257 falls back to sharing (reading).
Fix direction
memcpy-clone buffers and text builders in chan_clone_rec (they are flat); document that functions are shared by reference and what that implies for their captured state (with the :2235-2236 caveat); document the aliasing split and the depth cutoff, or make the clone alias-preserving.
- Dominant language
- C
- Stars
- 3
- Forks
- 7
- Avg merge
- 4h 15m
- Merged PRs (30d)
- 106
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InauguralSystems/EigenScript
-
area:lint-tooling bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
InauguralSystems/EigenScript#1340 ·
Maintainers usually reply within 1 day
-
area:stdlib found-by:code-review kind:silent-wrong
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
InauguralSystems/EigenScript#1338 ·
Maintainers usually reply within 1 day
-
area:lint-tooling found-by:critic kind:docs-drift
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
InauguralSystems/EigenScript#1335 ·
Maintainers usually reply within 1 day
-
area:ci found-by:critic kind:gate-defect
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
InauguralSystems/EigenScript#1311 ·
Maintainers usually reply within 1 day
-
enrolment: decide test_gc_runner_controls.py (exempt vs enrol) and whether floors need a ratchetOpenarea:gates found-by:critic kind:decision
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
InauguralSystems/EigenScript#1280 · 1 comment ·
Maintainers usually reply within 1 day
All issues in InauguralSystems/EigenScript
Similar issues
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
netdata/netdata#24062 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
BasedHardware/omi#19463 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EchoTools/nevr-runtime#30 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
riscv-software-src/riscv-isa-sim#2448 ·
Maintainers usually reply within 2 days