Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Hot reload decrements refcounted objects refcount, causing a crash.

Aperta
#2,059 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@agoaj ci sta già lavorando.

Dal 4/10/2026.

  • #2060 di @agoaj — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, godot
Ambito
game-dev

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di godotengine/godot-cpp

Tutte le issue di godotengine/godot-cpp

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.