Hot reload decrements refcounted objects refcount, causing a crash.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
Start with the provided hot-reload-refcount-bug.zip reproduction and run it with the godot-cpp submodule initialized and hot reload enabled through CMake or SCons. Read SafeRefCount::_check_unref_safety and trace what happens to a Ref<> resource with a refcount of 1 during reload. Done means the same reload no longer decrements an already-zero refcount or crashes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Godot version
4.7.1
godot-cpp version
507ed9d
System information
Windows 11, Kubuntu amd64
Issue description
Hot reloading would cause random crashes. Running a godot debug build it would trigger a crash condition in SafeRefCount::_check_unref_safety with this message:
"Upon a SafeRefCount reaching zero any object whose lifetime is tied to it, as well as the ref count itself, must be destroyed.\n"
"Moreover, to guarantee that, no multiple threads should be racing to do the final unreferencing to zero."
Steps to reproduce
The gist of reproducing the issue is to have a Ref<> to a resource with a refcount of 1. On hot reload this will crash.
The easiest way to set this up was to create a Node in the scene that holds a Ref to a resource. One hot reload should trigger a crash.
Minimal reproduction project
hot-reload-refcount-bug.zip
Extract this zip, init the godot-cpp submodule, run the cmake project or build modules with scons with hot reload enabled.
Open the project in godot.
Make a whitespace change in the extension source, recompile the module.
Return to the opened project in godot to trigger hot reload, it should crash.
- Lingua principale
- C++
- Stelle
- 2.7k
- Fork
- 813
- Merge medio
- 1h 31m
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 godotengine/godot-cpp
-
Building gdextensions with lto=full warns about serial compilatonForse già presa @marcozee03 l’ha presa 32 giorni fa. Apertaenhancement topic:buildsystem
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
godotengine/godot-cpp#2002 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
godotengine/godot-cpp#1969 · 4 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
godotengine/godot-cpp#1967 ·
-
`api_version` errorAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
godotengine/godot-cpp#2062 · 2 commenti ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
godotengine/godot-cpp#2042 ·
Tutte le issue di godotengine/godot-cpp
Issue simili
-
feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gavinlouuu-kpt/mib-studio-qt#517 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
ws_bridge: stripping format=evr for matchmaker connections can concatenate the path and queryApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
EchoTools/nevr-runtime#116 ·
I maintainer di solito rispondono entro 1 giorno