fix(nft): the per-batch markersAdded() call is not guarded against re-entry
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with NFTDetector.h and the per-batch markersAdded() call at the end of addNFTMarkers(); compare it with the guarded calls in ensureDetector() and the creation backfill. Then add tests for a second batch whose callback calls teardown() and addNFTMarkers(). Decide and document the outcome for already committed markers, and verify that nested calls are refused and the detector remains alive until its callback returns.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
NFTDetector.h says that a call back into the core from markersAdded() is refused before it changes anything, and that the outer addNFTMarkers() / setupAR2() fails. That holds for the calls made from ensureDetector(), the backfill at creation, which runs under CreatingGuard. But the per-batch call at the end of addNFTMarkers() runs outside the guard:
if (batchSize > 0 && this->detector) {
this->detector->markersAdded(markerIds, datasetPathnames);
}
From there, teardown(), setupAR2() or setCamera() is not refused. It destroys the detector while its markersAdded() is still running, which is undefined behaviour. addNFTMarkers() recurses.
Found by Qodo on #129. Introduced by #116; #124 added the guard for the creation path only. It only shows with a detector that breaks the documented contract, so it does not block 0.13.0.
To decide
When the per-batch call runs, the batch is already committed: ids are assigned and the KPM reference data is set. Returning {} at that point would report a failure for markers that are loaded. Options:
- refuse the nested call, discard the detector, log, and still return the ids, so the next
setupAR2()recreates the detector; updateNFTDetector.hto say so; - or notify before committing, and roll back if the detector re-entered.
Fix sketch
Share the RAII guard of ensureDetector() with the per-batch call. Afterwards, check creationReentered and whether the detector or the handles changed.
Test
A second batch whose markersAdded() calls teardown(), and separately addNFTMarkers(). The nested call must be refused, the detector must stay alive until its callback returns, and the outcome must match the chosen contract.
- Lenguaje dominante
- C++
- Estrellas
- 21
- Forks
- 8
- Merge medio
- 3 h 42 min
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 webarkit/WebARKitLib
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
webarkit/WebARKitLib#131 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
webarkit/WebARKitLib#114 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 93/100
webarkit/WebARKitLib#107 ·
Los mantenedores suelen responder en 1 día
-
build: native build fails with GCC 15 (ubuntu-26.04): implicit fopen64 in vendored ioapi.cPosiblemente ocupada @kalwalt la tomó hace 6 días. Abiertobug CI
webarkit/WebARKitLib#118 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
feat(nft): let a consumer supply its own NFTDetectorPosiblemente ocupada @kalwalt la tomó hace 6 días. AbiertoC/C++ code documentation Emscripten enhancement
webarkit/WebARKitLib#115 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de webarkit/WebARKitLib
Issues similares
-
bug fixed form parser medium priority tokenizer
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
compatibility prio:normal
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NatronGitHub/openfx-misc#320 ·
Los mantenedores suelen responder en 1 día
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPosiblemente ocupada @lijy91 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
libnativeapi/nativeapi#53 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
agent-ready area:analysis bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
pauljohanneskraft/Acai#609 ·
Los mantenedores suelen responder en 10 días