Closed int-72h closed 2 months ago
I'm not familiar with that API, but note that both Godot and godot-cpp disable exceptions out of the box since 4.2-stable. For godot-cpp: https://github.com/godotengine/godot-cpp/pull/1216
Are you building Godot and godot-cpp with disable_exceptions=no
?
You mention it worked in 4.2.2, were you using the godot-4.2.2-stable
tag of godot-cpp, or an earlier version with updated extension API json (which might not have had exceptions disabled in the SCons code).
I checked the MRP and I see you're passing -fexceptions
explicitly, and you're lucky that it ends after the -fno-exceptions
defined by godot-cpp by default. I would recommend using env["disable_exceptions"] = False
instead.
Original MRP commit for godot-cpp:
g++ -o godot-cpp/gen/src/classes/audio_stream.linux.template_debug.x86_64.o -c -fno-gnu-unique -fno-exceptions -std=c++17 -fPIC -Wwrite-strings -m64 -march=x86-64 -O2 -fvisibility=hidden -fexceptions -DHOT_RELOAD_ENABLED -DLINUX_ENABLED -DUNIX_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Igodot-cpp/src godot-cpp/gen/src/classes/audio_stream.cpp
godot-4.3-stable
g++ -o godot-cpp/gen/src/classes/expression.linux.template_debug.x86_64.o -c -fno-gnu-unique -std=c++17 -fno-exceptions -fPIC -Wwrite-strings -m64 -march=x86-64 -fvisibility=hidden -O2 -fexceptions -DLINUX_ENABLED -DUNIX_ENABLED -DTHREADS_ENABLED -DHOT_RELOAD_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -DGDEXTENSION -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Igodot-cpp/src godot-cpp/gen/src/classes/expression.cpp
So it should work fine in both cases, the problem must be something else.
I'll move this to godot-cpp
as it's not established yet that it's a Godot bug, and not a godot-cpp one or config change.
I was using the latest version of godot-cpp in both instances (as that's what the example project does). The build of 4.3.stable was obtained from the Arch Linux repos, the 4.2.2.stable build from the archive.
I'll try testing this with 4.3.stable from the archive as well, but I don't believe this is a config issue since an exception is thrown in both cases, if there wasn't an exception handler at all it would presumably just crash with zero mention of an exception.
I was using the latest version of godot-cpp in both instances (as that's what the example project does). The build of 4.3.stable was obtained from the Arch Linux repos, the 4.2.2.stable build from the archive.
I'll try testing this with 4.3.stable from the archive as well, but I don't believe this is a config issue since an exception is thrown in both cases, if there wasn't an exception handler at all it would presumably just crash with zero mention of an exception.
I stand corrected. The version from the arch repository doesn't work, however the version from the godot repos works fine. Closing, reopening if it somehow turns out to be a godot bug.
The Godot package on Arch Linux is known to have some problems with GDExtension:
https://gitlab.archlinux.org/archlinux/packaging/packages/godot/-/issues/2
Folks have reported that using the official builds or their own custom builds of Godot seem to work fine.
Tested versions
System information
Arch Linux - Ryzen 5 5600X (x86_64)
Issue description
The C++ function
std::set_terminate
sets the termination function when an exception's not handled. In Godot 4.3.stable, this function doesn't seem to do anything: the stock termination handler is always used. In 4.2.2.stable, this issue isn't there - the function is called. This doesn't seem to depend on the version of godot_cpp - same version is used (latest) therefore the bug's in the main engine presumably.Steps to reproduce
git submodule update --init
to obtain godot-cppMinimal reproduction project (MRP)
mrp.zip