Skip to content
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.2 crashes when attempting to open project from Godot 4.1.3 #85580

Closed
amarraff opened this issue Dec 1, 2023 · 21 comments
Closed

Godot 4.2 crashes when attempting to open project from Godot 4.1.3 #85580

amarraff opened this issue Dec 1, 2023 · 21 comments
Labels

Comments

@amarraff
Copy link

amarraff commented Dec 1, 2023

Godot version

v4.2.stable.official [46dc277]

System information

Godot v4.2.stable - Kubuntu 23.10 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3080 (nvidia; 535.129.03) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

Issue description

When I open Godot 4.2 it can see my 4.1.3 project and tells me that opening it will turn it into a 4.2 project. When I hit okay, Godot opens and then crashes.

Steps to reproduce

  1. Create project in Godot 4.1.3
  2. Open Godot 4.2
  3. Attempt to open the project with Godot 4.2

Minimal reproduction project

N/A

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

@amarraff related #85416 (comment)?

Hi! I'm not quite sure if that's a related issue, my issue happens before I even get into the editor.

@akien-mga
Copy link
Member

Are you using godot-jolt by any chance? If so you need to upgrade it or remove it to open in 4.2, the old version is not compatible and crashes.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

Are you using godot-jolt by any chance? If so you need to upgrade it or remove it to open in 4.2, the old version is not compatible and crashes.

I am indeed using jolt, I have scenes with jolt components in them such as hinges and cone twist joints. I tried upgrading it by redownloading it in the asset library, but that doesn't seem to have fixed the problem, unless that's not how you upgrade it. I also tried changing the physics engine to the default Godot one and then opening in 4.2, but same problem.

@akien-mga
Copy link
Member

Then you need to delete it temporarily, and wait for godot-jolt to release a version compatible with 4.2.

@OhiraKyou
Copy link

OhiraKyou commented Dec 1, 2023

Jolt 0.10.0-stable seems to work in Godot 4.2. However, the asset library's installer doesn't fully reinstall add-ons; it seem to ignore existing files rather than overwrite them.

My steps to a successful launch:

  1. Opened my project in Godot 4.1.3.
  2. Deleted the res://addons/godot-jolt/ directory using Godot's file explorer, selecting the "continue" option when prompted to continue or restart the editor.
  3. Reinstalled Jolt from the asset library.
  4. Reloaded the project in Godot 4.1.3, to reload the add-on and confirm that everything still worked and Jolt was still assigned in the project settings.
  5. Loaded the project in Godot 4.2.

@Zireael07
Copy link
Contributor

However, the asset library's installer doesn't fully reinstall add-ons; it seem to ignore existing files rather than overwrite them.

That's probably worth a separate issue in itself!

@OhiraKyou
Copy link

OhiraKyou commented Dec 1, 2023

That's probably worth a separate issue in itself!

Yeah, I spent some time searching for how to update add-ons, but the asset library only really seems to be built for installing add-ons once. I did, however, see that there were already some proposals for package dependency management improvements.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

Then you need to delete it temporarily, and wait for godot-jolt to release a version compatible with 4.2.

I don't appreciate you closing the issue when it's still a problem that the engine crashes in this situation. The engine should not crash when detecting an out of date version of a plugin. It should be able to warn the user without crashing. Is there a separate issue for this?

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

Jolt 0.10.0-stable seems to work in Godot 4.2. However, the asset library's installer doesn't fully reinstall add-ons; it seem to ignore existing files rather than overwrite them.

My steps to a successful launch:

1. Opened my project in Godot 4.1.3.

2. Deleted the `res://addons/godot-jolt/` directory using Godot's file explorer, selecting the "continue" option when prompted to continue or restart the editor.

3. Reinstalled Jolt from the asset library.

4. Reloaded the project in Godot 4.1.3, to reload the add-on and confirm that everything still worked and Jolt was still assigned in the project settings.

5. Loaded the project in Godot 4.2.

I was able to get into my project by doing this slightly differently, thank you for your steps. I moved my godot-jolt folder to my desktop as a backup and let the 4.1.3 editor save and restart. Then, I closed the editor, and opened the project successfully within 4.2. I then re-downloaded godot-jolt from within 4.2 and it is working fine despite @akien-mga claiming that I need to wait for a compatible version.

@YuriSizov
Copy link
Contributor

I don't appreciate you closing the issue when it's still a problem that the engine crashes in this situation. The engine should not crash when detecting an out of date version of a plugin. It should be able to warn the user without crashing. Is there a separate issue for this?

The engine doesn't crash. The Godot Jolt extension crashes because it runs into a null pointer exception. There is nothing we can do to prevent it from the engine side.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

I don't appreciate you closing the issue when it's still a problem that the engine crashes in this situation. The engine should not crash when detecting an out of date version of a plugin. It should be able to warn the user without crashing. Is there a separate issue for this?

The engine doesn't crash. The Godot Jolt extension crashes because it runs into a null pointer exception. There is nothing we can do to prevent it from the engine side.

