Skip to content

Dev build crashes on quit with SafeRefCount unreference error #43

@dsrw

Description

@dsrw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions