-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Segfaults in release (opt) template built with GCC 6 #4623
Comments
To be clear, you are seeing these issues with the editor or the template? i.e. |
It's not possible to |
Testing on Mageia 6, Linux 64-bit using the Godot 2.0.1 templates for:
And I got no segfault in the drag_and_drop and input_mapping demos. So I suspect a compiler issue; what platform are you testing on and what compiler did you use? Do you also get a sigserv using the official Godot 2.0.x binaries? |
You might be right about the compiler, I have no problem with Godot 2.0.2 release template. I'm on Arch Linux, so always updated GCC (currently version 6.1.1). Will try with clang. Can this be a compiler bug? |
It could be a compiler bug, or a compiler change that renders our code buggy :-P I'll try with GCC 5.3.1 locally. |
The release compiled with Clang does not segfault. It is a compiler thing indeed. Need to investigate recent changes in GCC.
Yes, and this causes compile errors in old Godot code, so I had to add |
@vnen ~ considering that I can/could reproduce this, and that I'm on Arch too, it might be GCC-related indeed |
I confirm that it works fine with a Linux X11 64-bit release template built with GCC 5.3.1 (20160503), so it's likely GCC 6-specific yeah. |
Does scons have a way to specify the C++ standard being used? |
@her001 SCons can add flags to the compiler command line, which in turn can change the C++ standard. |
@vnen Is that cross platform? (sounds like no) |
It's possible to detect the compiler/platform. But I don't think the C++ standard is causing this specific issue. |
Tried a optimized build with debug symbols and got this
Might be an optimization bug in GCC. I'm not verse in C++ memory management well enough to tell what's wrong with it. |
So #4636 is caused by the compiler too, even with a lesser optimization. It might be good to announce that GCC 6 is not really working and maybe report a bug to them (or find what's wrong with Godot code if there's anything). |
slapin@slapin-pc: Debian, can't reproduce this issue. Also, I did not need to setup any -std options. |
I'd suggest add -g option to build and try valgrind |
I see the following difference in -O3 optimizations for gcc5 vs gcc6: --- opt5.txt 2016-05-13 19:10:23.556164665 +0300
+++ opt6.txt 2016-05-13 19:10:12.160114305 +0300
@@ -80,14 +80,12 @@
-fisolate-erroneous-paths-dereference [enabled]
-fivopts [enabled]
-fjump-tables [enabled]
+ -fkeep-gc-roots-live [disabled]
-flifetime-dse [enabled]
+ -flifetime-dse= 0x2
-flive-range-shrinkage [disabled]
- -floop-block [disabled]
- -floop-interchange [disabled]
-floop-nest-optimize [disabled]
-floop-parallelize-all [disabled]
- -floop-strip-mine [disabled]
- -floop-unroll-and-jam [disabled]
-flra-remat [enabled]
-fmath-errno [enabled]
-fmodulo-sched [disabled]
@@ -105,12 +103,14 @@
-fpeel-loops [disabled]
-fpeephole [enabled]
-fpeephole2 [enabled]
+ -fplt [enabled]
-fpredictive-commoning [enabled]
-fprefetch-loop-arrays [enabled]
-freciprocal-math [disabled]
-freg-struct-return [disabled]
-frename-registers [enabled]
-freorder-blocks [enabled]
+ -freorder-blocks-algorithm= stc
-freorder-blocks-and-partition [enabled]
-freorder-functions [enabled]
-frerun-cse-after-loop [enabled]
@@ -142,7 +142,6 @@
-fsel-sched-reschedule-pipelined [disabled]
-fselective-scheduling [disabled]
-fselective-scheduling2 [disabled]
- -fshort-double [disabled]
-fshort-enums [enabled]
-fshort-wchar [disabled]
-fshrink-wrap [enabled]
@@ -151,7 +150,9 @@
-fsimd-cost-model= unlimited
-fsingle-precision-constant [disabled]
-fsplit-ivs-in-unroller [enabled]
+ -fsplit-paths [enabled]
-fsplit-wide-types [enabled]
+ -fssa-backprop [enabled]
-fssa-phiopt [enabled]
-fstack-reuse= all
-fstdarg-opt [enabled]
@@ -168,10 +169,8 @@
-ftree-builtin-call-dce [enabled]
-ftree-ccp [enabled]
-ftree-ch [enabled]
- -ftree-coalesce-inlined-vars [disabled]
-ftree-coalesce-vars [enabled]
-ftree-copy-prop [enabled]
- -ftree-copyrename [enabled]
-ftree-cselim [enabled]
-ftree-dce [enabled]
-ftree-dominator-opts [enabled]
@@ -203,6 +202,7 @@
-ftree-ter [enabled]
-ftree-vectorize [disabled]
-ftree-vrp [enabled]
+ -funconstrained-commons [disabled]
-funroll-all-loops [disabled]
-funroll-loops [disabled]
-funsafe-loop-optimizations [disabled] You can find this list out by runing: g++-5 -O3 -Q --help=optimizers >opt5.txt
g++-6 -O3 -Q --help=optimizers >opt6.txt
diff -u opt5.txt opt6.txt |
So trying -fno- of added enabled optimizations should be tried first. |
I tested with commit 98bff2f |
In the OP I stated the platformer demo does not give this error, likely because it's not using binary scenes, only Also, in the editor with release_debug gives a crash if you add a control, add a new theme to it and try to edit the theme (as seen in #4636). This crash does not happens if built with Clang, nor if built with target=debug. |
Yeah, confirm this. checking. On Fri, May 13, 2016 at 8:25 PM, George Marques notifications@github.com
|
Well, I did quick analysis. replace
Or use The reason is probably alignment issues which are triggered (trapped) by The removal of -fvect-cost-model=dynamic just hides an issue, not fixing On Fri, May 13, 2016 at 8:32 PM, Sergey Lapin slapinid@gmail.com wrote:
|
Also I need to mention that duse to alignment issues the code is executed less effectively, |
On my PC Godot crashes on: 0x000000000059ee06 <+1382>: pxor xmm0,xmm0
0x000000000059ee0a <+1386>: add rsi,r10
0x000000000059ee0d <+1389>: lea rdi,[rax+rsi*8+0x4]
0x000000000059ee12 <+1394>: xor esi,esi
0x000000000059ee14 <+1396>: add esi,0x1
0x000000000059ee17 <+1399>: add rdi,0x10
=> 0x000000000059ee1b <+1403>: movaps XMMWORD PTR [rdi-0x10],xmm0
0x000000000059ee1f <+1407>: cmp r8d,esi
Godot crashes here (in for (int i=oldsize;i<p_size;i++) {
=> memnew_placement(&t[i], T );
} The address stored in |
Could you please provide PR? On Tue, May 17, 2016 at 3:56 AM, Błażej Szczygieł notifications@github.com
|
Ok, I'll do it. Btw. |
PR: #4691 |
The way Godot uses allocated memory kind of sucks and is not SSE friendly, this will be fixed in 3.0 and should also solve this issue, so re-tagging this one. |
Is this still valid in the current master branch? |
Bump. |
Haven't used Linux in a while. I can test it but not soon. |
While testing some 2.1 PR got some kind of random crashes with
as the last message, using GCC 6. I have not experienced that with master when I tried a while ago, now got some errors when trying to compile release_debug. |
Got some time to test. Can't even open the editor. The project manager opens fine, but when I open even an empty project I get a segfault.
With When I try to run an empty project with the release template I get this:
|
The editor is not meant to be compiled with target=release, it needs release_debug to work, so I'm not sure this is a bug anymore.. |
I changed the way memory is allocated since the initial crashes, so it should always be aligned to 16, does the crash still happen? |
Don't know. I don't have a Linux installation at the moment, so I can't test it. Maybe @zaps166 knows something about this. |
The SSE bugs are fixed, so the only bug remaining was the cast_to<> bug. But this is not really a compiler bug but a godot bug.. so I think it's safe to close this |
Compiling Godot for release gives consistent
SIGSEGV
signal when running some of the demos. It seems to be related to the resource loader based on what I get from backtraces.This is what I get in master with the GUI drag and drop demo (I get an identical BT in other GUI demos, such as input mapping and translation):
I went as far as 37af8b4 and still get the same thing, even with a clean build. At that point, the 2d platformer also raises a similar error:
Is
DVector<T>::resize()
the culprit?Also, the 2D platformer does not have such problem in current master, but it was updated to the new
.tscn
format, which may have mitigated the problem. So I guess this can be some compatibility breakage introduced somewhere, so old binary scenes don't load right. It certainly can be something else.And I hope somebody else can reproduce this issue or I may have to burn my computer 👿
The text was updated successfully, but these errors were encountered: