-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 setting exported variable with setter with deferred call to a method with a script error #58468
Comments
@tliron Please upload a minimal reproduction project to make this easier to troubleshoot.
This is intended to decrease binary size. Distributing separate debug symbols files (or builds with debug symbols) is planned, but it will take a while to happen. In the meantime, you can compile Godot from source to get an useful crash backtrace. |
I cannot upload anything minimal, as stated. Where do I get Godot 4.0 source to compile? I can't find any 4.0 tags or branches on github. |
Unfortunately, it's unlikely we can do anything about this crash, even with a backtrace. You can still post a backtrace, but I doubt anyone will be able to fix this without access to a minimal reproduction project.
The |
Thanks! Let's keep this issue open, I will try to debug it in C++. |
Here is the backtrace with symbols:
|
The backtrace is a bit weird,
|
Is there a way to disable the crash handler? Because under gdb I got the exact same signal 11 and printed backtrace, with no way to use |
You can start Godot with the |
Nevermind, didn't need to disable it:
|
A little bit of digging (let me know if you want more, this is easily reproducible for me). Also, I might be zeroing in on something small and reproducible for you. The NPE happens in a
|
Good-ish news -- I have isolated the one file that causes the crash. Here's a project: |
I can reproduce the crash with that project, though to be clear this happens when editing the "Variant Index" exported property in the Inspector specifically. It triggers an infinite loop of script errors. The error is also reported when opening the editor before any crash (probably because this code is called in
That code is indeed wrong, if there are no children, it's bound to fail: func show_variant_only():
var children = get_children()
var v = children[variant_index] if variant_index != -1 else null I'm not sure why this method is called ad lib, but that's likely why it crashes in the end.
|
This code went through a lot of iterations to work in 3.x. :) I won't be surprised if it doesn't work in 4.0. (It's been very useful for me, by the way. It allows me to select different "variations" during design time while also supporting them in runtime. Maybe I'll write a blog post about it someday.) However, I'm sure we all agree that we don't want Godot to crash in such situation, right? ;) It seems like you have what you need to debug this, but please let me know if I can assist in any way. I do have a much bigger project that uses this GDScript code. |
Yes the crash should still be looked into and solved. But for your use case specifically fixing the bugs in your script should also fix the crash. E.g. by preventing using an invalid index: func show_variant_only():
var children = get_children()
if children.size() <= variant_index: return
var v = children[variant_index] if variant_index != -1 else null Same in |
Interesting, I think this is a change from 3.x, because this code worked there -- I think it would return null if out of bounds. Anyway, I'm sure my code could be better. :) |
Still reproducible in latest |
Godot version
4.0.alpha3
System information
Fedora 35, Intel GPU
Issue description
Backtrace:
Steps to reproduce
It's very hard for me to isolate what triggered this. I am just trying to convert a game from Godot 3.x to 4.0 and tackling issues one by one. At one point Godot just starting crashing every time.
By the way, it seems like there are no debug symbols in the Godot alpha builds.
Minimal reproduction project
Bugsquad edit: MRP in #58468 (comment)
The text was updated successfully, but these errors were encountered: