-
Notifications
You must be signed in to change notification settings - Fork 19
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
Godot 4.3: crash when using ControllerIconTexture as external resource file on macOS #101
Comments
Another note: if I recreate the same resource after starting without it (except for new auto-generated IDs, of course), the editor works fine until the next restart. But when I used the "duplicate file" feature, the editor crashed again. I've also managed to create a small reproducible project by creating two resource files: test-crash.zip (that's only the project without addons folder) |
I've managed to run the editor and the game by commenting controller_icons/addons/controller_icons/objects/ControllerIconTexture.gd Lines 174 to 179 in a102147
|
Thank you for your detailed report! Definitely seems to be an issue regarding multi-threading, since AFAIK resource preview generation on the editor happens on a separate thread. It's interesting that you mention this occurs with 4.3 now; although probably for different reason, there is a related crash happening on another project on similar circumstances. In that case, the regression was introduced on v4.3.beta1, with the latest working version being v4.3.dev6. Can you test that version (v4.3.dev6) to check if it also stops crashing on your case? |
Yeah, my test case works on
I've also built fixes from this PR from related issue: godotengine/godot#94169 I'll try to bisect the problem commit between dev6 and beta1 later today. |
This commit is what started the malloc crashes: godotengine/godot@187e5ef |
Damn, I've just wasted a couple of hours to independently find a reference to the same issues you've already mentioned :D So the summary is (as far as I understand):
If not being able to run this code on the main thread is the new normal for loading resources, then the fix from this PR should help #96 (I've tried it on my case, works fine) I've also tried cherry-picking the two PRs mentioned in this one godotengine/godot#95186 (godotengine/godot#94169, godotengine/godot#93336) on top 4.3-stable — still still crashes :( |
I've researched a bit more regarding this, and while I initially thought this instance was an engine bug, it doesn't appear to be the case. Although there's basically no documentation for This was handled in the past (#82) by using a Could you give this a try to ensure the crash is now fixed, please? |
Thanks for the deep dive! This version works great in my case! |
Context: I'm running Godot 4.3 (official build, also tried on a build with debug symbols) on M1 Pro (macOS 14.5) with two keyboard layouts installed.
I've tried migrating my existing project to 4.3 and encountered an editor crash, which I've pinpointed to a single
ControllerIconTexture
saved as.tres
file (which I use in a RichTextLabel). The editor starts to load, produces someGenerated 'res://%resourcename%' preview in N usec
entries, and then crashes.I have many instances of
ControllerIconTexture
used as built-in scene resources, and the crash only happens with the external resource.Here's the resource file:
The
special
action is currently mapped to physicalShift
, but the particular key doesn't seem to matter much.If I delete either this single resource file or the
special
keyboard key from the Input Map (and leave the controller key, for example), everything works fine.After looking at the backtrace, I've found that the problem happens on this line in the call to
DisplayServer.keyboard_get_keycode_from_physical()
:controller_icons/addons/controller_icons/ControllerIcons.gd
Line 364 in a102147
If I comment this call and use something like
return _convert_key_to_path(event.physical_keycode)
, the crash disappears.I'm unable to reproduce this crash on a smaller scale yet. Since the crash started happening after migration to 4.3, it's probably best to also report it to the engine maintainers, but I'm lacking the needed context right now. @rsubtil maybe you would have an idea about the root cause?
Here's the crash log from the editor:
The text was updated successfully, but these errors were encountered: