Crashes in master-2511_release_x64 on save

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

Bug Description

Many times when saving (either manual or autosave) the game will error - first by saying an invalid code point was reached, then if attempting to save again, it will crash out. Restarting the program and loading a save prior to the invalid code point "fixes" the issue, but is often "unstable" in that it will easily crash again if saving again within a few minutes.

I'm playing the new empire mission neptune's revenge

here's a dump from a stdout.txt from a corrupted savefile

This is Widelands Version master-2511_Release_x64 (Release)
Set home directory: C:\Users\me\.widelands
Widelands executable directory: G:\Games\Widelands
Adding directory: G:\Games\Widelands\data
selected language: (system language)
Graphics: Try to set Videomode 1600x900
Graphics: OpenGL: Version "4.5.0 NVIDIA 382.05"
Graphics: SDL_GL_RED_SIZE is 8
Graphics: SDL_GL_GREEN_SIZE is 8
Graphics: SDL_GL_BLUE_SIZE is 8
Graphics: SDL_GL_ALPHA_SIZE is 0
Graphics: SDL_GL_BUFFER_SIZE is 24
Graphics: SDL_GL_DOUBLEBUFFER is 1
Graphics: SDL_GL_DEPTH_SIZE is 24
Graphics: SDL_GL_STENCIL_SIZE is 0
Graphics: SDL_GL_ACCUM_RED_SIZE is 16
Graphics: SDL_GL_ACCUM_GREEN_SIZE is 16
Graphics: SDL_GL_ACCUM_BLUE_SIZE is 16
Graphics: SDL_GL_ACCUM_ALPHA_SIZE is 16
Graphics: SDL_GL_STEREO is 0
Graphics: SDL_GL_MULTISAMPLEBUFFERS is 0
Graphics: SDL_GL_MULTISAMPLESAMPLES is 0
Graphics: SDL_GL_ACCELERATED_VISUAL is 1
Graphics: SDL_GL_CONTEXT_MAJOR_VERSION is 2
Graphics: SDL_GL_CONTEXT_MINOR_VERSION is 1
Graphics: SDL_GL_CONTEXT_FLAGS is 0
Graphics: SDL_GL_CONTEXT_PROFILE_MASK is 2
Graphics: SDL_GL_SHARE_WITH_CURRENT_CONTEXT is 0
Graphics: SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is 0
Graphics: OpenGL: Double buffering enabled
Graphics: OpenGL: Max texture size: 16384
Graphics: OpenGL: ShadingLanguage: "4.50 NVIDIA"
**** GRAPHICS REPORT ****
 VIDEO DRIVER windows
 pixel fmt 370546692
 size 1600 900
**** END GRAPHICS REPORT ****
[] Section [global], key 'ai_training' not used (did you spell the name correctly?)
[] Section [global], key 'auto_speed' not used (did you spell the name correctly?)
SoundHandler: loaded song "music/intro_00.ogg"
SoundHandler: loaded song "music/menu_00.ogg"
Game: Reading Preload Data ... took 0ms
Game: Reading Game Class Data ... took 0ms
Game: Reading Map Data ... Game: Reading Map Data took 2ms
Game: Reading Player Info ... Loading the world took 1202ms
Loading the tribes took 5035ms
Game: Reading Player Info took 6252ms
Game: Calling read_complete()
Reading Elemental Data ... took 2ms
 Reading Player Names And Tribe Data ... took 0ms
 Reading Port Spaces Data ... took 1ms
 Reading Heights Data ... took 0ms
 Reading Terrain Data ... took 1ms
 Reading Map Objects ... took 7ms
 Reading Player Start Position Data ... took 0ms
 Reading Resources Data ... took 1ms
 Reading Map Version Data ... took 1ms
 Reading Allowed Worker Types Data ... took 0ms
 Reading Allowed Building Types Data ... took 1ms
 Reading Node Ownership Data ... took 0ms
 Reading Exploration Data ... took 1ms
 Reading Flag Data ... took 5ms
 Reading Road Data ... took 1ms
 Reading Building Data ... took 4ms
 Reading Flagdata Data ... took 0ms
 Reading Roaddata Data ... took 5ms
 Reading Buildingdata Data ... took 1ms
 Second and third phase loading Map Objects ... took 4ms
 Reading Players View Data ... Vision check successful for player 1
Vision check successful for player 2
took 19ms
 Reading Player Message Data ... took 208ms
 Reading Objective Data ... took 6ms
 Reading Scripting Data ... took 10ms
 Reading map images ... took 45ms
 WidelandsMapLoader::load_map_complete() for 'Neptune’s Revenge' took 328ms
