Hi,

I'm writing a gdextension and trying to debug it on Linux. I'm unable to catch a crash or stop at breakpoints, they're just ignored. I've checked the following:

  • Disable ptrace security
  • Build godot in debug mode
  • Build godot-cpp & gdextension with -g -O0
  • Tried starting godot inside gdb and attaching to an already running instance
  • Checked library symbols in gdb with "info sharelibrary", my lib appears with symbols
  • Checked function symbol "info function myFunction", seems fine
  • Set a breakpoint "break myFunction". Breakpoint is set at the correct file and line
  • Check I'm catching the crash signal "handle SIGSEGV stop"

When I try to run my test suite with GUT, I'm getting a signal 11 "SIGSEGV" crash which isn't being caught by gdb. Godot produces a backtrace which shows good debug symbols for the engine and my lib, except there's no filenames or line numbers for my lib:

[1] /usr/lib/libc.so.6(+0x3d1d0) [0x7990f764b1d0] (??:0)
[2] godot::LootEntry::getRarity() const (??:0)
[3] godot::LootManager::lootCreature(godot::CreaturePrefab*, unsigned long) (??:0)
[4] void godot::call_with_variant_args_ret_helper<godot::_gde_UnexistingClass, godot::LootResult*, godot::CreaturePrefab*, unsigned long, 0ul, 1ul>(godot::_gde_UnexistingClass*, godot::LootResult* (godot::_gde_UnexistingClass::*)(godot::CreaturePrefab*, unsigned long), godot::Variant const**, godot::Variant&, GDExtensionCallError&, IndexSequence<0ul, 1ul>) (??:0)
[5] void godot::call_with_variant_args_ret_dv<godot::_gde_UnexistingClass, godot::LootResult*, godot::CreaturePrefab*, unsigned long>(godot::_gde_UnexistingClass*, godot::LootResult* (godot::_gde_UnexistingClass::*)(godot::CreaturePrefab*, unsigned long), void const* const*, int, godot::Variant&, GDExtensionCallError&, std::vector<godot::Variant, std::allocator<godot::Variant> > const&) (??:0)
[6] godot::MethodBindTR<godot::LootResult*, godot::CreaturePrefab*, unsigned long>::call(void*, void const* const*, long, GDExtensionCallError&) const (??:0)
[7] godot::MethodBind::bind_call(void*, void*, void const* const*, long, void*, GDExtensionCallError*) (??:0)
[8] GDExtensionMethodBind::call(Object*, Variant const**, int, Callable::CallError&) const (/home/user/godot/core/extension/gdextension.cpp:251)
[9] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:811 (discriminator 1))
[10] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/user/godot/core/variant/variant_call.cpp:1211 (discriminator 2))
[11] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/user/godot/modules/gdscript/gdscript_vm.cpp:1752)
[12] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/modules/gdscript/gdscript.cpp:2032 (discriminator 1))
[13] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:789 (discriminator 1))
[14] Object::_call_bind(Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:618)
[15] MethodBindVarArgTR<Object, Variant>::call(Object*, Variant const**, int, Callable::CallError&) const (/home/user/godot/./core/object/method_bind.h:272)
[16] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:811 (discriminator 1))
[17] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/user/godot/core/variant/variant_call.cpp:1211 (discriminator 2))
[18] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/user/godot/modules/gdscript/gdscript_vm.cpp:1752)
[19] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/modules/gdscript/gdscript.cpp:2032 (discriminator 1))
[20] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:789 (discriminator 1))
[21] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/user/godot/core/variant/variant_call.cpp:1211 (discriminator 2))
[22] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/user/godot/modules/gdscript/gdscript_vm.cpp:1752)
[23] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/modules/gdscript/gdscript.cpp:2032 (discriminator 1))
[24] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:789 (discriminator 1))
[25] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/user/godot/core/variant/variant_call.cpp:1211 (discriminator 2))
[26] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/user/godot/modules/gdscript/gdscript_vm.cpp:1781)
[27] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/modules/gdscript/gdscript.cpp:2032 (discriminator 1))
[28] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:789 (discriminator 1))
[29] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/user/godot/core/variant/variant_call.cpp:1211 (discriminator 2))
[30] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/user/godot/modules/gdscript/gdscript_vm.cpp:1781)
[31] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/modules/gdscript/gdscript.cpp:2032 (discriminator 1))
[32] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/user/godot/core/object/object.cpp:789 (discriminator 1))
[33] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/user/godot/core/variant/callable.cpp:69 (discriminator 1))
[34] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (/home/user/godot/core/object/message_queue.cpp:221)
[35] CallQueue::flush() (/home/user/godot/core/object/message_queue.cpp:270)
[36] SceneTree::physics_process(double) (/home/user/godot/scene/main/scene_tree.cpp:494)
[37] Main::iteration() (/home/user/godot/main/main.cpp:4113 (discriminator 3))
[38] OS_LinuxBSD::run() (/home/user/godot/platform/linuxbsd/os_linuxbsd.cpp:962 (discriminator 1))
[39] /home/user/godot/bin/godot.linuxbsd.editor.dev.x86_64(main+0x18c) [0x593878a63555] (/home/user/godot/platform/linuxbsd/godot_linuxbsd.cpp:85)
[40] /usr/lib/libc.so.6(+0x25e08) [0x7990f7633e08] (??:0)
[41] /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x7990f7633ecc] (??:0)
[42] /home/user/godot/bin/godot.linuxbsd.editor.dev.x86_64(_start+0x25) [0x593878a632f5] (??:?)

I'm running godot with verbose and debug flags, there's no additional information printed in the console beyond the backtrace.

I can't think of anything else I'm missing, any help is appreciated. I really need to step through my function to figure out why I'm crashing.