Skip to content

Packed Scene Instantiation C++ error: seemingly empty values followed by hard crash #106934

Closed as not planned
@isikdos

Description

@isikdos

Tested versions

  • Present in at the very least 4.2 onwards, didn't use any earlier version

System information

Godot v4.4.stable.mono - Windows 10 (build 19045) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.7640) - AMD Ryzen 5 5600X 6-Core Processor (12 threads)

Issue description

Seemingly at random, averaging once per ~2 hours of gameplay, the game crashes with the following error:

ERROR: Cannot get class ''. at: _instantiate_internal (core/object/class_db.cpp:549) WARNING: Node of type cannot be created. A placeholder will be created instead. at: instantiate (scene/resources/packed_scene.cpp:276) ERROR: Cannot get class ''. at: _instantiate_internal (core/object/class_db.cpp:549) WARNING: Node of type cannot be created. A placeholder will be created instead. at: instantiate (scene/resources/packed_scene.cpp:276)

This is similar to other errors I've seen online, except they actually get class names and node types in their errors.

A cursory and naive reading of the source code suggests some sort of out of bounds indexing problem or something?

My use of scene instantiating looks like

var my_var = GD.Load<PackedScene>("res://" + hintName + ".tscn").Instantiate();

With a mix of hard coded and dynamic values. I don't really make use of running GD.Load ahead of time, because my understanding is the results are cached, so I call it every time for every instantiation. Not sure if that's a possible problem.

Steps to reproduce

Unfortunately I cannot reliably cause it to happen, other than asking my friends to play it with me until it hits one of us. An the source is pretty large. If you have questions about any instantiation patterns, I can provide them here. In the meantime, I'm adding logging to see if there's a pattern about which resources cause a crash

Minimal reproduction project (MRP)

Apologies, without a good way of reproducing the issue at the moment, uploading the whole source seems aggressive.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions