Implement support for GCC 9

Bug #1831359 reported by GunChleoc on 2019-06-02
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Won't Fix

Bug Description

Building Widelands doesn't work properly with GCC 9. See

Related branches

Tino (tino79) wrote :

No problem on my machine. Waiting for appveyor:

Tino (tino79) wrote :

Sorry, you are right

Same problem here. Trying to figure out if it is GCC9 or GLBindings 3.1.

Tino (tino79) wrote :

My findings:
- Debug builds are fine
- Crash does not depend on Glew/GLBinding
- Release with O2/O1/O0 also segfault

(gdb) where
#0 0x000000000073a5ff in FieldsToDraw::reset(Widelands::EditorGameBase const&, Vector2<float> const&, float, RenderTarget*) ()
#1 0x000000000072e84c in MapView::draw_terrain(Widelands::EditorGameBase const&, std::vector<std::pair<std::vector<WorkareaPreviewData, std::allocator<WorkareaPreviewData> >, std::vector<std::vector<Widelands::Coords, std::allocator<Widelands::Coords> >, std::allocator<std::vector<Widelands::Coords, std::allocator<Widelands::Coords> > > > >, std::allocator<std::pair<std::vector<WorkareaPreviewData, std::allocator<WorkareaPreviewData> >, std::vector<std::vector<Widelands::Coords, std::allocator<Widelands::Coords> >, std::allocator<std::vector<Widelands::Coords, std::allocator<Widelands::Coords> > > > > > >, bool, RenderTarget*) ()
#2 0x00000000005542bf in InteractivePlayer::draw_map_view(MapView*, RenderTarget*) ()
#3 0x00000000004fbefa in UI::Panel::do_draw_inner(RenderTarget&) ()
#4 0x00000000004fbe82 in UI::Panel::do_draw(RenderTarget&) ()
#5 0x00000000004fceb4 in UI::Panel::do_run() ()
#6 0x0000000000484785 in Widelands::Game::run(UI::ProgressWindow*, Widelands::Game::StartGameType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#7 0x000000000048733e in Widelands::Game::run_splayer_scenario_direct(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#8 0x00000000004080bc in WLApplication::mainmenu_tutorial() ()
#9 0x000000000040b401 in WLApplication::mainmenu() ()
#10 0x000000000040be7a in WLApplication::run() ()
#11 0x0000000000401642 in SDL_main ()
#12 0x00000000004030ec in main_getcmdline ()
#13 0x00000000004013a5 in __tmainCRTStartup ()
    at E:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:339
#14 0x00000000004014db in WinMainCRTStartup ()
    at E:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:195

Changed in widelands:
status: New → Confirmed
Tino (tino79) wrote :

Just a test with Linux, same segfaults:

kaputtnik (franku) wrote :

See also bug 1834244 "Release builds crash on multiplayer lan games" which i have marked as a duplicate to this one.

The crash happens close after:

Replay writer has started
[sync] Reset
Speicherzugriffsfehler (Speicherabzug geschrieben)

kaputtnik (franku) wrote :

I have tried to break it down by applying some log output until i found a log which isn't printed anymore. The crash happens some where in this call:

const Vector2f texture_offset =


I have tried to dissolve this call into several calls, to find out which of them fails, but i wasn't able to do so.

During my testing Address Sanitizer prints always a DEADLYSSIGNAL, output attached.

GunChleoc (gunchleoc) wrote :

I have attached a branch with a patch that I received from the Fedora packager. Could somebody please test?

kaputtnik (franku) wrote :

The branch works :-) My gcc-version: gcc (GCC) 9.1.0

Compiled a release build without problems and started a single player game and a multiplayer lan game without a crash. Only started the games without any playing. But since the crash happens during game loading, i think my tests are enough.

GunChleoc (gunchleoc) on 2019-07-28
Changed in widelands:
status: Confirmed → In Progress
Changed in widelands:
status: In Progress → Fix Committed
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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