Game: read_complete took: 328ms
Game: Reading Player Economies Info ... WARNING: target quantity configured for fish, which should not have target quantity, ignoring
WARNING: target quantity configured for log, which should not have target quantity, ignoring
WARNING: target quantity configured for meat, which should not have target quantity, ignoring
WARNING: target quantity configured for thatch_reed, which should not have target quantity, ignoring
WARNING: target quantity configured for water, which should not have target quantity, ignoring
WARNING: target quantity configured for wheat, which should not have target quantity, ignoring
took 1ms
Game: Reading ai persistent data ... took 1ms
Game: Reading Command Queue Data ... took 2ms
Game: Parsing messages ... took 0ms
Game: Reading Interactive Player Data ... took 1ms
GameLoader::load() took 6587ms
[sync] Reset
SoundHandler: loaded song "music/ingame_15.ogg"
ComputerPlayer(2): initializing as type 2
    ... DNA initialized
  2: 0 basic buildings in savegame file.
 2: expedition max duration = 5006 (83 minutes), map area root: 104
TI(1149): destination disappeared or economy mismatch -> fail
TI(1127): destination disappeared or economy mismatch -> fail
TI(1170): destination disappeared or economy mismatch -> fail
TI(1214): destination disappeared or economy mismatch -> fail
TI(1168): destination disappeared or economy mismatch -> fail
TI(1128): destination disappeared or economy mismatch -> fail
TI(1208): destination disappeared or economy mismatch -> fail
TI(1132): destination disappeared or economy mismatch -> fail
TI(1161): destination disappeared or economy mismatch -> fail
TI(1188): destination disappeared or economy mismatch -> fail
lastserial: 0
SoundHandler: loaded song "music/menu_00.ogg"
Game: Reading Preload Data ... took 0ms
Game: Reading Game Class Data ... took 1ms
Game: Reading Map Data ... Game: Reading Map Data took 5ms
Game: Reading Player Info ... Loading the world took 297ms
Loading the tribes took 1774ms
Game: Reading Player Info took 2094ms
Game: Calling read_complete()
Reading Elemental Data ... took 2ms
 Reading Player Names And Tribe Data ... took 0ms
 Reading Port Spaces Data ... took 1ms
 Reading Heights Data ... took 0ms
 Reading Terrain Data ... took 1ms
 Reading Map Objects ... took 6ms
 Reading Player Start Position Data ... took 0ms
 Reading Resources Data ... took 2ms
 Reading Map Version Data ... took 0ms
 Reading Allowed Worker Types Data ... took 1ms
 Reading Allowed Building Types Data ... took 0ms
 Reading Node Ownership Data ... took 1ms
 Reading Exploration Data ... took 0ms
 Reading Flag Data ... took 5ms
 Reading Road Data ... took 1ms
 Reading Building Data ... took 4ms
 Reading Flagdata Data ... took 0ms
 Reading Roaddata Data ... took 5ms
 Reading Buildingdata Data ... took 2ms
 Second and third phase loading Map Objects ... took 3ms
 Reading Players View Data ... Vision check successful for player 1
Vision check successful for player 2
took 19ms
 Reading Player Message Data ... took 2ms
 Reading Objective Data ... took 0ms
 Reading Scripting Data ... took 1ms
 Reading map images ... took 0ms
 WidelandsMapLoader::load_map_complete() for 'Neptune’s Revenge' took 60ms
Game: read_complete took: 60ms
Game: Reading Player Economies Info ... GameLoader::load() took 2161ms
Fatal exception: ZipFilesystem::load: could not open file from zipfile (working on 'binary/player_economies' in zipfile 'C:\Users\me\.widelands\save\ffujj.wgf')
FATAL ERROR - game crashed. Attempting emergency save.
ObjectManager: ouch! remaining objects
lastserial: 1936

Unexpected error during the game
ZipFilesystem::load: could not open file from zipfile (working on 'binary/player_economies' in zipfile 'C:\Users\me\.widelands\save\ffujj.wgf')

Please report this problem to help us improve Widelands. You will find related messages in the standard output (stdout.txt on Windows). You are using build master-2511_Release_x64 (Release).

Please add this information to your report.

Widelands attempts to create a savegame when errors occur during the game. It is often – though not always – possible to load it and continue playing.
SoundHandler closing times 1, freq 22050, format 32784, chan 2
SDL_AUDIODRIVER directsound

Tags: crash savegame

Related branches

Revision history for this message
TiborB (tiborb95) wrote :

Does the problem happens on any map, or just on that new tutorial?

Revision history for this message
MP (pagel-d) wrote :

I've just tried the new level (campaign scenario: empire #3) with 2511. I just downloaded and installed 2522 though in hopes that it fixes.

Revision history for this message
MP (pagel-d) wrote :

note that I did not have this issue in release 19 in any campaign missions, so either it's a mission 3 issue or one of the recent dev builds broke it.

P.S. Someone should clarify the release vs bzr vs lp/appvey build numbers on the main website (or put release dates for all download links)

tags: added: crash savegame
Revision history for this message
MP (pagel-d) wrote :

It's possible this is already fixed by build 2522. I will try to remember to check a point of known instability soon, but last night I was able to play to completion and sporadically save without issue in 2522 in Empire #3. 2522 still refuses to load a game file saved in 2511 where that save event triggered a major error/crash, but that's to be expected.

Revision history for this message
MP (pagel-d) wrote :

2522 still has the issue (game loaded was created in 2511). Attaching log file (lines beginning with ***** are manual comments) and save game files.

To recreate from save "t", go to the island to the S of shipwreck/HQ island. Pull the 3-way flag from just NE of the farm. Create new path from the farm to the Armorer (NW) along the coast/over the water.
Then attempt to save ("t2").

Revision history for this message
MP (pagel-d) wrote :
  • t.wgf Edit (667.9 KiB, application/octet-stream)
Revision history for this message
MP (pagel-d) wrote :
  • t2.wgf Edit (128.5 KiB, application/octet-stream)
Revision history for this message
MP (pagel-d) wrote :
  • t3.wgf Edit (124.4 KiB, application/octet-stream)
Revision history for this message
kaputtnik (franku) wrote :

If i follow the description in #5 i got different crashs:

If i connect the road to the smelting works (the port is not connected to rest of the economy anmore) sometimes i get:

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x00005555564241cb in LuaMaps::LuaEconomy::ware_target_quantity (this=0x555557004960, L=0x55555c89b4f8)
    at ../src/scripting/lua_map.cc:3553
3553 lua_pushinteger(L, quantity.permanent);

If the crash not happens and i want to save, i get:

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x0000555555fd88ff in Widelands::Player::get_economy_number (this=0x55555d5e1810, economy=0x55555bca0320)
    at ../src/logic/player.cc:778
778 if (*it == economy)

One time a window pops up saying: "... unreachbale code was reached".

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

Ok, i found the problem:

There is an open objective "Lower the demand of marble columns" which is not solved. If i solve this objective no crashes appear anymore.

The objective is checked here: http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/data/campaigns/emp03.wmf/scripting/mission_thread.lua#L100

Just a guess:
The Lua function checks the flag at the empire headquarters (shipreck in this case), to get access to the ware_target_quantity. If this flag is not part of the whole economy and his warehouses (by cutting of the roads), the function itself or parts of the involved methods crash.

Since this objective is one of the first objectives given, this problem never came up, because during testing it is also one of the first objectives which was solved, e.g. before any other warehouse was build.

Revision history for this message
TiborB (tiborb95) wrote :

I see there is some progress in this bug, but still I attach my two full backtraces, the same as mentioned above...

Revision history for this message
TiborB (tiborb95) wrote :

and second one

Revision history for this message
MP (pagel-d) wrote :

even when I had set the demand for marble columns to 4 (or fewer), that objective didn't clear. It eventually cleared when I collected all the pieces of Neptune (and won).

I had initially not set the demand low because I misunderstood the objective (my fault...). I had set the StoneMason's maximum quantity of input to 4 (from default of 6?), rather than adjusting the overall economy settings.

I'm not sure how disconnecting that road separates the port from the rest of the economy - just the farm should be isolated. The rest of the buildings on that island were interconnected either around the north side or straight down the west coast. It just no longer went in a loop around the whole island. Plus the farm was reconnected before I tried to save, and neither the pulled flag nor the 3 destroyed paths (nor the farm's flag) had any spare marble columns on it.

Revision history for this message
kaputtnik (franku) wrote :

> even when I had set the demand for marble columns to 4 (or fewer), that objective didn't clear.

Have you tried this with savegame t.wgf? Here it clears close after i set the demand to 4.

Also with this savegame the port is only connected to the headquarters with the 3-way flag connecting Stonemason-Farm-Port.

If i connect the port with headquarters with additional road(s) and then disconnect the farm no errors occur and i can normally save the game. Reconnecting the farm to the smelting works do work also then.

Revision history for this message
MP (pagel-d) wrote :

ahh...you're on the HQ island. The 3-way I pulled is on the island to the south of the starting HQ island. I disconnected the Farm->Port<-blockhouse/iron mine just to the east of the charcoal kiln

Revision history for this message
TiborB (tiborb95) wrote :

I cannot run the game right now to look, but just a theory - does pulling down the flag creates 2 new economies (in addition to the 'original' one)?

Revision history for this message
TiborB (tiborb95) wrote :

OK, this is not the case.
Theory 2: variable eco (see #11) becomes invalid due to manipulation with flags.. So change the lua script to get eco everytime you need to query.... and we will see

Revision history for this message
kaputtnik (franku) wrote :

The error of "unreachable code" shows only up in a window, not in console:

src/logic/player.cc:780
unreachable code was reached

After clicking 'OK' the game runs for a second and then crashes.

I couldn't reproduce the 'unreachable code' error with specific steps. What i do is:

1. Start the save game
2. Scroll the the port of HQ island
3. remove the flag of 3-way Farm-Port-Stonemason

After doing this it is equal (the game crashes close after doing one of this things:
- connect Port-Stonemaseon and connect Farm-smeltingworks
- connect Port-Farm

GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
status: New → Confirmed
Revision history for this message
GunChleoc (gunchleoc) wrote :

The problem here is that the target quantity is being checked while 2 economies are being merged. So the economy is disappearing on us while we're trying to access the target quantity.

Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: Confirmed → 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

Remote bug watches

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