fix(nft): the per-batch markersAdded() call is not guarded against re-entry
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
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 21
- Fork
- 8
- Merge medio
- 3h 42m
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 webarkit/WebARKitLib
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
webarkit/WebARKitLib#131 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
webarkit/WebARKitLib#114 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 93/100
webarkit/WebARKitLib#107 ·
I maintainer di solito rispondono entro 1 giorno
-
build: native build fails with GCC 15 (ubuntu-26.04): implicit fopen64 in vendored ioapi.cForse già presa @kalwalt l’ha presa 6 giorni fa. Apertabug CI
webarkit/WebARKitLib#118 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
feat(nft): let a consumer supply its own NFTDetectorForse già presa @kalwalt l’ha presa 6 giorni fa. ApertaC/C++ code documentation Emscripten enhancement
webarkit/WebARKitLib#115 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di webarkit/WebARKitLib
Issue simili
-
bug fixed form parser medium priority tokenizer
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
compatibility prio:normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NatronGitHub/openfx-misc#320 ·
I maintainer di solito rispondono entro 1 giorno
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaForse già presa @lijy91 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
libnativeapi/nativeapi#53 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
agent-ready area:analysis bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
pauljohanneskraft/Acai#609 ·
I maintainer di solito rispondono entro 10 giorni