MikeSchulze / gdUnit4

A Godot Unit Test Framework. Support for GDScript and C# unit testing
MIT License
565 stars 30 forks source link

GD-491: segmentation fault when closing godot editor #492

Closed Krigu closed 3 months ago

Krigu commented 4 months ago

The used GdUnit4 version

4.3.1 (Latest Release)

The used Godot version

v4.2.2.stable.arch_linux

Operating System

Manjaro Linux

Describe the bug

We are using GdUnit in our build pipeline and after updating to GdUnit 4.3.0, the godot editor does not exit properly when closing the editor.

This is proplematic because we are checking for the exit status of the godot process during the build. We expirienced the same behaviour when using GdUnit 4.3.1

Steps to Reproduce

I was able to reproduce the error without the command line tools in a clean project.

  1. Start godot via command line with godot . -e
  2. Created a new project in Godot 4.2.2
  3. Added gdUnit Plugin 4.3.1 and activate it under Project Settings -> Plugins
  4. Close project

=> The terminal is showing "Unload GdUnit4 Plugin success", but it also shows a segmentation fault and the process exits with error code 139 and following console output is shown.

Loading GdUnit4 Plugin success GdUnit4: Test server successfully started checked port: 31002 ERROR: Parent node is busy adding/removing children, remove_child() can't be called at this time. Consider using remove_child.call_deferred(child) instead. at: remove_child (scene/main/node.cpp:1449) ERROR: Condition "data.parent" is true. at: ~Node (scene/main/node.cpp:3583) ERROR: Parent node is busy adding/removing children, remove_child() can't be called at this time. Consider using remove_child.call_deferred(child) instead. at: remove_child (scene/main/node.cpp:1449) ERROR: Condition "data.parent" is true. at: ~Node (scene/main/node.cpp:3583) Unload GdUnit4 Plugin success zsh: segmentation fault (core dumped) godot . -e

When disabling the plugin and closing the project, no error gets shown.

Minimal reproduction project

No response

MikeSchulze commented 4 months ago

https://github.com/godotengine/godot/issues/92727

Ok looks like we have the same issue on Linux. When using the gdUnit4 in your build pipeline e.g. GitHub action, you should disable the plugin in your project. The plugin itself is only needed to load inside the Godot editor, the cmd tool does not need an activated plugin.

MikeSchulze commented 3 months ago

@Krigu can you please check out the master and verify if it's working as expected now?

MikeSchulze commented 3 months ago

@Krigu can you please check out the master and verify if it's working as expected now? I have no Linux system to can test direct, but from the GitHub action it runs without crash.

Krigu commented 3 months ago

@MikeSchulze Sorry for the late response, I was offline for a couple days.

I checked with the current master (commit d0d4610) on my machine (Linux Manjaro) and everything seems to work as expected now. Thanks for fixing it so quickly!