Editor: Saved random map does segfault on load if no tribe is explicitly set

Bug #1783878 reported by kaputtnik
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

Steps to reproduce:

1. Start Editor
2. create random map with default values
3. Check player positions. The player menu shows for all players: "Random Player; Tribe Barbarian". Do not change the tribe!
4. Save the map
5. Load the saved map

Result: Widelands exits with a segfault. gdb says:

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x0000555556105d8a in std::_Rb_tree<unsigned char, unsigned char, std::_Identity<unsigned char>, std::less<unsigned char>, std::allocator<unsigned char> >::_M_begin
    (this=0x110) at /usr/include/c++/8.1.1/bits/stl_tree.h:759
759 (this->_M_impl._M_header._M_parent);

Trying to load the map as a game shows the error (no segfault):

Game data error
The tribe ''' does not exist.

The error does not appear when a tribe for all players are set in step 3. It doesn't matter to select a different tribe. So when just clicking the tribe button and select barbarians for all players, the segfault doesn't happen.

Tags: editor

Related branches

kaputtnik (franku)
tags: added: editor
GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
kaputtnik (franku)
summary: - Editor: Saved random map does segfault if no tribe is explicitly set
+ Editor: Saved map does segfault on load if no tribe is explicitly set
kaputtnik (franku)
summary: - Editor: Saved map does segfault on load if no tribe is explicitly set
+ Editor: Saved random map does segfault on load if no tribe is explicitly
+ set
kaputtnik (franku)
Changed in widelands:
assignee: nobody → kaputtnik (franku)
kaputtnik (franku)
Changed in widelands:
assignee: kaputtnik (franku) → GunChleoc (gunchleoc)
GunChleoc (gunchleoc)
Changed in widelands:
status: New → In Progress
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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