godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.75k stars 20.12k forks source link

[4.0 beta17 mono] Editor crashes when opening project #72580

Open jmpichardo opened 1 year ago

jmpichardo commented 1 year ago

Godot version

v4.0-beta17_mono_win64

System information

Windows 10, Forward+, RTX 3080, dotnet 6.0.101

Issue description

The editor crashes when opening a project. No log is showed in the console.

Deleting the .godot folder from the project will allow to open it in Godot again. This will re-generating the folder again, and after that when trying to open again it will crash.

Steps to reproduce

  1. Open a project
  2. Close Godot
  3. Open the same project again
  4. CRASH!
  5. Delete .godot folder from the project
  6. Open the same project again
  7. It works! (.godot folder is generated again)
  8. Close Godot
  9. Open the same project again
  10. CRASH!

Minimal reproduction project

testing-godot.zip

jmpichardo commented 1 year ago

To continue with the testing, I went down to v4.0-beta16_mono_win64 and this issue happens there as well.

So, I went back to v4.0-beta15_mono_win64 again (sadly reverting all nice new C# syntax changes 😢), and there everything works perfectly.

akien-mga commented 1 year ago

I can't reproduce the issue with the provided project, using either 4.0 beta 16 or beta 17 mono on Linux.

I have dotnet 6.0.404, yours seems more than one year old, might be worth updating just in case?

Does it work if you delete the .mono folder?

jmpichardo commented 1 year ago

I updated dotnet to 6.0.405, then complete removed .godot folder from the project and still crashes in beta17.

Maybe this happens in Windows 10 only?

akien-mga commented 1 year ago

It's possible. Do you see any logs if you run Godot using the *_console.exe executable?

Can you paste the output of dotnet --info?

jmpichardo commented 1 year ago

dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.405
 Commit:    27ab36058b

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.405\

global.json file:
  Not found

Host:
  Version:      6.0.13
  Architecture: x64
  Commit:       1af80ba017

.NET SDKs installed:
  6.0.101 [C:\Program Files\dotnet\sdk]
  6.0.405 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

Console's output:

imagen

After this, the project crashes and the editor and console gets closed.

More details from Window's logs:

imagen

imagen

jmpichardo commented 1 year ago

nvoglv64.dll seems to be from Nvidia, so I updated my graphic card drivers and it works now!

Strange, because the previous drivers weren't that old (mid 2022), I wonder what changed after beta16 to make this to start crashing or maybe it was a bug in the drivers itself that was fixed by Nvidia.

Should I close this issue or you want to investigate a bit more?

akien-mga commented 1 year ago

I guess we can close, but I'll let @clayjohn have a quick look. 6 months old isn't that old and other users might run into similar issues, so if we can identify what change triggers the driver bug, we might be able to work it around.

Rendering PRs merged between beta 15 and 16: https://github.com/godotengine/godot/pulls?q=is%3Apr+merged%3A2023-01-24T10%3A00..2023-01-27T12%3A00+is%3Amerged+sort%3Acreated-asc+milestone%3A4.0+label%3Atopic%3Arendering

jmpichardo commented 1 year ago

I have a guess that maybe this was related to the fact that we are changing texture import formats to s3tc_bptc.

akien-mga commented 1 year ago

That's possible, though this change only happened in beta 17. IIUC you got the crash in beta 16 too?

jmpichardo commented 1 year ago

Yes, I could reproduce it in beta16 as well.

EDIT: But I was thinking that when I tested with beta16 the imports were already updated to s3tc_bptc.

clayjohn commented 1 year ago

I'm at a loss as to what could be causing this. The rendering changes between Beta 15 and 16 were all pretty safe and none of them changed anything that would impact Vulkan API calls.

Given that this bug is only triggered when a .godot folder exists, my guess is the issue lies in the importer. Perhaps there is an issue with the way we store some texture types.

jmpichardo commented 1 year ago

To give some more light: The provided test project attached to this issue, when using beta17, even removing the .godot folder was causing it to crash. In other words, it was crashing all the time.

The test project is super basic with just a 3D scene using a Toon shading with a capsule. So it must be something related with rendering engine.

Sadly, I cannot remember exactly what was the previous Nvidia driver version, but checking the list of published drivers I think it was one of the three drivers between 516.59 and 517.48.

JamieBohannaWebDev commented 8 months ago

I'm using 4.2.1-stable_mono_win64.exe and getting the same error.

Faulting application name: Godot_v4.2.1-stable_mono_win64.exe, version: 4.2.1.0, time stamp: 0x00000000 Faulting module name: nvoglv64.dll, version: 31.0.15.4633, time stamp: 0x6570b1c4 Exception code: 0xc0000005

I updated my Nvidia drivers TODAY both before and after the crashes.

In terms of what happens when this crash occurs:

1 - Creating a basic 3D World with a flat box floor and a capsule character with the predefined walking scripts (as below):

image

2 - Launch this game 3 - Editor crashes in the background with no error 4 - Game continues running no problem.