Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load savegame #524

Closed
stefson opened this issue Jul 27, 2016 · 12 comments
Closed

cannot load savegame #524

stefson opened this issue Jul 27, 2016 · 12 comments

Comments

@stefson
Copy link
Contributor

stefson commented Jul 27, 2016

I am at ef11b10

I'm using gcc 4.9.3 , glibc-2.22 , system boost libraries , anything else that might be helpfull?
save game is here Steffen 4.sav.zip

here is the backtrace

Connection to 127.0.0.1:3665
Sucessfully connected to localhost:3665
SERVER: Using gameframe length of 40ms
SERVER: Using networkframe length of 6 GFs (240ms)

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff7bcfc29 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
36 ../sysdeps/unix/sysv/linux/pt-raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff7bcfc29 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
#1 0x000000000077dad2 in SerializedGameData::ReadSnapshot (this=0x571bac8, gw=...)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/SerializedGameData.cpp:232

#2 0x0000000000572adb in GameClient::StartGame (this=0x5630300,

random_init=random_init@entry=4294967295)
at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameClient.cpp:290

#3 0x000000000056248c in GameServer::StartGame (this=this@entry=0x563a740)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameServer.cpp:542

#4 0x00000000005637b7 in GameServer::StartCountdown (this=0x563a740)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameServer.cpp:474

#5 0x00000000005d9d60 in dskHostGame::Msg_ButtonClick (this=0x59155a0, ctrl_id=2)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/desktops/dskHostGame.cpp:628

#6 0x00000000007a596e in ctrlButton::Msg_LeftUp (this=0x5915fb0, mc=...)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/controls/ctrlButton.cpp:85

#7 0x0000000000775a56 in Window::RelayMouseMessage (this=0x59155a0, msg=

(bool (Window::*)(Window * const, const MouseCoords &)) 0xc96, this adjustment 5, 
mc=...)
at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/Window.cpp:186

---Type to continue, or q to quit---
#8 0x0000000000585d81 in WindowManager::Msg_LeftUp (this=0xc40250, mc=...)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/WindowManager.cpp:421

#9 0x00007ffff4240d55 in VideoSDL::MessageLoop (this=0xc17ef0)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/driver/video/SDL/src/VideoSDL.cpp:353

#10 0x000000000054d889 in GameManager::Run (this=0xc0e750)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameManager.cpp:145

#11 0x0000000000547a95 in RunProgram (options=...)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/main.cpp:365

#12 0x00000000004ea6b1 in main (argc=1, argv=0x7fffffffdcb8)

at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/main.cpp:420

(gdb) continue
Continuing.
Assertion failure in "ReadSnapshot" at SerializedGameData.cpp#232: expectedObjectsReadCount == GameObject::GetObjCount()ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.29/work/alsa-lib-1.0.29/src/pcm/pcm.c:7905:(snd_pcm_recover) underrun occurred

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff7bcfc29 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
36 in ../sysdeps/unix/sysv/linux/pt-raise.c

@MarcusSt
Copy link
Contributor

The save game you uploaded works fine here.

@Flamefire
Copy link
Member

@MarcusSt This is an assertion that fails. So nothing in release mode.
Note that this even reports the line of failure and the source has a comment about this:

// If this check fails, we did not serialize all objects or there was an async
RTTR_Assert(expectedObjectsReadCount == GameObject::GetObjCount());

@MarcusSt
Copy link
Contributor

@Flamefire You don't say? I found that line as well, but the assertion didn't trigger here. At least some time ago, assertions were triggered with reldeb as well.

@Flamefire
Copy link
Member

Ok, just thought you missed that and wanted to help.
For reference: RTTR_Assert_Enabled=1 for CMake or not defining NDEBUG (probably in RelDeb?) will enable assertions.

GDB outputs:

Breakpoint 1, SerializedGameData::ReadSnapshot (this=0x6bd77a8, gw=...) at /home/grund59/git/s25client/src/SerializedGameData.cpp:232
232 RTTR_Assert(expectedObjectsReadCount == GameObject::GetObjCount());
(gdb) p expectedObjectsReadCount
$1 = 17563
(gdb) p GameObject::GetObjCount()
$2 = 6110

