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
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- distributed-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C
- Stelle
- 3
- Fork
- 7
- Merge medio
- 4h 15m
- PR unite (30g)
- 106
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di InauguralSystems/EigenScript
-
area:lint-tooling bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
InauguralSystems/EigenScript#1340 ·
I maintainer di solito rispondono entro 1 giorno
-
area:stdlib found-by:code-review kind:silent-wrong
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
InauguralSystems/EigenScript#1338 ·
I maintainer di solito rispondono entro 1 giorno
-
area:lint-tooling found-by:critic kind:docs-drift
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
InauguralSystems/EigenScript#1335 ·
I maintainer di solito rispondono entro 1 giorno
-
area:ci found-by:critic kind:gate-defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
InauguralSystems/EigenScript#1311 ·
I maintainer di solito rispondono entro 1 giorno
-
enrolment: decide test_gc_runner_controls.py (exempt vs enrol) and whether floors need a ratchetApertaarea:gates found-by:critic kind:decision
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
InauguralSystems/EigenScript#1280 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di InauguralSystems/EigenScript
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ARM-software/sysarch-acs#556 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
netdata/netdata#24062 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100