-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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 crash on Linux when compiled with GCC 12 #100768
Comments
That sounds surprising, this commit is just removing some unused headers. If the code compiles, it should be equivalent to what was before. |
Would you mind trying to build the binary on your computer using our own linux toolchain? https://github.com/godotengine/buildroot You can just get a pre-build version from the "obtaining a toolchain" part of the document. This will tell us if this is a Debian problem, or a Debian GCC problem. Thanks! |
Just sharing some more info:
I pulled the latest master, and compiled it. Still crashing on Linux, just opening Godot crashes. Since I've started compiling the master branch and reverted this commit: be86ce3 |
Reverting be86ce3 fix the crash on Linux. |
Using this toolchain solve the issue too. So I guess I can't use gcc older than v13. It might be useful to update the documentation about building Godot for Linux and to make it matches with the toolchain tools versions: |
I suspect it might be an incremental build issue, where SCons might not properly trigger rebuilding all files that need to be built, and some old object files are reused and linked into a broken executable. Does the problem fix itself if you do a clean build from scratch with Debian's GCC? You can clean everything in a Git clone with |
The first build was a clean build not an incremental one, still crashing. To be clear, I'm using a VM dedicated to build Godot. So libs and binaries never get updated what so ever. Sur la branche master
Fichiers non suivis:
(utilisez "git add <fichier>..." pour inclure dans ce qui sera validé)
build-consolidate.sh
build-linux.sh
build-windows.bat
godot.gdkey
modules/godotdiscord/
modules/godoterrorhandler/
modules/godotsteam/
aucune modification ajoutée à la validation mais des fichiers non suivis sont présents (utilisez "git add" pour les suivre) I do have to say tho, there are indeed 3 modules that I use, and I haven't tried building Godot without them. Shell scripts are there because I use them to build Godot, and the I do think that adding a link to the toolchain used by the github action to the documentation might be the solution to this issue. Saying, if it crashes but you're not using this toolchain to build Godot, then "we cannot help much". Please use the specific tools we use to build Godot. |
Since the master branch crashes using GCC 12, I think updating the requirement to GCC 13 might be a good idea (see issue: godotengine/godot#100768 ) Also, since there's a publicly available toolchian that's easy to install, and doesn't mess up with the user's machine, I'd rather add this as an option.
I'm also seeing crashes when godot is built on debian ( Stack trace for project settings:
Stack trace with
Using llvm ( |
The stacktrace sounds relevant for you @RandomShaper @hpvb Still very puzzled at how a simple cleanup PR removing unused headers would cause this, but if it's a compiler bug, who knows... Maybe it was only working up until now by pure chance Would be good to try to narrow down further what part of be86ce3 triggers this. From reading the diff I'd guess the removal of Semaphore in ResourceLoader + its use of some forward declares may be playing nasty? |
@xsellier can you tell us how exactly you build the engine? The exact scons command you use, and the versions for gcc, linker, etc you use? This does seem like a toolchain bug of some kind, but I'd like to know exactly what the bug is, we might be triggering it elsewhere too. |
#!/bin/bash
# This script is intended to run on Linux.
set -eo pipefail
export BUILD_REVISION=official
export NB_CPU=16
export CXX=g++
export CC=gcc
echo ""
echo "BUILDING BINARY FOR Linux 64"
echo ""
scons -j${NB_CPU} CXX=$CXX CC=$CC platform=linuxbsd target=editor debug_symbols=yes arch=x86_64 use_static_cpp=yes
echo ""
echo "BUILD DONE FOR Linux 64"
echo "" |
Tested on Fedora 41 with our older buildroot using GCC 10.2.0, and it seems to work fine. So at least it's not that we broke support for all GCC < 13, the problem seems to be related to Debian's version or other related dependencies specifically. Time to set up a Debian VM. Edit: I can reproduce it in the |
So far I've narrowed it down to the changes in I thought the culprit might be the change to I'll check further when I have time. |
Tested versions
Launch Godot.
I compiled Godot master from git using this settings:
Using git bisect, it seems that this commit causes the crash:
be86ce3
System information
Linux binogure 6.11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11-1~exp1 (2024-09-19) x86_64 GNU/Linux
Issue description
Launch Godot and it crashes on a SIGSEGV:
Steps to reproduce
Launch Godot on Linux
crash-godot.mp4
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: