Segfault on exit with GCC 6.3.0 Release Builds

Bug #1668200 reported by Tino
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

I noticed this problem on my system when upgrading to GCC 6.3.0 in January and now Appveyor shows the same:

When doing Release builds and optimizing with -O3, widelands itself and the economy_test do segfault on exit.
Debug builds or release builds done with -O2 are fine.

I am not sure if this is only MinGW64 GCC 6.3.0 on Windows or it also affects other platforms. Travis does still use GCC 6.2.0 as far as i can see.

Related branches

GunChleoc (gunchleoc)
tags: added: buildsystem crash
Changed in widelands:
importance: Undecided → High
milestone: none → build20-rc1
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I did a brief test with Ubuntu Zesty (the current development version), which from what I can see used GCC 6.3.0 to build the PPA build [1]:

>The CXX compiler identification is GNU 6.3.0

The tests ran ok, and I didn't have any problems with closing Widelands after installing the package in a vm. (Ok, strictly speaking it complained about waiting 5 minutes to close audio and that Widelands had to be killed manually but a) I believe this to be unrelated (?) and b) strongly suspect it is due to running in a vm.

I can double-check a bit by building a release manually though ;)

[1] https://code.launchpad.net/~widelands-dev/+recipe/widelands-daily, more specifically https://code.launchpad.net/~widelands-dev/+archive/ubuntu/widelands-daily/+build/12062131/+files/buildlog_ubuntu-zesty-amd64.widelands_1%3A19-ppa0-bzr8307-201702271132~ubuntu17.04.1_BUILDING.txt.gz

Revision history for this message
Tino (tino79) wrote :

Ok, so probably only a bug/problem with mingw64 on windows. Wouldn't be the first time...

I've found a nice article on optimization [1], which states:

  -O3: the highest level of optimization possible. It enables optimizations that are expensive in terms of compile time and memory usage. Compiling with -O3 is not a guaranteed way to improve performance, and in fact, in many cases, can slow down a system due to larger binaries and increased memory usage. -O3 is also known to break several packages. Using -O3 is not recommended.

Perhaps switching to O2 for widelands in general would be a safe solution? Has anyone ever tested, if widelands actually profits from O3 (filesize/compiletime/runtime fps or cpu usage)?

[1] https://wiki.gentoo.org/wiki/GCC_optimization

Revision history for this message
GunChleoc (gunchleoc) wrote :

Size of the build directory:

With -02: 173.4 MB

With -03: 175.9 MB

Compiler version: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

So, it's slightly bigger for me with -03.

My machine is too slow to do anything meaningful with Valgrind, so I'll leave those tests to somebody else.

Revision history for this message
Jukka Pakarinen (flegu) wrote :

I did a release build from revision 8467 with -03 flag and gcc (Debian 6.3.0-18) 6.3.0 20170516. After that I ran regression_test.py without any problems. I played "Basic Control" tutorial few moments and exited from the game without segfalt or any other problems. Then I player the same tutorial with Valgrind. There was some memory leaks while the game was starting up but after that everything went fine.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks for testing!

Do you still have any info on the memory leaks for a new bug? We'd be interested in fixing those.

Changed in widelands:
status: New → Fix Committed
Revision history for this message
Jukka Pakarinen (flegu) wrote :

I only started the game and pressed "Exit Widelands". The attachment includes Valgrind log from Debug build. I compared Debug and Release results and the both seems to have same memory leaks.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.