enu icon indicating copy to clipboard operation
enu copied to clipboard

Dev build crashes on quit with SafeRefCount unreference error

Open dsrw opened this issue 2 months ago • 1 comments

The Godot dev build (built with dev_build=yes) crashes on quit with a refcount error. The dev build also causes performance issues and slow startup times.

Reproduction

cd app && ../vendor/godot/bin/godot.macos.editor.dev.arm64 --quit-after 1 scenes/game.tscn

Error Message

ERROR: Trying to unreference a SafeRefCount which is already zero is wrong and a symptom of it being misused.
Upon a SafeRefCount reaching zero any object whose lifetime is tied to it, as well as the ref count itself, must be destroyed.
Moreover, to guarantee that, no multiple threads should be racing to do the final unreferencing to zero.
   at: _check_unref_safety (./core/templates/safe_refcount.h:189)

Stack Trace

handle_crash: Program crashed with signal 5
Traceback (most recent call last)
.../gdext/private/internalbridge.nim(84) free_instance_func
.../gdext/builtinindex.nim(424) =destroy
.../lib/system.nim(442) hook_unreference
SIGABRT: Abnormal termination.

The crash occurs during shutdown in the Nim reference counting cleanup. This appears to be a legitimate bug in our gdext integration that needs investigation. For now, we're defaulting to non-dev builds to avoid the crash and performance issues.

dsrw avatar Oct 08 '25 03:10 dsrw