godotengine / godot

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

Godot crashes when importing project data #95918

Open anderlli0053 opened 4 weeks ago

anderlli0053 commented 4 weeks ago

Tested versions

v4.3.stable.official [77dcf97d8]

System information

Windows 10, 64-bit, 22H2 OS BUILD: 19045.3996 - Compatibility rendering (OpenGL3)

Issue description

I am working on a quite big test project, my project data (3D models, audio, ....) contain around 3GB of such files.

Now when the editor starts, it begins "scanning the files" as can be seen in the file panel, when it comes to 100% it begins importing them and after a few second at around ~7% - 10 % it just freezes, crashes and then this error is shown:

err

I do not know how to debug it any further, since i have tried with --verbose , --debug --trace ( godot.exe --debug --verbose --trace ).

I also know that there are so called "debug builds" for Godot3 -> https://github.com/Calinou/godot-debug-builds , but i couldn't find any for Godot 4.

I have around 14,3 GB of free space on my disk (out of allegedly 237 GB )

err2

This is my example folder structure:

https://pastebin.com/EyBUZBau

and my OS info:

osinfo

I thought that this is the issue of my RAM, but it is not since the Godot processes only take about 1 GB of RAM max!

Are there any other debugging/stacktrace solutions, like the aforementioned Calinou's debug builds?

Steps to reproduce

I cannot recreate the steps nor can i create the MRP. It works well with any other project that i open/edit, but this.

I've tried to create MRP from the existing one, but it always work, what cannot be said to the original full sized project.

Minimal reproduction project (MRP)

I cannot recreate the steps nor can i create the MRP. It works well with any other project that i open/edit, but this.

I've tried to create MRP from the existing one, but it always work, what cannot be said to the original full sized project.

matheusmdx commented 4 weeks ago

Without a project to test and no steps to reproduce will be hard to help, in this case you can compile the engine with debug symbols to get a backtrace and give us some hint or if possible upload the entire project so we can try reproduce the bug

anderlli0053 commented 4 weeks ago

@matheusmdx

Finally i got the backtrace from a custom build

BACKTRACE:

CrashHandlerException: Program crashed
Engine version: Godot Engine v4.4.dev.custom_build (568589c9d8c763bfb3a4348174d53b42d7c59f21)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] CowData<unsigned char>::_get_size (C:\Users\ander\Desktop\godotsrc\godot\core\templates\cowdata.h:128)
[1] CowData<unsigned char>::_get_size (C:\Users\ander\Desktop\godotsrc\godot\core\templates\cowdata.h:128)
[2] CowData<unsigned char>::size (C:\Users\ander\Desktop\godotsrc\godot\core\templates\cowdata.h:181)
[3] Vector<unsigned char>::size (C:\Users\ander\Desktop\godotsrc\godot\core\templates\vector.h:94)
[4] Image::detect_alpha (C:\Users\ander\Desktop\godotsrc\godot\core\io\image.cpp:2534)
[5] FBXDocument::_parse_materials (C:\Users\ander\Desktop\godotsrc\godot\modules\fbx\fbx_document.cpp:1240)
[6] FBXDocument::_parse_fbx_state (C:\Users\ander\Desktop\godotsrc\godot\modules\fbx\fbx_document.cpp:2187)
[7] FBXDocument::_parse (C:\Users\ander\Desktop\godotsrc\godot\modules\fbx\fbx_document.cpp:2111)
[8] FBXDocument::append_from_file (C:\Users\ander\Desktop\godotsrc\godot\modules\fbx\fbx_document.cpp:2254)
[9] EditorSceneFormatImporterUFBX::import_scene (C:\Users\ander\Desktop\godotsrc\godot\modules\fbx\editor\editor_scene_importer_ufbx.cpp:81)
[10] ResourceImporterScene::import (C:\Users\ander\Desktop\godotsrc\godot\editor\import\3d\resource_importer_scene.cpp:2940)
[11] EditorFileSystem::_reimport_file (C:\Users\ander\Desktop\godotsrc\godot\editor\editor_file_system.cpp:2471)
[12] EditorFileSystem::reimport_files (C:\Users\ander\Desktop\godotsrc\godot\editor\editor_file_system.cpp:2760)
[13] EditorFileSystem::_update_scan_actions (C:\Users\ander\Desktop\godotsrc\godot\editor\editor_file_system.cpp:804)
[14] EditorFileSystem::_notification (C:\Users\ander\Desktop\godotsrc\godot\editor\editor_file_system.cpp:1496)
[15] EditorFileSystem::_notificationv (C:\Users\ander\Desktop\godotsrc\godot\editor\editor_file_system.h:141)
[16] Object::notification (C:\Users\ander\Desktop\godotsrc\godot\core\object\object.cpp:870)
[17] SceneTree::_process_group (C:\Users\ander\Desktop\godotsrc\godot\scene\main\scene_tree.cpp:1020)
[18] SceneTree::_process (C:\Users\ander\Desktop\godotsrc\godot\scene\main\scene_tree.cpp:1097)
[19] SceneTree::process (C:\Users\ander\Desktop\godotsrc\godot\scene\main\scene_tree.cpp:582)
[20] Main::iteration (C:\Users\ander\Desktop\godotsrc\godot\main\main.cpp:4234)
[21] OS_Windows::run (C:\Users\ander\Desktop\godotsrc\godot\platform\windows\os_windows.cpp:1666)
[22] widechar_main (C:\Users\ander\Desktop\godotsrc\godot\platform\windows\godot_windows.cpp:180)
[23] _main (C:\Users\ander\Desktop\godotsrc\godot\platform\windows\godot_windows.cpp:206)
[24] main (C:\Users\ander\Desktop\godotsrc\godot\platform\windows\godot_windows.cpp:220)
[25] WinMain (C:\Users\ander\Desktop\godotsrc\godot\platform\windows\godot_windows.cpp:234)
[26] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[27] <couldn't map PC to fn name>
-- END OF BACKTRACE --
anderlli0053 commented 4 weeks ago

AI is giving me this info about this backtrace:

This crash report points to an issue with the FBX file import process in Godot, specifically related to parsing materials and detecting alpha channels. Here's a breakdown of the key points in the backtrace:

FBX Importer Issue: The error occurs while Godot is parsing an FBX file. FBX files contain 3D models, animations, and other data used in game development. The crash seems to happen during the material parsing phase (FBXDocument::_parse_materials).

CowData and Vector Issues: The crash happens inside the CowData and Vector templates, which are used to manage dynamic arrays of data (likely pixel or texture data in this case). The function _Image::detectalpha is being called, which checks if an image has an alpha (transparency) channel. Something about the data being processed here is causing the crash.

Godot Editor Process: The crash is triggered during an attempt to import a scene or resource (possibly an FBX file), and it happens when the editor is scanning and re-importing files (EditorFileSystem::_reimport_file).

If you're comfortable with it, you could debug the Godot engine code around fbx_document.cpp and image.cpp to pinpoint the cause of the crash. This would involve analyzing how the materials and alpha channels are being handled.

RadiantUwU commented 4 weeks ago

Hello! Do you have vs/vscode installed to debug the issue? A memory dump of the crash would be very helpful for us! This would allow us to see the whole program's state and be able to see exactly what went wrong.

anderlli0053 commented 4 weeks ago

I do have VS2022 Community, yes + VSCodium

anderlli0053 commented 3 weeks ago

I have tried with WinDBG, x64DBG, VS2022 and VSCodium and it always just prints out the irrelevant things

The editor process is a separate thing from the project manager, even if i try to attach the debugger to already running process (godot) it closes prematurely, godot exits with no trace being logged or they both crash (the debugger and godot binary)

matheusmdx commented 3 weeks ago

You need to open your project directly using "--editor --path absolute_path_to_your_project", in VS Code will be like that:

image

Saul2022 commented 3 weeks ago

Can you reproduce it with 4.2 and how much is the size of the mesh? For example a 700 glb files crashes for me when importing, so that might be the issue.

anderlli0053 commented 3 weeks ago

Can you reproduce it with 4.2 and how much is the size of the mesh? For example a 700 glb files crashes for me when importing, so that might be the issue.

I have around at least ~1000 different models in various formats, FBX, GLB, DAE and BLEND, subsequently that also means that there are many textures, including PBR and ORM ones.

Yes, the 4.2.stable still crashes

anderlli0053 commented 3 weeks ago

You need to open your project directly using "--editor --path absolute_path_to_your_project", in VS Code will be like that:

image

I have no cppvsdbg...

I figured, since VSCodium as a fork of VSCode it cannot be used with that so i need to install actual VSCode.

matheusmdx commented 3 weeks ago

You can open in other IDE's too, you just need to pass this args to make godot bypass the project manager

anderlli0053 commented 3 weeks ago

I used VSCODE and came up with the following terminal output and debug console outputs, then the Godot Freezed after it achieved 100% importing and stayed there for like 2 hours. The debugger was not paused it was still going.

123

also this was the only launch.json combination that worked:

{
    "version": "0.2.0",
    "configurations": [
        {   

            "type": "cppdbg",
            "request": "launch",
            "name": "Launch Project",
            "program": "${workspaceFolder}/godot.windows.editor.dev.x86_64.exe",
            "args": ["--debug", "--editor", "--path", "C:\\Users\\ander\\Desktop\\Mrp"],
            "cwd": "${workspaceFolder}",
            //"stopOnEntry": false,
           // "console": "internalConsole",
            "preLaunchTask": "build"

        }
    ]
}

Here are the files, since the output is too big to paste in here:

debug_console.txt terminal_output.txt

RadiantUwU commented 3 weeks ago

We kinda needed a memory dump to be able to track all locals/variables everything inside the program. We need the EXE compiled with debug symbols alongside the memory dump to be able to properly see how it went wrong.

I Just read the above comment, since it didnt crash a memory dump wouldnt have been created.

RadiantUwU commented 3 weeks ago

image

You sure you got it to break on exceptions?

RadiantUwU commented 3 weeks ago

image In the above screenshot it seems like you have not set it to do that.

anderlli0053 commented 3 weeks ago

image In the above screenshot it seems like you have not set it to do that.

Oh, i did not see that... Thanks, i'll retry

anderlli0053 commented 3 weeks ago

I have turned All C++ Breakpoints on and it did crash again, but where is the memory dump? it is not located in the CWD (C:\Users\ander\Desktop\godotsrc\godot\bin) and neither in %SystemRoot% (C:\Windows)

This are the outputs of a debug console and terminal from VSCode, from which i can see that there is access violation being made:

debug_console.txt terminal.txt

EDIT:

Nevermind, i searched with regex in "Everything" app and found the directory C:\Users\ander\AppData\Local\CrashDumps , there are dumps files, i'll put them highly-compressed .7z archive (since they are very big in size) and upload them.

The uploaded Crash dump archive is virus free - > https://www.virustotal.com/gui/file/9e6d036f15534d1901763c5ce0c39ebcb4ce509c280753fb3e0f6eab9b9fd1fe?nocache=1

Dumps:

https://file.io/PQAC7IO7dakk

RadiantUwU commented 3 weeks ago

image

Saul2022 commented 3 weeks ago

I have the feeling this may be related to https://github.com/godotengine/godot/issues/93587 as both seem big.

anderlli0053 commented 3 weeks ago

image

https://uploadnow.io/files/MDvnFH3

Zireael07 commented 3 weeks ago

That site seems to require login

anderlli0053 commented 3 weeks ago

What the hell?? I could normally download from all sites!!??

Ok, now from the Dropbox... :

https://www.dropbox.com/scl/fi/2900did1da6e5hs6nnmca/CrashDumps.7z?rlkey=g4kzk0xafvbxph4sg5zpsz2j5&st=330gzwtw&dl=0