Then we could have the editor scan for extensions that can cause this before the user attempts to open the project. To make it lightweight, perhaps the user has to initiate such a scan manually. Regardless of what is technically crashing, Godot does not open, causing panic in a user who wants to continue their work. This is important to the user experience. People will not want to use Godot if this happens often.

@YuriSizov
Copy link
Contributor

YuriSizov commented Dec 1, 2023

What you suggest is not realistic. It's a runtime exception caused by the implementation in the Godot Jolt project. It's not something you can scan for or detect.

This is important to the user experience. People will not want to use Godot if this happens often.

We plan to add a safe mode to the engine that disables all extensions and lets you load the project without those intervening. But if you have a problem in a 3rd party executable, there is nothing we can do to prevent it. You need to raise an issue with that project's maintainers. Thankfully, they've fixed the problem weeks ago, so all you need to do is update to the compatible version.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

What you suggest is not realistic. It's a runtime exception caused by the implementation in the Godot Jolt project. It's not something you can scan for or detect.

How is it not realistic? If Godot detects a problem with an external physics plugin it should be able to fall back to the internal Godot physics engine and warn the user.

A safe mode would be great and solve this problem, particularly if it told you what plugins and extensions may cause issues.

@YuriSizov
Copy link
Contributor

If Godot detects a problem

This part is impossible. Godot cannot "detect" a runtime exception in a compiled 3rd party library.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

If Godot detects a problem

This part is impossible. Godot cannot "detect" a runtime exception in a compiled 3rd party library.

Why? As I mentioned, you could create something to check for this that the user initiates. Perhaps an extension compatibility checker button. Godot then runs another instance of itself, turning on extensions one by one, and checks to see if any extensions make it close and reports back to the user which one(s).

@akien-mga
Copy link
Member

akien-mga commented Dec 1, 2023

We have plans to improve the resilience of the editor to bad extensions, such as godotengine/godot-proposals#2628. Another option is to somehow maintain a compatibility database for extensions and have ways to flag known bad extensions to prevent using them in specific Godot versions.

But that's outside the scope of this issue and a long term effort that should be discussed in proposals.

This issue is closed because the actionable bug was in godot-jolt and has been fixed, there's nothing we can do in Godot short term to prevent this crash.


Generally speaking, this crash is the illustration of "With great power comes great responsibility."

GDExtension is a very powerful way to inject thirdparty code in the engine. But it also means it's outside our control and bugs in GDExtension can have significant consequences such as this one.

We'll have to improve tooling to be able to protect users against buggy extensions, but for now this is the price to pay to experiment with such a powerful tool. godot-jolt is clear that it only supports Godot 4.1 currently, for this specific reason.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

We have plans to improve the resilience of the editor to bad extensions, such as godotengine/godot-proposals#2628. Another option is to somehow maintain a compatibility database for extensions and have ways to flag known bad extensions to prevent using them in specific Godot versions.

But that's outside the scope of this issue and a long term effort that should be discussed in proposals.

This issue is closed because the actionable bug was in godot-jolt and has been fixed, there's nothing we can do in Godot short term to prevent this crash.

Generally speaking, this crash is the illustration of "With great power comes great responsibility."

GDExtension is a very powerful way to inject thirdparty code in the engine. But it also means it's outside our control and bugs in GDExtension can have significant consequences such as this one.

We'll have to improve tooling to be able to protect users against buggy extensions, but for now this is the price to pay to experiment with such a powerful tool. godot-jolt is clear that it only supports Godot 4.1 currently, for this specific reason.

Yes, a safe mode that can tell you which plugins will cause problems will solve the issue.

I understand what you're saying, I appreciate that there is a focus to improve this issue. My main point is that, from the POV of a developer's user experience, having the editor close repeatedly with no knowledge of what's causing it is frustrating and concerning. I didn't know it was godot-jolt until you suggested it to me.

Respectfully, if it's known by you and other Godot devs that godot-jolt is incompatible with 4.2, and the developer of Jolt knows this (I was unaware until now), why does Godot 4.2 not detect on launch that you have jolt downloaded to your files, and warn you that it must be removed temporarily to open the project in 4.2? This seems like pretty simple solution to this headache. Perhaps it would be something that Godot can detect once a developer flags the versions of Godot their extension is compatable with. Check the current version against that version list. I can create an issue for this in Godot proposals if you'd like, unless a similar one already exists.

@akien-mga
Copy link
Member

Respectfully, if it's known by you and other Godot devs that godot-jolt is incompatible with 4.2, and the developer of Jolt knows this (I was unaware until now), why does Godot 4.2 not detect on launch that you have jolt downloaded to your files, and warn you that it must be removed temporarily to open the project in 4.2? This seems like pretty simple solution to this headache.

This can possibly be done, but this goes against the design of GDExtension. The whole point of extensions is to allow third-parties to extend the capabilities of the engine without the core Godot team being involved.

If we start hardcoding a compatibility matrix for all the third-party extensions we know of, that will be tedious work, and defeat the purpose of the system. It will also never be able to catch all scenarios, since by design we can't know of all extensions that exist in the wild, nor whether they will be compatible or not. And of course it can't catch situations which extensions which might be published after the release of a given Godot version. So it doesn't scale, and we usually don't want to start adding hacks in the engine if we know it's not a proper long term solution.

It's definitely a bummer that so many users seem to be using a version of Jolt that makes Godot 4.2 crash, and @mihe was fully aware of it and worked it around in later releases, but this is about as much as we could do with the current features in place.

We've seen how bad it can get with the current way to handle extensions on version upgrades, and so we'll keep working on improving this system so that we can handle such situations gracefully. For example with some of the features suggested above, or with a "max supported version" field that would be set by the extension developer, and automatically disable the extension by default when using it in a newer version.

@amarraff
Copy link
Author

amarraff commented Dec 1, 2023

Respectfully, if it's known by you and other Godot devs that godot-jolt is incompatible with 4.2, and the developer of Jolt knows this (I was unaware until now), why does Godot 4.2 not detect on launch that you have jolt downloaded to your files, and warn you that it must be removed temporarily to open the project in 4.2? This seems like pretty simple solution to this headache.

This can possibly be done, but this goes against the design of GDExtension. The whole point of extensions is to allow third-parties to extend the capabilities of the engine without the core Godot team being involved.

If we start hardcoding a compatibility matrix for all the third-party extensions we know of, that will be tedious work, and defeat the purpose of the system. It will also never be able to catch all scenarios, since by design we can't know of all extensions that exist in the wild, nor whether they will be compatible or not. And of course it can't catch situations which extensions which might be published after the release of a given Godot version. So it doesn't scale, and we usually don't want to start adding hacks in the engine if we know it's not a proper long term solution.

It's definitely a bummer that so many users seem to be using a version of Jolt that makes Godot 4.2 crash, and @mihe was fully aware of it and worked it around in later releases, but this is about as much as we could do with the current features in place.

We've seen how bad it can get with the current way to handle extensions on version upgrades, and so we'll keep working on improving this system so that we can handle such situations gracefully. For example with some of the features suggested above, or with a "max supported version" field that would be set by the extension developer, and automatically disable the extension by default when using it in a newer version.

I understand the design of GDExtension not requiring the Godot core team to be involved, I wasn't suggesting that they have to be for every plugin. For Godot Jolt, however, I've seen the discussion about it potentially becoming an official plugin because it's so widely used, so the core team expediting a solution to this would help a lot of developers right now who want to upgrade their project versions.

I appreciate that the issue is recognized and being worked on, thank you.

@mihe
Copy link
Contributor

mihe commented Dec 1, 2023

I don't have much to add here, besides expressing my regret over the confusion that's come about as a result of this incompatibility between these older versions of Godot Jolt and Godot 4.2.

As already hinted at in this thread, I have never officially supported anything but the latest stable version of Godot, which means anything besides the recently released version 0.11.0 has only ever supported Godot 4.1.

Sadly, any means of actually enforcing this was (until Godot 4.2) largely out of my control, but going forward you won't be able to load Godot Jolt on anything but the officially supported version of Godot, with a hopefully helpful error message instead of a crash, thanks to some recent changes to GDExtension.

I will also admit that I've done a pretty terrible job of communicating what version is or isn't supported. It has admittedly been mentioned (albeit phrased poorly) on the GitHub page since the beginning, as well as all release notes on GitHub, but much to my dismay nobody actually reads that stuff.

I used to mention the officially supported version in the Godot Asset Library description as well, but I removed it due to feeling like it was redundant given that I already specify the Godot version in the asset's settings, but seeing as how you can still download a Godot 4.1 asset through Godot 4.2 I guess that's treated as a minimum version, or perhaps just a visual thing? Either way, that was in hindsight a bad call on my part.

@amarraff
Copy link
Author

amarraff commented Dec 2, 2023

I don't have much to add here, besides expressing my regret over the confusion that's come about as a result of this incompatibility between these older versions of Godot Jolt and Godot 4.2.

As already hinted at in this thread, I have never officially supported anything but the latest stable version of Godot, which means anything besides the recently released version 0.11.0 has only ever supported Godot 4.1.

Sadly, any means of actually enforcing this was (until Godot 4.2) largely out of my control, but going forward you won't be able to load Godot Jolt on anything but the officially supported version of Godot, with a hopefully helpful error message instead of a crash, thanks to some recent changes to GDExtension.

I will also admit that I've done a pretty terrible job of communicating what version is or isn't supported. It has admittedly been mentioned (albeit phrased poorly) on the GitHub page since the beginning, as well as all release notes on GitHub, but much to my dismay nobody actually reads that stuff.

I used to mention the officially supported version in the Godot Asset Library description as well, but I removed it due to feeling like it was redundant given that I already specify the Godot version in the asset's settings, but seeing as how you can still download a Godot 4.1 asset through Godot 4.2 I guess that's treated as a minimum version, or perhaps just a visual thing? Either way, that was in hindsight a bad call on my part.

No worries at all, thank you for all your hard work! Happy to hear it’s going to work better moving forward 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants