Hot reload decrements refcounted objects refcount, causing a crash.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 50/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C++
- Estrellas
- 2.7k
- Forks
- 818
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 godotengine/godot-cpp
-
Building gdextensions with lto=full warns about serial compilatonPosiblemente ocupada @marcozee03 la tomó hace 35 días. Abiertoenhancement topic:buildsystem
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
godotengine/godot-cpp#2002 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
godotengine/godot-cpp#1969 · 4 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
godotengine/godot-cpp#1967 ·
-
enhancement topic:buildsystem tracker
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
godotengine/godot-cpp#2064 · 1 reacción ·
-
`api_version` errorAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
godotengine/godot-cpp#2062 · 2 comentarios ·
Todos los issues de godotengine/godot-cpp
Issues similares
-
torch_ops/logprob.cu does not compile with the serving container's nvcc (13.3.73); check_torch_ops.py cannot run as shippedPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 72/100
ashhart/TensorFold#535 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
agent:Windows bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día