A query copies a shared binding's observer slot outside the lock its recorder holds (ThreadSanitizer: 16 warnings on two threads)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c
- Área
- backend-api-design, testing-qa
Línea de trabajo
Start with vm_slot_query_view in src/vm.c and the observer record path in src/eigenscript.c, then inspect tests/test_tsan.sh and the instruction-count gate. Run the supplied two-thread program and its trajectory of g variant under make tsan; done means no ThreadSanitizer warning on the query or record paths, with the planted race still detectable. Document whether readers see a slot before or after a record and how growth protects storage held by readers.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On phase2-numbers at 652b262a, a query of a numeric binding copies its observer slot without the lock that a recording thread holds while it writes the slot. With two OS threads sharing one binding, one assigning it and one reading report of, converged of or stable of it, ThreadSanitizer reports data races between the copy and the record.
g is 1
define reader(n) as:
local i is 0
local r is 0
loop while i < n:
r is [report of g, converged of g, stable of g]
i is i + 1
return r
th is spawn of [reader, 3000]
define writer(n) as:
local j is 0
loop while j < n:
g is j * 1.5
j is j + 1
return j
print of (writer of 3000)
print of (thread_join of th)
make tsan, run with setarch -R and TSAN_OPTIONS="halt_on_error=0 exitcode=0": 16 warnings on this program (30 with trajectory of g among the reads). The first:
WARNING: ThreadSanitizer: data race
Write of size 1 by main thread (mutexes: write M0):
#0 observer_slot_update_numeric_locked src/eigenscript.c:1229
#1 observer_slot_update_numeric_shared src/eigenscript.c:1269
#2 observer_slot_update_numeric src/eigenscript.c:1319
#3 observer_slot_update src/eigenscript.c:1327
#4 vm_run_ex src/vm.c:5869
Previous read by thread T1:
#0 vm_slot_query_view src/vm.c:459
The read is ObserverSlot q = *s in vm_slot_query_view: the whole slot copied outside the fold lock, then read. The write is the record under that lock. The copy can therefore hold a slot caught between two of the record's writes (a count that is ahead of the ring it counts, or the reverse). That is what the report shows. Whether a reader can also index storage that the recorder has since replaced is NOT shown here (in a live program the storage is made once, when the binding gets its first number, and only a tape's configuration record regrows it); the repair says whether it can.
The tree's own planted race (EIGS_TSAN_OBSERVER_FOLD_OUTSIDE_HOLD=1) raises the count on the same program from 16 to 47, so the hosted thread-sanitizer slice would see a race of this kind if it ran such a program; it runs a fixed slice (tests/test_tsan.sh) that has no reader of a shared numeric binding beside a writer.
Found by an independent review of a bar for another change to the same slot; that change does not touch this.
Done when
- The program above (and its
trajectory of gform) runs undermake tsanwith no warning whose stack holdsvm_slot_query_viewor the record path, on a head where the planted race still raises warnings (shown first). - The repair says what a reader may see: the slot as it was before a record or after it, never between; and that a growth cannot free what a reader holds. If the copy stays, it is taken under the lock; if a query then pays for the lock on an unshared binding, the cost is measured on the rows of the instruction-count gate.
-
tests/test_tsan.shgains a program of this shape, so that the hosted slice sees the next one.
— Claude DevBox
- Lenguaje dominante
- C
- Estrellas
- 3
- Forks
- 7
- Merge medio
- 3 h 28 min
- PR fusionados (30 d)
- 270
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de InauguralSystems/EigenScript
-
area:gates kind:gate-defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
InauguralSystems/EigenScript#2476 ·
Los mantenedores suelen responder en 1 día
-
area:gates needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
InauguralSystems/EigenScript#2462 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
The hosted-RNG check refuses a clean tree that has a tracked file with a double quote in its nameAbiertoarea:gates kind:gate-defect needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
InauguralSystems/EigenScript#2461 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:gates kind:gate-defect needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
InauguralSystems/EigenScript#2458 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a wordAbiertoarea:http kind:silent-wrong
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
InauguralSystems/EigenScript#2394 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de InauguralSystems/EigenScript
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
flipperdevices/flipperzero-firmware#4520 ·
Los mantenedores suelen responder en 1 día
-
area/build-framework kind/enhancement priority/low
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
yugabyte/yugabyte-db#38826 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
meshcore-dev/MeshCore#3891 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug grammar sev-3
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
BUG/MEDIUM: regex: worker SIGSEGV when a regex is applied to an empty body on libc-regex buildsAbiertostatus: needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100