2019-12-14 22:32 CET

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0004892Spring engineGeneralpublic2015-07-09 15:28
Reporterhokomoko 
Assigned TojK 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version99.0+git 
Target Version100.0Fixed in Version 
Summary0004892: Assertion fails in GameServer.cpp
Descriptionhttps://github.com/spring/spring/blob/develop/rts/Net/GameServer.cpp#L2569

assert(p.myState == GameParticipant::UNCONNECTED) fails when watching a demo.
Steps To ReproduceWatch the attached demo, ignore the fact it desyncs (already fixed),
In frame 17190 the assertion fails.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0014935

jK (developer)

only when watching a demo that were recorded with a spring version prior to the change

~0014936

hokomoko (developer)

You could check the demo name and see it's from 99.0.1-91-g2758cb6

~0014946

abma (administrator)

(i hope demotools dump shows correct info):

000000 PLAYERNAME: Playernum: 15 Name: [NC]Gretchen
000000 STARTPOS: Playernum: 15 Team: 9 Readyness: 0
017190 NETMSG_CREATE_NEWPLAYER: Playernum: 15 Spectator: 0 Team: 31 PlayerName: Seisdrum


looks weird to me, Playernum 15 is assigned twice it seems, but with different team?!

~0014947

cleanrock (developer)

Indexing mistake, do this:
+++ b/tools/DemoTool/DemoTool.cpp
@@ -361,9 +361,9 @@ void TrafficDump(CDemoReader& reader, bool trafficStats)
                                break;
                        case NETMSG_CREATE_NEWPLAYER:
                                // uchar myPlayerNum, uchar spectator, uchar teamNum, std::string playerName
- std::cout << "NETMSG_CREATE_NEWPLAYER: Playernum: " << (unsigned)buffer[1];
- std::cout << " Spectator: " << (unsigned)buffer[2];
- std::cout << " Team: " << (unsigned) buffer[3];
+ std::cout << "NETMSG_CREATE_NEWPLAYER: Playernum: " << (unsigned)buffer[3];
+ std::cout << " Spectator: " << (unsigned)buffer[4];
+ std::cout << " Team: " << (unsigned) buffer[5];
                                std::cout << " PlayerName: " << (char*) (buffer + 6);
                                std::cout << std::endl;
                                break;

And you get this:
$ ./demotool --dump -f "/home/johanr/.spring/bug_4892/20150707_221306_TartarusV7_99.0.1-91-g2758cb6 develop.sdf" | grep Seisdrum
017190 NETMSG_CREATE_NEWPLAYER: Playernum: 31 Spectator: 1 Team: 0 PlayerName: Seisdrum

~0014948

abma (administrator)

meh, looks legit then. thanks! (Playernum 31 is unique)

~0014949

cleanrock (developer)

Perhaps we can use DemoFileHeader::numPlayers to avoid this problem:
int numPlayers; ///< Number of players for which stats are saved. (this contains also later joined spectators!)

~0014950

cleanrock (developer)

$ ./demotool --header -f "/home/johanr/.spring/bug_4892/20150707_221306_TartarusV7_99.0.1-91-g2758cb6 develop.sdf"
Magic: spring demofile
Version: 5
HeaderSize: 352
VersionString: 99.0.1-91-g2758cb6 develop
GameID: c4329c55c5ccd783b9da69ed40c2d64e
UnixTime: 1436299986
ScriptSize: 374502
DemoStreamSize: 2103748
GameTime: 830
WallclockTime: 975
NumPlayers: 34
PlayerStatSize: 680
PlayerStatElemSize: 20
NumTeams: 23
TeamStatSize: 104972
TeamStatElemSize: 80
TeamStatPeriod: 15

~0014951

cleanrock (developer)

DemoFileHeader::numPlayers (34) is already used but CGameServer::BindConnection selects wrong id because "Unnamed player (spec)" is found at index 31.

~0014952

cleanrock (developer)

Just to be clear, in CGameServer::BindConnection:
  size_t newPlayerNumber = players.size();
sets newPlayerNumber to 34 but for loop finds "Unnamed player (spec)" at index 31.

~0014953

hokomoko (developer)

Fix ba8199b3946b3db094053e1efecd4b986dddf9ed committed to develop branch: Fix 0004892
Scan through the demo for all players added and make sure they're in the
starting script, repo: spring changeset id: 5357

~0014954

jK (developer)

Fix bab30f6a335d250b3d497c9c966f44640f785897 committed to develop branch: fix 0004892: with less code, repo: spring changeset id: 5360
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2015-07-07 23:47 hokomoko New Issue
2015-07-07 23:47 hokomoko File Added: assertdemo.zip
2015-07-08 00:32 jK Note Added: 0014935
2015-07-08 00:39 hokomoko Note Added: 0014936
2015-07-09 07:56 abma Note Added: 0014946
2015-07-09 08:10 cleanrock Note Added: 0014947
2015-07-09 10:00 abma Note Added: 0014948
2015-07-09 10:53 cleanrock Note Added: 0014949
2015-07-09 10:58 cleanrock Note Added: 0014950
2015-07-09 13:30 cleanrock Note Added: 0014951
2015-07-09 13:52 cleanrock Note Added: 0014952
2015-07-09 15:13 hokomoko Changeset attached => spring develop ba8199b3
2015-07-09 15:13 hokomoko Note Added: 0014953
2015-07-09 15:13 hokomoko Assigned To => hokomoko
2015-07-09 15:13 hokomoko Status new => resolved
2015-07-09 15:13 hokomoko Resolution open => fixed
2015-07-09 15:28 jK Changeset attached => spring develop a750869a
2015-07-09 15:28 jK Changeset attached => spring develop bab30f6a
2015-07-09 15:28 jK Note Added: 0014954
2015-07-09 15:28 jK Assigned To hokomoko => jK
+Issue History