Closed wenbingzhang closed 2 years ago
Please provide information on how this bug is happening, fix the issue layout according to the template, and attach a test project (if needed).
请提供有关此错误如何发生的信息,根据模板修复问题布局,并附上测试项目(如果需要)。
A screencast is unlikely to be enough for the devs to go on. Please attach the project in which this occurs.
截屏视频不太可能足以让开发人员继续下去。请附上发生这种情况的项目。
I get this same error with Godot 3.4.2 Mono. macOS Monterey version 12.1, Macbook pro 16 inch, 2019, graphics: AMD Radeon Pro 5500M 4 GB
Game works fine when running from the editor but exported .app crashes with the error that is displayed in macOS Console app: "system_error: recursive_mutex lock failed: Invalid argument".
I tried to print debug information in Mainscene's startup but nothing prints out so the program crashes before user code is started.
When exporting with debug enabled, macOS doesn't give any error but program simple won't run. Absolutely nothing happens.
I unfortunately cannot share the failing project but I created minimal project with only one C#-script in it and exported and that worked fine. Then I compared .csproj files of the failing one and the minimal working one and I removed differences but the error didn't go away. I also checked project.godot files and removed all differences and still get the same error.
Not sure how to debug this further.
I am not 100% sure what is going on but I managed to solve this mystery at least in my own project.
I was loading a scene dynamically from the code:
PackedScene textLineDialogScene = (PackedScene)ResourceLoader.Load("res://data/scenes/textLineDialog.tscn");
The scene file name in that line is "textLineDialog.tscn" but on the filesystem it was starting with a capital letter: "TextLineDialog.tscn". That didn't cause any problems in the editor but the exported game crashed with that cryptic error "system_error: recursive_mutex lock failed: Invalid argument".
I made Windows export with debug enabled and in Windows it created a log file with clear error message and that's how I managed to solve it.
I personally would prefer to have everything case-sensitive everywhere and Godot should give error or warning if the filenames doesn't match because the game will crash anyway when exporting it.
I personally would prefer to have everything case-sensitive everywhere and Godot should give error or warning if the filenames doesn't match because the game will crash anyway when exporting it.
On Windows 10 and later, this is something you can manually enforce on any folder: https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html#case-sensitivity
Note that the command must be run recursively to impact subfolders too.
Either way, I'll close this as a duplicate of https://github.com/godotengine/godot/issues/24107.
Godot version:
v3.3.2-mono
OS/device including version:
GLES2