MantisBT - Zandronum
View Issue Details
0003110Zandronum[All Projects] Bugpublic2017-04-30 11:132018-09-30 21:45
Korshun 
Torr Samaho 
normalminoralways
closedfixed 
MicrosoftWindowsXP/Vista/7
3.0-beta 
3.03.0 
0003110: Using anything other than console commands to exit to a nonexistent map makes the server enter an infinite loop
"map" and "changemap" check that destination exists before executing. Other ways don't. While switching to a nonexistent map in singleplayer simply stops the game, doing so on a server in 3.0 makes it enter an infinite map loading loop with 100% cpu. But 2.1.2 just goes back to the same map.

The server should just stop or go back to previous valid map or not allow going to nonexistent maps in the first place.

The attached wad is a map with two switches that lead to nonexistent maps using different methods. Host it on a real server.
No tags attached.
? exittest.wad (1,893) 2017-04-30 11:13
https://zandronum.com/tracker/file_download.php?file_id=2089&type=bug
Issue History
2017-04-30 11:13KorshunNew Issue
2017-04-30 11:13KorshunFile Added: exittest.wad
2017-04-30 15:42Torr SamahoNote Added: 0017448
2017-04-30 15:42Torr SamahoAssigned To => Torr Samaho
2017-04-30 15:42Torr SamahoStatusnew => feedback
2017-04-30 16:08KorshunNote Added: 0017449
2017-04-30 16:08KorshunStatusfeedback => assigned
2017-05-01 17:25Torr SamahoNote Added: 0017481
2017-05-01 17:25Torr SamahoStatusassigned => needs testing
2017-05-01 17:25Torr SamahoTarget Version => 3.0
2017-05-01 18:00WaTaKiDNote Added: 0017486
2017-05-01 18:08KorshunNote Added: 0017487
2017-05-01 18:41Torr SamahoNote Added: 0017493
2017-05-01 18:50KorshunNote Added: 0017495
2017-05-01 18:51KorshunNote Edited: 0017495bug_revision_view_page.php?bugnote_id=17495#r10517
2017-05-01 19:06WaTaKiDNote Added: 0017499
2017-05-01 19:08Torr SamahoNote Added: 0017500
2017-05-07 10:35Torr SamahoNote Added: 0017569
2017-05-07 12:58WaTaKiDNote Added: 0017575
2017-05-14 16:32Ru5tK1ngNote Added: 0017681
2017-05-14 16:32Ru5tK1ngStatusneeds testing => resolved
2017-05-14 16:32Ru5tK1ngResolutionopen => fixed
2017-05-14 16:32Ru5tK1ngFixed in Version => 3.0
2018-09-30 21:45Blzut3Statusresolved => closed

Notes
(0017448)
Torr Samaho   
2017-04-30 15:42   
The offline behavior of 3.0 seems to be consistent with GZDoom 1.8.6. Can you confirm that? If so, is GZDoom 2.4.0 behaving differently? The new behavior of GZDoom 1.8.6, i.e. to error out, seems correct to me.
(0017449)
Korshun   
2017-04-30 16:08   
Yes, it is consistent with GZDoom 1.8.6. And GZDoom 1.8.6 is the same as GZDoom 2.4.0.
(0017481)
Torr Samaho   
2017-05-01 17:25   
The server should now restart itself on map01/e1m1 when a mod instructs it to switch to a non-existing map.
(0017486)
WaTaKiD   
2017-05-01 18:00   
this build contains the fix: 'https://www.dropbox.com/s/hayd6havowr3my5/zandronum-3.0-r170501-1721-6265097-windows.zip?dl=0 [^]'
(0017487)
Korshun   
2017-05-01 18:08   
It works! But what if the iwad has neither MAP01 nor E1M1? From the code of the fix and CalcMapName it seems it would get stuck in the same endless loop of loading nonexistent MAP01 or E1M1.
(0017493)
Torr Samaho   
2017-05-01 18:41   
Yeah, that's right. Are there iwads that have neither?
(0017495)
Korshun   
2017-05-01 18:50   
(edited on: 2017-05-01 18:51)
I am not aware of any. But it's not too far-fetched to imagine an iwad that only uses maps like MYMOD01 or SOMENAME. Actually, a commercial game that uses GZDoom GPL does just that.

Even if there are no zandronum wads like that yet, they might appear. Going to the previous map is more reliable, as the map is guaranteed to exist.

(0017499)
WaTaKiD   
2017-05-01 19:06   
i decided to check out 'https://zdoom.org/wiki/IWAD [^]' and it seems the adventures of square is the only iwad here that doesnt use map01 or e1m1, but instead e1a1, however zan 3.0 cant load it, but zan 4.0 can
(0017500)
Torr Samaho   
2017-05-01 19:08   
The problem is that by the time the server has errored out, it's not so clear anymore what the previous map was. Thus, I followed what the ZDoom code used in 3.0 does to initialize "startmap". A different possibility would be to use AllEpisodes[0].mEpisodeMap.
(0017569)
Torr Samaho   
2017-05-07 10:35   
SERVER_ErrorCleanup now more carefully looks for a valid map to restart the game and exits the server if no map can be found. I think this should be sufficiently robust now.
(0017575)
WaTaKiD   
2017-05-07 12:58   
this build contains the new fix: 'https://www.dropbox.com/s/6x8dmuya1y7qm8r/zandronum-3.0-r170507-1032-c5ac7b4-windows.zip?dl=0 [^]'
(0017681)
Ru5tK1ng   
2017-05-14 16:32   
Tested this with r170513 and the server successfully restarted to map01, e1m1 and e1a1 after pushing the switches in the testwad online.