-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when loading resource on init with API 4.3 #912
Comments
Any updates on this issue? I'm happy to help explore possible solutions. |
Not from my side -- if you have time to investigate, that would be appreciated! 😊 |
Some investigation seems to point to the generation of documentation generation, where Godot attempts to instantiate my custom resource class to obtain default properties. Backtrace with a debug build of Godot 4.3:
|
It seems that MyResource is created by |
Making |
Which doc generation do you mean? The one where RustDoc is translated to Godot needs to be enabled with |
The doc generation I deduce from this part of the trace:
Interestingly enough, I do not have the feature set. I guess the generation on the gdext side is not affected, Godot itself seems to try to create an instance with a placeholder extension in order to derive default values? Not quite sure, as I can only guess from looking at the control flow. |
Minimum Example Project
https://github.com/gg-yb/gdext-crash-example
How to reproduce
In the attached example, build the extension using
cargo build
.Open the project with Godot 4.3 (make sure there is no .godot folder in the
godot/
directory)No crash is observed. Close Godot.
Notice that the
.godot
folder was created in thegodot/
directory.Open the project again, again with Godot 4.3.
The project crashes on this attempt, and any further attempt, unless the
.godot
folder is deleted.This behavior is new to API 4.3, and this pattern has been used by us for some time, see observations below.
Code Excerpt
lib.rs:
Use Case
The loaded resource is used to configure auxilliary behavior of, among others,
MyControl
in the real project.Observations
Does not occur unless API 4.3 is selected (i.e. no
features
, orfeatures = ["api-4-3"]
in Cargo.toml), so:API 4.2, Godot 4.2: No crashes
API 4.2, Godot 4.3: No crashes
API 4.3, Godot 4.3: CRASHES
The text was updated successfully, but these errors were encountered: