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

Godot hangs forever when exiting [MacOS] [M2] [ARM] #292

Open
innateessence opened this issue May 30, 2024 · 10 comments
Open

Godot hangs forever when exiting [MacOS] [M2] [ARM] #292

innateessence opened this issue May 30, 2024 · 10 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@innateessence
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Open Godot Mono (C# build)
  2. Install YAT
  3. Build project (to generate .csproj file)
  4. Edit .csproj file as outlined in usage.md
  5. Enable YAT
  6. Observe "YAT 1.28.0-beta loaded!" message in console.
  7. Exit godot
  8. Godot hangs...

Expected behavior
Godot exits cleanly.

Actual behavior
Godot hangs forever until I open a terminal and type kill -9 <pid_of_godot>

Screenshots
image

Desktop/smartphone (please complete the following information):

  • OS: MacOS Sonoma 14.4.1
  • YAT Version: 1.28.0-beta
  • Godot version: 4.2.2
  • .NET version: 8.0.301
  • CPU Architecture: M2 (arm)

Additional context
I am a dev, although I am new to Godot, and not very experienced with C#, so, if we need to communicate effectively, please keep this in mind.

I have 3 other plugins installed, This problem only exists when YAT is enabled.
The other plugins are displayed in the screenshot:
image

P.S.
You may want to consider adding 2 additions I included to your future bug report template:

  • "Actual Behavior"
  • "CPU Architecture"
@innateessence innateessence added the bug Something isn't working label May 30, 2024
@innateessence
Copy link
Author

innateessence commented May 30, 2024

The bug exists with YAT as the only enabled plugin.

Wanted to verify as a sanity check.

@innateessence innateessence changed the title Godot hangs forever when exiting [MacOS] Godot hangs forever when exiting [MacOS] [M2] [ARM] May 30, 2024
@innateessence
Copy link
Author

First Auto Battler.csproj

<Project Sdk="Godot.NET.Sdk/4.2.2">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
    <EnableDynamicLoading>true</EnableDynamicLoading>
    <RootNamespace>FirstAutoBattler</RootNamespace>
    <LangVersion>12.0</LangVersion>
  </PropertyGroup>
  <ItemGroup>
    <Compile Remove="script_templates/**/*.cs" />
  </ItemGroup>
</Project>

@MASSHUU12
Copy link
Owner

Hey, thank you for reporting the bug, and for the suggestion, I will take them into consideration.

Unfortunately, I do not own any computer from Apple, nor do I know anyone who could lend me one for testing.
I tried running macOS on a virtual machine. Unfortunately, it was very unstable and every now and then the kernel would panic, effectively making it impossible to install.

As a result, I am unable to diagnose the problem and fix it.
At this point, I will try to look for another solution.

In the meantime, please answer the following questions:

  • Does YAT work properly when the game is running?
  • Does disabling YAT in the project settings cause the editor to freeze, or only when closing it?
  • Does the bug still occur if you compile the project under .NET 7 and language version 11?

I would appreciate it if you would also check if this error occurs under Godot v4.3.dev6.mono.

I do not promise that even with the answers to these questions I will be able to fix this bug, due to the lack of access to macOS, but I will try.

@innateessence
Copy link
Author

innateessence commented Jun 3, 2024

Thank you for getting back to me. This looks like a cool project :)

Does YAT work properly when the game is running?

Yes. It works as expected from my PoV. I can open the terminal and issue commands seemingly without any issues.
I haven't tried to make super heavy use of YAT yet, but I can issue basic commands in a REPL/shell and see the output as expected

Does disabling YAT in the project settings cause the editor to freeze, or only when closing it?

Disabling YAT does not cause the editor to freeze. I am fairly confident that freezing only happens under two conditions:

  • I compile and run my game with YAT. Then, I close the game. The game now forever hangs until I click the "Stop" button in the editor. Screenshot below.
    image
    The game freezes when exiting seemingly anyway I exit the game. Either by typing exit in YAT. or by clicking the MacOS equivalent of the Microsoft Windows close window button on the game window.

For context, the game freezing when exiting the game also only occurs when the YAT plugin is enabled.
image

  • I have YAT enabled, and I close the editor. This will cause the editor itself to hang forever until I force kill it using bash

Does the bug still occur if you compile the project under .NET 7 and language version 11?

Unknown. I will give this a try and report back.

I would appreciate it if you would also check if this error occurs under Godot v4.3.dev6.mono.

The problem still occurs in Godot v4.3.dev6.mono.
(Both the game window freezing when exiting the game. and the editor freezing when exiting the editor.)

@MASSHUU12
Copy link
Owner

Thank you for your reply, I'm glad you like the project despite this bug.

Since the error occurs both when closing the editor and the game, it seems to me that the problem may be caused by some static variable. This seems so to me because there is no code in YAT that is marked as Tool (running in the editor) other than the file that adds autoload and one unused that does nothing. I'll go through the Godot documentation, because I may have missed something.

You can delete EditorTerminal.cs and EditorTerminal.tscn to verify that surely these unused files are not the problem (although I don't think so). It's a leftover from when I tried to put YAT into the editor, I'll get around to it someday.

I also recently released a new version of YAT that fixes a few things I don't think are related to this bug, but the new release itself also adds some cool stuff, so it's still worth checking out.

Does the bug still occur if you compile the project under .NET 7 and language version 11?

Unknown. I will give this a try and report back.

Just for the record, since you mentioned that you are not experienced with C#. You don't need to install .NET 7, .NET is backward compatible, so just change the appropriate settings in .csproj and everything should work. To make sure everything compiles correctly, you can also delete the .godot folder in your project. Godot may display some errors the first time you run it after deleting the .godot folder, but it will recreate all the files it needs without a problem.

@MASSHUU12
Copy link
Owner

So I finally managed to install and run macOS Sonoma 14.5 correctly, it works 'well', it's responsive. Unfortunately, the problem arises when I try to run the Godot project, an error about the Vulkan drivers pops up:

image

In turn, running Godot using OpenGL3 results in a white screen:

image

I'm assuming these problems are VM specific, but if you have suggestions on how I can work around this, I'd be happy to use them.

@innateessence
Copy link
Author

Does the bug still occur if you compile the project under .NET 7 and language version 11?

The bug still occurs under this version unfortunately

@innateessence
Copy link
Author

I'm assuming these problems are VM specific, but if you have suggestions on how I can work around this, I'd be happy to use them.

Unfortunately, I don't know how to get around these issues :(

Apple doesn't like it when people emulate their OS.

@MASSHUU12
Copy link
Owner

I'm afraid there is nothing more I can do about this problem for the moment

@MASSHUU12 MASSHUU12 added the help wanted Extra attention is needed label Jun 28, 2024
@innateessence
Copy link
Author

I'm afraid there is nothing more I can do about this problem for the moment

That's okay, I appreciate the effort you put into this in the first place.

If you decide to add a way to add verbose logging and want to see the output of those verbose logs, let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants