Skip to content

Using scons in release, crash when initializing gdextension. #1854

@whileload

Description

@whileload

Godot version

4.5

godot-cpp version

4.5

System information

Windows 10

Issue description

I used two compilers: msvc and llvm.
Build via CMake works.

Possibly related.
godotengine/godot#64897
My comment there:
godotengine/godot#64897 (comment)

Steps to reproduce

scons platform=windows target=template_release

Even with an empty extension, where there is only an initialization function.

using namespace godot;

void initialize_gdextension_types(ModuleInitializationLevel p_level) {
	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
		return;
	}

}

void uninitialize_gdextension_types(ModuleInitializationLevel p_level) {
	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
		return;
	}
}

extern "C" {
// Initialization
GDExtensionBool GDE_EXPORT
resouls_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address,
		GDExtensionClassLibraryPtr p_library,
		GDExtensionInitialization *r_initialization) {
	GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library,
			r_initialization);
	init_obj.register_initializer(initialize_gdextension_types);
	init_obj.register_terminator(uninitialize_gdextension_types);
	init_obj.set_minimum_library_initialization_level(
			MODULE_INITIALIZATION_LEVEL_SCENE);

	// There is a crash in this function. 
	GDExtensionBool r = init_obj.init();


	return r;
}
}

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions