Crash, game freezes, memory overflow

Bug #1795976 reported by kaputtnik
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

The attached save game crashes reproducible when attacking the port in the north of current view.

1. Load the save game
2. Immediately Scroll to north and attack the port with three soldiers

Result: After a few seconds the game stands still and after some minutes the crash appears. The last console output is:

 5: expedition max duration = 9506 (158 minutes), map area root: 232
  2: last command for ship Leonardo at 13x156 was 36865 seconds ago, something wrong here?...
2: Leonardo at 13x156: explore uphold, visited first time
2: Leonardo: new island exploration - direction: 2
Cmd_EnemyFlagAction::execute player(3): flag->owner(2) number=3
Fatal exception: std::bad_alloc
FATAL ERROR - game crashed. Attempting emergency save.
Game: Writing Preload Data ... Speicherzugriffsfehler (Speicherabzug geschrieben)

Sometimes the crash happens without attacking the port, so i am unsure the problem is the attack...

The attached file is manually zipped by me, because i usually unset the "compress Data" option.

Tags: crash

Related branches

Revision history for this message
kaputtnik (franku) wrote :
kaputtnik (franku)
description: updated
Revision history for this message
kaputtnik (franku) wrote :

Additional observation: Memory usage increases while the game stands still until maximum free memory is reached. Then the crash happens.

This happens also if you reduce the amount of soldiers in one of the towers. So attacking the port isn't needed at all.

summary: - crash when attacking a port
+ Crash, game freezes, memory overflow
GunChleoc (gunchleoc)
tags: added: crash
Changed in widelands:
milestone: none → build20-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: New → Triaged
assignee: nobody → GunChleoc (gunchleoc)
Revision history for this message
GunChleoc (gunchleoc) wrote :
Download full text (3.4 KiB)

Interesting bits from the ASan log - identical in both the port attack and the reducing soldiers in tower case, so it's the same endless loop:

Done reloading the game from replay
Replay writer has started
[sync] Reset
ComputerPlayer(1): initializing as type 2
    ... DNA initialized
  1: 0 basic buildings in savegame file.
 1: expedition max duration = 9506 (158 minutes), map area root: 232
ComputerPlayer(2): initializing as type 2
    ... DNA initialized
  2: 0 basic buildings in savegame file.
 2: expedition max duration = 9506 (158 minutes), map area root: 232
ComputerPlayer(4): initializing as type 2
    ... DNA initialized
  4: 0 basic buildings in savegame file.
 4: expedition max duration = 9506 (158 minutes), map area root: 232
ComputerPlayer(5): initializing as type 2
    ... DNA initialized
  5: 0 basic buildings in savegame file.
 5: expedition max duration = 9506 (158 minutes), map area root: 232
  2: last command for ship Leonardo at 13x156 was 36866 seconds ago, something wrong here?...
2: Leonardo at 13x156: explore uphold, visited first time
2: Leonardo: new island exploration - direction: 2
Cmd_EnemyFlagAction::execute player(3): flag->owner(2) number=4
==2929==ERROR: AddressSanitizer failed to allocate 0x100002000 (4294975488) bytes of LargeMmapAllocator (error code: 12)
==2929==Process memory map follows:
<snip>
==2884==End of process memory map.
==2884==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_common.cc:118 "((0 && "unable to mmap")) != (0)" (0x0, 0x0)
    #0 0x7fb205467c02 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe9c02)
    #1 0x7fb205486595 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x108595)
    #2 0x7fb205471492 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xf3492)
    #3 0x7fb20547d8a5 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xff8a5)
    #4 0x7fb2053a7a51 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x29a51)
    #5 0x7fb20545e41e in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe041e)
    #6 0x55df05e82a54 in __gnu_cxx::new_allocator<Widelands::Flag*>::allocate(unsigned long, void const*) /usr/include/c++/7/ext/new_allocator.h:111
    #7 0x55df05e72a61 in std::allocator_traits<std::allocator<Widelands::Flag*> >::allocate(std::allocator<Widelands::Flag*>&, unsigned long) /usr/include/c++/7/bits/alloc_traits.h:436
    #8 0x55df05e5c3ff in std::_Vector_base<Widelands::Flag*, std::allocator<Widelands::Flag*> >::_M_allocate(unsigned long) /usr/include/c++/7/bits/stl_vector.h:172
    #9 0x55df05e424f8 in void std::vector<Widelands::Flag*, std::allocator<Widelands::Flag*> >::_M_realloc_insert<Widelands::Flag* const&>(__gnu_cxx::__normal_iterator<Widelands::Flag**, std::vector<Widelands::Flag*, std::allocator<Widelands::Flag*> > >, Widelands::Flag* const&) (widelands+0x19e74f8)
    #10 0x55df05e2e070 in std::vector<Widelands::Flag*, std::allocator<Widelands::Flag*> >::push_back(Widelands::Flag* const&) (widelands+0x19d3070)
    #11 0x55df05df321d in DefaultAI::dispensable_road_test(Widelands::Road const&) src/ai/defaultai.cc:3619
    #12 0x55df05df2456 in Defau...

Read more...

GunChleoc (gunchleoc)
Changed in widelands:
status: Triaged → 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.

Other bug subscribers