godot: Possible regression with validated calls?
Godot version
4.2-dev (2 versions, see below)
System information
Windows 10
Issue description
Our godot-rust CI has started failing with recent Godot master versions; there were two events. I did a bisect-style mass test run to find where exactly the behavior changed.
-
https://github.com/godotengine/godot/pull/79893, commit 4a7d49a89a381f78f19d0b989c5cb5b500f098c9, CI run This one made a particular test fail, but seems relatively deterministic. The PR looks GDScript-focused at first, but changes the way how calls work.
-
https://github.com/godotengine/godot/pull/82794, commit a6a2d0d1599835364cdf5f912f98d87c5317dd05, CI run This one fails even before actual tests are run.
It’s of course possible that we are doing something wrong, i.e. godot-rust contained a bug that was already present and only manifested now. If that’s the case, any ideas in which direction to look? Have others encountered similar issues?
For 2., we also have a stacktrace in the CI job. Click to expand...
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.dev.custom_build (a6a2d0d1599835364cdf5f912f98d87c5317dd05)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7f4f798db090] (??:0)
[2] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x4d30ce) [0x7f4f760c30ce] (??:0)
[3] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x4c16ec) [0x7f4f760b16ec] (??:0)
[4] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x52be3) [0x7f4f75c42be3] (??:0)
[5] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x1913c4) [0x7f4f75d813c4] (??:0)
[6] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x525c1) [0x7f4f75c425c1] (??:0)
[7] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0xca9c5) [0x7f4f75cba9c5] (??:0)
[8] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x41702e) [0x7f4f7600702e] (??:0)
[9] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x42c56b) [0x7f4f7601c56b] (??:0)
[10] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x402f8e) [0x7f4f75ff2f8e] (??:0)
[11] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x6d996) [0x7f4f75c5d996] (??:0)
[12] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x1c0d88) [0x7f4f75db0d88] (??:0)
[13] /home/runner/work/godot4-mass-tester/godot4-mass-tester/gdext/itest/godot/../../target/debug/libitest.so(+0x80930) [0x7f4f75c70930] (??:0)
[14] GDExtensionMethodBind::ptrcall(Object*, void const**, void*) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/extension/gdextension.cpp:255)
[15] GDExtensionMethodBind::validated_call(Object*, Variant const**, Variant*) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/extension/gdextension.cpp:242)
[16] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript_vm.cpp:1956)
[17] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript.cpp:1849)
[18] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/object/object.cpp:752)
[19] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/callable.cpp:62)
[20] _VariantCall::func_Callable_call(Variant*, Variant const**, int, Variant&, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/variant_call.cpp:1025)
[21] /home/runner/work/_temp/godot_bin/godot.linuxbsd.editor.dev.x86_64(+0x6c64dbc) [0x556be5b52dbc] (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/variant_call.cpp:2038)
[22] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/variant_call.cpp:1182)
[23] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript_vm.cpp:1668)
[24] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript.cpp:1849)
[25] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/object/object.cpp:752)
[26] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/variant_call.cpp:1168)
[27] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript_vm.cpp:1668)
[28] GDScriptFunctionState::resume(Variant const&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript_function.cpp:216)
[29] GDScriptFunctionState::_signal_callback(Variant const**, int, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/modules/gdscript/gdscript_function.cpp:157)
[30] MethodBindVarArgTR<GDScriptFunctionState, Variant>::call(Object*, Variant const**, int, Callable::CallError&) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/./core/object/method_bind.h:265 (discriminator 4))
[31] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/object/object.cpp:774)
[32] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/callable.cpp:62)
[33] CallableCustomBind::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/callable_bind.cpp:145)
[34] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/variant/callable.cpp:50)
[35] Object::emit_signalp(StringName const&, Variant const**, int) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/core/object/object.cpp:1128)
[36] Error Object::emit_signal<>(StringName const&) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/./core/object/object.h:920)
[37] SceneTree::physics_process(double) (/home/runner/work/godot4-mass-tester/godot4-mass-tester/scene/main/scene_tree.cpp:466)
[38] Main::iteration() (/home/runner/work/godot4-mass-tester/godot4-mass-tester/main/main.cpp:3550)
[39] OS_LinuxBSD::run() (/home/runner/work/godot4-mass-tester/godot4-mass-tester/platform/linuxbsd/os_linuxbsd.cpp:933)
[40] /home/runner/work/_temp/godot_bin/godot.linuxbsd.editor.dev.x86_64(main+0x193) [0x556be190a78c] (/home/runner/work/godot4-mass-tester/godot4-mass-tester/platform/linuxbsd/godot_linuxbsd.cpp:76)
[41] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f4f798bc083] (??:0)
[42] /home/runner/work/_temp/godot_bin/godot.linuxbsd.editor.dev.x86_64(_start+0x2e) [0x556be190a53e] (??:?)
-- END OF BACKTRACE --
================================================================
/home/runner/work/_temp/ab405092-db9f-4f07-939c-f211055b54cf.sh: line 8: 3196 Aborted (core dumped) $GODOT4_BIN --headless 2>&1
Steps to reproduce
Build Godot 4a7d49a89a381f78f19d0b989c5cb5b500f098c9
Build godot-rust/gdext master (a92164bb3a98108b95506f80769408583421e6dc)
Run integration test suite
Minimal reproduction project
N/A
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 3
- Comments: 16 (15 by maintainers)
I added some asserts to check for null pointers (https://github.com/lilizoey/gdextension/tree/feature/ptrcall-errors), and it appears that we’re getting null pointers as return pointers in some cases
In fact i think methods that return
Variantgets a null pointer as the return pointer. Im not entirely sure how the godot code works here, but i think the return pointer might not get initialized invalidated_callwhen doing a pointer call and the return type isVariant.@Bromeon @lilizoey Can you see if PR https://github.com/godotengine/godot/pull/83054 fixes the problem for you? I’m not sure it’s the right way to fix it (even if it fixes the problem), but it’ll show us which branch the problem is happening on