Godot Engine

Godot Engine

ringi Apr 30, 2024 @ 2:59pm
Keeps crashing
Every time I try to do something, I do 2 things and it crashes. Is this happening to someone else or should I go back to Unreal lmao?
< >
Showing 1-5 of 5 comments
jagholin May 1, 2024 @ 12:54am 
No, it's just you.
I observed that the godot editor is not really protected against errors that happen in plugins, @tool scripts or other such places(and if you use GDExtension, it also behaves like a tool script). So if one of them crashes or freezes, it will cause crash/freeze of the editor, too.
JAGIELSKI May 7, 2024 @ 4:22am 
Originally posted by jagholin:
No, it's just you.
I observed that the godot editor is not really protected against errors that happen in plugins, @tool scripts or other such places(and if you use GDExtension, it also behaves like a tool script). So if one of them crashes or freezes, it will cause crash/freeze of the editor, too.
Perhaps it'd be worth the effort to raise this as an issue on Github and then create a PR to fix it (e.g. by limiting the execution time of tool scripts/infinite loop detection to prevent freezes and catching all the exceptions in scripts that would otherwise crash the app, possibly with an error, but without a crash)? Not that I have enough knowledge to do it myself, just know enough to know how more or less it could be fixed.
jagholin May 10, 2024 @ 11:57am 
Yea I think that the devil is in the details here. You can't really restrict execution time of things too much, and there isn't really any way to separate frozen program from a program that just takes too long this time. Imagine a tool that edits a bunch of files being interrupted because disc IO took too long - you will end up with some files edited, others not, and maybe even some data corruption/loss. So this is even not an option

And with errors that result in editor crash you have similar problem - suppose you catch the error that the faulty script has caused, what do you do now? The error has already happened at this point, and you have to assume that the editor state is already compromised, so the only sensible action it can take is to crash anyway.

And it's not like godot editor invented the concept of allowing the user to reprogram itself while it is running. Every other program that I know that has the same mechanism runs into the same problems. There is no known cure, and the only thing you can do is to be very careful.
JAGIELSKI May 11, 2024 @ 9:33am 
The known cure is to detect infinite loops (loops where conditions will never be met or has already been made to not be able to be met, such as e.g. while (variable<34) {}, but there's no code in the loop that changes the variable so the loop will literally never end as long as variable is under 34 when it begins) and swallowing every exception that could cause a crash (most likely some null-related one).
jagholin May 12, 2024 @ 3:11pm 
Originally posted by Singing Dragon 69:
The known cure is to detect infinite loops (loops where conditions will never be met or has already been made to not be able to be met, such as e.g. while (variable<34) {}, but there's no code in the loop that changes the variable so the loop will literally never end as long as variable is under 34 when it begins) and swallowing every exception that could cause a crash (most likely some null-related one).
neither of your suggested options will work.
It is not even theoretically possible to distinguish program that froze from one that just takes a bit longer to finish its task, because the general case is the halting problem. In some more specific scenarios, you can do static code analysis to try catch issues like the one you mentioned, but it will never detect every possible problem, and the static analysis itself is very hard even if you limit yourself to some common cases.
And just swallowing exceptions is a very bad idea. You don't know why the exception happened, what caused it, and most likely the program state is corrupted and unusable. The *only* sensible thing to do in this situation is to crash, maybe with a little more fanfare, otherwise you will suffer any kind of undefined behavior, data loss included.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Apr 30, 2024 @ 2:59pm
Posts: 5