godotengine / godot

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

Game Export Segfaults randomly when running --export or --editor --quit from command line #73830

Open RevoluPowered opened 1 year ago

RevoluPowered commented 1 year ago

Godot version

e0de3573f3fc86062763152f5a1ac62f5a986da3

System information

Linux

Issue description

Segfault happens when building a game and re-running it will fix the segfault.

Doesn't matter the game, the mirror, tps demo etc.

Full example of steps and how this was run is here. https://github.com/the-mirror-megaverse/Minimal-Reproduction-Project-CICD-Exports/actions/runs/4255619557/jobs/7403836691

Will not consistently happen:

import: begin: Import Scene steps: 104
    import: step 0: Importing Scene...
    import: step 2: Running Custom Script...
    import: step 104: Saving...
import: end
    reimport: step 162: ray.glb
import: begin: Import Scene steps: 104
    import: step 0: Importing Scene...
    import: step 2: Running Custom Script...
    import: step 104: Saving...
import: end
    reimport: step 163: core.glb
import: begin: Import Scene steps: 104
    import: step 0: Importing Scene...
    import: step 2: Running Custom Script...
    import: step 104: Saving...
import: end
    reimport: step 164: lights.glb
import: begin: Import Scene steps: 104
    import: step 0: Importing Scene...
    import: step 2: Running Custom Script...
    import: step 104: Saving...
import: end
    reimport: step 165: props.glb
import: begin: Import Scene steps: 104
    import: step 0: Importing Scene...
/home/runner/work/_temp/653d49ba-69e0-4ca2-b81b-94ee67a2414e.sh: line 6:  2029 Segmentation fault      (core dumped) ./godot.linuxbsd.editor.x86_64.mono --path ./tps-demo/ --headless --export-release Linux "build/Game.x86_64"

Steps to reproduce

You can fork this repository and run the build a few times to reproduce it: (easy way)

Or run it locally and follow the same steps as the workflow main.yml file in the MRP repository we have provided.

Minimal reproduction project

https://github.com/the-mirror-megaverse/Minimal-Reproduction-Project-CICD-Exports

Sponsored by The Mirror

RevoluPowered commented 1 year ago

Closing this wasn't tested on the correct TPS branch

RevoluPowered commented 1 year ago

Re-opening and edited happens even with latest branches

bruvzg commented 1 year ago

~Seems like regression from https://github.com/godotengine/godot/pull/73508, see https://github.com/godotengine/godot/issues/73842#issuecomment-1444244788 for details.~ Actually, it's probably not.

arnemileswinter commented 2 months ago

I experienced segfault on a headless environment on 4.3 for first import as well (I'm using a Docker based CI to build my game.)

godot --editor --headless --quit

segfaults whereas

godot --import --headless

does not, and does what I want.

It is a bit strange though, the docs state that --import implies the other flags.