MantisBT - Zandronum
View Issue Details
0002997Zandronum[All Projects] Bugpublic2017-01-28 21:452018-09-30 21:50
Decay 
Torr Samaho 
normalcrashrandom
closedfixed 
2.0 
3.03.0 
0002997: Server freezes after random map rotation
Potentially only applicable to large map numbers OVER MULTIPLE PK3s and/or Wads only.

Tested in TSPG and NJ Funcrusher +

AeonDM.pk3 + DBABrm.pk3 (total of 66 maps) Servers freeze after completing a random map rotation. Server did freeze with AeonDm + DBABrm + eondm1.wad + neondmbeta3.pk3 (total 98 maps?) as well.

Freezes in 3.0 as well
Wait in a server until the maplists cycle through and it will hang

Oddly enough on NJ the following flags were used at first
dmflags 539759748
dmflags2 16777728
zadmflags 2050
zacompatflags 4325376
 
I could not get this to freeze the server, but upon changing the flags to:
dmflags 2905092
dmflags2 1536
zacompatflags 655368

The server crashed after 1 rotation
I speculate the server hangs only when the completed rotation ends on 1 wad/pk3 and begins on another but this cannot be confirmed.
No tags attached.
Issue History
2017-01-28 21:45DecayNew Issue
2017-01-28 22:03AlexMaxNote Added: 0016711
2017-01-29 15:30Torr SamahoNote Added: 0016713
2017-01-29 15:30Torr SamahoAssigned To => Torr Samaho
2017-01-29 15:30Torr SamahoStatusnew => needs testing
2017-01-29 15:32capodecimaNote Added: 0016714
2017-01-29 15:36capodecimaNote Edited: 0016714bug_revision_view_page.php?bugnote_id=16714#r10086
2017-01-29 18:31DecayNote Added: 0016717
2017-01-29 20:36Torr SamahoNote Added: 0016719
2017-02-06 00:12DecayNote Added: 0016764
2017-02-06 00:13Ru5tK1ngStatusneeds testing => resolved
2017-02-06 00:13Ru5tK1ngResolutionopen => fixed
2017-02-06 00:13Ru5tK1ngFixed in Version => 3.0
2017-02-06 00:13Ru5tK1ngTarget Version => 3.0
2018-09-30 21:50Blzut3Statusresolved => closed

Notes
(0016711)
AlexMax   
2017-01-28 22:03   
I was able to replicate this on NJ. From what I can tell, the process gets stuck in an endless busy-loop around line 115-117 of maprotation.cpp.

Printing out g_MapRotationEntries shows me a vector where the bUsed of all but one map is set to true. I think it's getting wedged trying to select a new random map.

I'm not a huge fan of what the code is currently doing. Instead of picking a random number and relying on entropy to eventually pick a map that hasn't been visited, I think that instead Zandronum should count the number of maps that haven't been visited yet, pick a random number from that reduced number of maps, and then simply start the 'next map' indicator at slot zero and advance it by that many maps, skipping over already selected maps. That way, you're guaranteed to select an unvisited map the first try.
(0016713)
Torr Samaho   
2017-01-29 15:30   
Can you check if'https://bitbucket.org/zandronum/zandronum-sandbox/commits/79aca234459d14b17137c4a8eb3976a63f8e354c [^]' fixes the issue?
(0016714)
capodecima   
2017-01-29 15:32   
(edited on: 2017-01-29 15:36)
I am not sure but i think this has something to do with "heapsize". Try not to use host servers at $0.99 shared machines but go full machine for truly enjoyment and 49% LG accuracy with Rustkings awesome gunpack..

(0016717)
Decay   
2017-01-29 18:31   
I went through 5 or so rotations on NJ Funcrusher+ with that build with no problem, so initial testing seems to indicate it's fine now.
(0016719)
Torr Samaho   
2017-01-29 20:36   
Thanks for checking! I pushed the fix to the main repo.
(0016764)
Decay   
2017-02-06 00:12   
Multiple play sessions did not yield a hang, I think it's safe to say this ticket can be closed.