@Flamefire
Copy link
Member

@stefson Something seems to be wrong with the savegame. Do you have the replay?

@stefson
Copy link
Contributor Author

stefson commented Jul 27, 2016

well, this is kind of strange. I found two replays, one is faulty and gives a similar error as I'm trying to load it
faulty_2016-07-17_19-47-16.rpl.zip

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff7bcfc29 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
36 ../sysdeps/unix/sysv/linux/pt-raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff7bcfc29 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
#1 0x000000000077f022 in SerializedGameData::ReadSnapshot (this=0x72b9de8, gw=...) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/SerializedGameData.cpp:232
#2 0x0000000000572d7b in GameClient::StartGame (this=this@entry=0x5634fc0, random_init=4294967295)
at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameClient.cpp:290
#3 0x0000000000574386 in GameClient::StartReplay (this=0x5634fc0, path="/home/tim/.s25rttr/REPLAYS/2016-07-17_19-47-16.rpl")
at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameClient.cpp:1536
#4 0x000000000068f27e in iwPlayReplay::StartReplay (this=0xe5f2740) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/ingameWindows/iwPlayReplay.cpp:193
#5 0x00000000007b849c in ctrlTable::Msg_LeftUp (this=0xe5fd280, mc=...) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/controls/ctrlTable.cpp:367
#6 0x0000000000776fb6 in Window::RelayMouseMessage (this=this@entry=0xe5f2740, msg=&virtual table offset 21256, this adjustment 5, mc=...)
at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/Window.cpp:186
#7 0x0000000000585fb1 in WindowManager::Msg_LeftUp (this=0xc41250, mc=...) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/WindowManager.cpp:430
#8 0x00007ffff4240d55 in VideoSDL::MessageLoop (this=0xc18ef0) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/driver/video/SDL/src/VideoSDL.cpp:353
#9 0x000000000054daf9 in GameManager::Run (this=0xc0f750) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/GameManager.cpp:145
#10 0x0000000000547d05 in RunProgram (options=...) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/main.cpp:365
#11 0x00000000004ea8c1 in main (argc=1, argv=0x7fffffffdcb8) at /var/tmp/portage/games-strategy/s25rttr-9999-r3/work/s25rttr-9999/src/main.cpp:420

the second one loads, but it states to be async from frame 56700 on
async_2016-07-17_14-29-33.rpl.zip

Warnung: Das abgespielte Replay ist nicht mehr mit dem Originalspiel synchron. (GF: 56700)
Async at GF 56700: Checksum 19157:19157 ObjCt 11179:5590 ObjIdCt 1243494:1243494

Hopefully I haven't confused them? :-) Oh, it is a linux amd64, if thats important to know.

@Flamefire
Copy link
Member

Flamefire commented Jul 27, 2016

Intresting: ObjCt 11179:5590 is a similar error as here: expectedObjectsReadCount = 17563 != GameObject::GetObjCount() = 6110

I'll try this later, but it seems a bunch of objects just goes missing.

@Flamefire
Copy link
Member

Flamefire commented Jul 27, 2016

@stefson It seems the error is not in those replays (already faulty). Do you have the earlier replay too? Maybe the map itself might also help

@stefson
Copy link
Contributor Author

stefson commented Jul 27, 2016

2016-07-17_12-48-04.rpl.zip

It might be this one?

@Flamefire
Copy link
Member

We probably found the cause: Copy assignment increments the object counter which is wrong. Seems like your compiler choose to use the assignment instead of the copy ctor which leads to this bug which is then detected during loading (and since 60b77d1 also during saving) in debug mode. You can continue your game by simply turning assertions off, load and save again. Then you can turn assertions on again.

@stefson
Copy link
Contributor Author

stefson commented Jul 28, 2016

could you please explain me how to do this?

@Flamefire
Copy link
Member

Either use the prebuild nightly or build in release mode (set CMAKE_BUILD_TYPE=Release with ccmake or cmake-gui) then turn it back to Debug after saving your game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants