Godot-cpp GDExtension - Crash without error on queue_free, only for template_release

Godot Version

4.5.2.stable

Question

The GDExtension I’m making with Godot-cpp crashes without any errors when I call it’s node queue.free() but only when I compile it with target=template_release. How do I debug something like this?

I think that the problem might be on using = default for the destructors, even though it works for the debug without any warnings or errors. I tried adding UtilityFunction::print() statements to the destructors to check if they’re called, but the crash happens before I see anything in the console.

Attach debugger, look at stacktrace, though you mentioned that it doesn’t provide errors, so then i would be breaking just before the deletion and stepping through the code. You will need a godot compiled with symbols to make sense of the stacktrace.

The times I see this sort of thing for myself is when i have an infinite loop, or something weird with memory. i highly doubt its because of defaulting the destructor, that would leave dangling pointers at worst, not immediately crash your application.

Thank you, I’ll try that!

if you find a solution to your issue, try to report back on the steps you took to solve so that if someone else stumbles across this later they can follow in your footsteps.

Don’t worry, when I do, I will! Might take a few days for me to get to it, though.