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

4.2 Beta 2 crashes when opening a 4.1.2 project #83873

Closed
macryc opened this issue Oct 24, 2023 · 11 comments
Closed

4.2 Beta 2 crashes when opening a 4.1.2 project #83873

macryc opened this issue Oct 24, 2023 · 11 comments

Comments

@macryc
Copy link

macryc commented Oct 24, 2023

Godot version

4.2 Beta 2

System information

Win 11, RTX 2070 mobile, i7

Issue description

I have a fairly mature project with lots of resources (meshes, textures).
When I try opening in in 4.2 Beta 2 the engine crashes.
When I run the engine with the console, on every 3rd or so attempt I am able to open the project in the editor but I cannot run the game - it always crashes.
The console is showing a wall of warnings about mesh surface updates and some errors about the vertex count not matching. All errors seem to be related to mesh import.
I noticed that even after successfully opening the project in the editor and trying to run the game, the same errors and warnings flood the console again, as if the reimport didn't do anything...
This is what the console usually looks like before crashing:
image

Steps to reproduce

n/a

Minimal reproduction project

n/a

@YuriSizov
Copy link
Contributor

YuriSizov commented Oct 24, 2023

The warnings are expected. The internal mesh format was changed in 4.2, but older version is still supported (it gets auto-converted on load). You need to re-import all external meshes and re-save all internal meshes once to permanently convert them to the new format. Beta 3 will come with a dialog that offers to do it automatically for you.

The only error in this screenshot should be investigated, but we would need something to test. Please try to create a reproduction project. It may have been fixed by various fixes to the mesh convertor in Beta 3 as well. Although, the error in the screenshot may not be related to crash, since there are still logs after it.

@YuriSizov YuriSizov added this to the 4.2 milestone Oct 24, 2023
@akien-mga
Copy link
Member

Please try 4.2 beta 3 and let us know if that solves it, or if the bug changes.
https://godotengine.org/article/dev-snapshot-godot-4-2-beta-3/

@macryc
Copy link
Author

macryc commented Oct 25, 2023

Unfortunately it still crashes.

When I select upgrade and resave in the dialog box, Godot is able to reimport all assets and tscns. Next it 'attempts to re-save' them. Progresses to about 65% and then crashes. The ERROR in the console looks like this:
image

Curiously, I am able to open the project if I select the 'just upgrade' option. This would suggest that the new compression does work, but the engine is unable to save the updated meshes afterward.

I identified the tscn which is problematic (at least I think so - it's the one that is re-saving while the engine crashes). I opened it in the editor without issues. Once again, I manually reimported all meshes in that scene, then saved it. Afterwards I tried opening the project again with 'update and re-save' option but it crashed again while trying to resave exact same tscn.

I'm not sure how to proceed. I also don't understand why Godot has to run through the full set of assets and resources every time, even though it's already successfully updated and re-saved 65% of them the last time it opened??

@akien-mga
Copy link
Member

Would you be able to compile Godot from source to get more debug information about the crash?

The error messages may be an indication of what causes the crash, but not necessarily. Most errors in Godot are recoverable and don't lead to crashes, so the cause for the crash may be unrelated.

If you have a compiler set up, you can compile with scons dev_build=yes windows_subsystem=console which should help ensure you get a stacktrace with debug symbols in the console.

@macryc
Copy link
Author

macryc commented Oct 26, 2023

I've never done this so I don't know how.

Also, I need to correct a statement I made above: 4.2 Beta 3 is NOT able to update all meshes. It seems like it fails to update some of them and then crashes while trying to re-save those tscn's that contain the problematic meshes.

Would it be possible to have the mesh reimporter only re-save those tscn's which it has successfully upgraded, and list those that it couldn't resave so we could troubleshoot?

Currently, Beta 3 is unusable for me. It can't upgrade and resave without crashing. If I select the 'just upgrade' option, it will open the project and crash a few seconds later (probably because it's unable to cope with un-upgraded meshes).

I also get things like this in the console.
image
Without knowing which of the 1892 meshes in my project this is referring to it's not very helpful.

@macryc
Copy link
Author

macryc commented Oct 26, 2023

Following many frustrating hours I think I've identified the context in which the problem occurs. It's when an imported array mesh was saved as a .res, and used as Mesh in other MeshInstace3D nodes. It's as if the engine was unable to parse a .res. It is also possible that those meshes were saved into .res (or .tres) way back when (ie, even before the previous mesh format change which took place when 4.0 was in beta if I recall correctly). It's hard to say as I have many hundreds of meshes in my project, and dozens .res meshes which are reused across multiple tscn's and some of those resources were ported from 3.x (and never used since).

The other problem I noticed today is that Beta 3 prompts the upgrade of meshes even when it has successfully upgraded and resaved all of them previously. If you add any importable resource into your project folder and launch it, Godot will pop up the dialog once again. If you go for 'upgrade and resave', it will run through everything once again. Should it not 'remember' which resources it's already upgraded and resaved before?

@QbieShay
Copy link
Contributor

MRP in here: #84026

@akien-mga
Copy link
Member

akien-mga commented Oct 27, 2023

@macryc I made a Windows build with debug symbols (note it's 1.8 GB unzipped):

https://downloads.tuxfamily.org/godotengine/testing/Godot_v4.2-beta_win64_debugsyms.zip

Could you see if it gives you a usable stacktrace in the terminal when it crashes?

Edit: And now there's a fix for the possibly related #84026, could you test the Windows editor artifact from #84047?
Scroll to the bottom of https://github.com/godotengine/godot/actions/runs/6665965356?pr=84047 to find it.

@macryc
Copy link
Author

macryc commented Oct 28, 2023

OK, tried the 1.8GB build but the terminal shows nothing.
The only thing that's different is that I see this after crash:
image

@macryc
Copy link
Author

macryc commented Oct 28, 2023

Edit: And now there's a fix for the possibly related #84026, could you test the Windows editor artifact from #84047? Scroll to the bottom of https://github.com/godotengine/godot/actions/runs/6665965356?pr=84047 to find it.

Just tested this. Indeed, it works. The project that previously crashed opens without a hiccup and all the meshes seem to be intact. Yay!

@akien-mga
Copy link
Member

Awesome, fixed by #84047 then!

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

No branches or pull requests

4 participants