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

MacOS crash when trying to Run project with corrupted custom icon (.icns) #78819

Closed
mr-dreich opened this issue Jun 29, 2023 · 6 comments · Fixed by #79010
Closed

MacOS crash when trying to Run project with corrupted custom icon (.icns) #78819

mr-dreich opened this issue Jun 29, 2023 · 6 comments · Fixed by #79010

Comments

@mr-dreich
Copy link

mr-dreich commented Jun 29, 2023

Godot version

v4.1.rc1.official [1f9e540]

System information

Godot v4.1.rc1 - macOS 13.3.1 - Vulkan (Mobile) - dedicated AMD Radeon Pro 5300M - Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 Threads)

Issue description

Here is the MacOS error report and the Terminal output when running my project from the terminal.

I have tested this on a new and clean project with only a Node2D as the root and a Sprite2D as a child, and the project Runs fine, so it has to be something I have done. I have no Shaders, no Particles, and the only thing left is trying to write to the user:// folder, but I have commented those out and it still crashes. My project currently consists of Control nodes, this project is mainly UI focused.

Oddly enough, I can build for iOS just fine, but when trying to export for MacOS it does the exact same crash, with the same error log. I only use my Macbook when I'm not at home, I usually use my desktop, which is running Windows 11 and it works just fine.

pycbouh over on Reddit had me try different versions and I went all the way back to 4.1 dev 4 and still the same issue.

Steps to reproduce

After selecting my project and the Editor opens, I click the Run button and it crashes back to the Editor. Usually no error in console, and sometimes MacOS will provide an error popup.

Minimal reproduction project

I would like to supply a reproduction project, but this project isn't something I am comfortable giving out publicly.

@akien-mga
Copy link
Member

Thanks for the report and the testing done so far!

Without a reliable way to reproduce it on our side, we'll be reliant on more testing from you to help narrow down what causes the issue, if you're willing.

I'm not sure exactly how to debug things yet, but these are things you could try (or confirm if already tried) to help us narrow it down:

  • You mentioned "I went all the way back to 4.1 dev 4 and still the same issue." Does it mean that you tried 4.1 dev 3 and it worked fine (i.e. the issue started in dev 4), or you didn't test earlier builds? If the latter, could you test dev 3, dev 2 and dev 1 too, to pinpoint the first one where the bug starts?

  • The macOS report and terminal output don't provide enough information because the Godot binary we provide doesn't include debug symbols by default. There's still at least a hint that it might be a crash of the Vulkan (MoltenVK) renderer, though this could be a false positive. To narrow it down, you could:

    • Check whether running your project with OpenGL works around the issue. You can change this in the Project Settings by changing "Rendering Method" to "GL Compatibility".
    • Compile Godot from source with scons debug_symbols=yes to have debug symbols, and use that compiled binary to run your project and see if you get more details when it crashes. Here's the relevant documentation if you want to try that.
  • Since you mention that other projects don't fail, and exporting your project to iOS also works fine, this may suggest something specific to the configuration of your macOS export preset in the Export menu. Or it could be some cached data that somehow messes things up. To test that, could you:

    • Temporarily move/rename the export_presets.cfg file so that it no longer uses whatever you have configured in it for macOS, and see if the project runs OK.
    • Temporarily move/rename the res://.godot folder to force reimporting assets and re-creating cached editor data and shaders, and see if the project runs OK.
    • Temporarily move/rename the folder ~/Library/Application Support/Godot/projects/<project name>-<hash>/, and see if the project runs OK.
    • Temporarily move/rename the folder ~/Library/Application Support/Godot/app_userdata/<project name>/, and see if the project runs OK.
    • All these "temporarily" are because if one of them fixes the issue, it could be useful to still have access to the old bad data to compare them and see how the engine could solve the problem of using such bad data.

@mr-dreich
Copy link
Author

mr-dreich commented Jun 29, 2023

Thank you for your very thorough reply!

But yes, I tried my project with all the version back to dev4. I tried dev3, dev2, and dev1, this morning, still the same error.

I have completely removed those directories and had Godot create fresh ones before I made this report and it didn't fix anything sadly.

I also have tried running my project with every renderer. Forward+, Mobile, and Compatibility. Still the same error.

The last test I'll need to try is compile from source with debug symbols like you said, which will have to wait, as I am getting ready to leave for work.

@mr-dreich
Copy link
Author

mr-dreich commented Jul 1, 2023

I have finally got time to build from source on my Macbook, here is the MacOS Crash Report, I built it with debug_symbols enabled.

I would be willing to upload my project if someone wanted to peek at it, I just don't want it public as I don't know where I am going with this and if I do release it for purchase, I don't want the source floating around.

@akien-mga
Copy link
Member

Thanks, that's very helpful! According to the log, it's crashing on this line:

DisplayServer::get_singleton()->set_native_icon(mac_icon_path);

So it's crashing when setting the window icon. Is it a custom icon, and if so can you share it?

CC @bruvzg

@mr-dreich
Copy link
Author

mr-dreich commented Jul 1, 2023

I do have a custom icon set, I used an online generator to create one based on my icon I created. I cleared that and it seems to be working now. Whats strange, is that was so early on in the project, that it would have been working back then and at some point stopped working.

And actually, I cannot share it, the file size is 0 and whenever I try and open it, it errors out. Some how my icns file got corrupted and I didn't even know it haha.

@akien-mga akien-mga changed the title MacOS crash when trying to Run project MacOS crash when trying to Run project with corrupted custom icon (.icns) Jul 1, 2023
@akien-mga
Copy link
Member

Great! That should be fixable, but also doesn't sound too critical for 4.1 anymore since most users shouldn't have a corrupted custom icon.

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

Successfully merging a pull request may close this issue.

2 participants