Implement support for GCC 9

Bug #1831359 reported by GunChleoc
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
High
Unassigned

Bug Description

Building Widelands doesn't work properly with GCC 9. See https://bugs.launchpad.net/widelands/+bug/1830626/comments/11

Tags: ftbfs

Related branches

Revision history for this message
Tino (tino79) wrote :

No problem on my machine. Waiting for appveyor: https://ci.appveyor.com/project/widelands-dev/widelands/builds/24985396

Revision history for this message
Tino (tino79) wrote :

Sorry, you are right https://bugs.launchpad.net/widelands/+bug/1830626/comments/8

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

Revision history for this message
Tino (tino79) wrote :

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

Trace:
(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
(gdb)

Changed in widelands:
status: New → Confirmed
Revision history for this message
Tino (tino79) wrote :

Just a test with Linux, same segfaults:

https://travis-ci.org/widelands/widelands/builds/550657199

Revision history for this message
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)

Revision history for this message
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 =
      to_gl_texture(
      terrains.get(field.fcoords.field->terrain_d()).get_texture(gametime).blit_data())
         .origin();

See: https://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/graphic/gl/terrain_program.cc#L108

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.

Revision history for this message
GunChleoc (gunchleoc) wrote :

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

Revision history for this message
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)
Changed in widelands:
status: Confirmed → In Progress
Changed in widelands:
status: In Progress → Fix Committed
Revision history for this message
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  
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.