MantisBT - Zandronum
View Issue Details
0002705Zandronum[All Projects] Bugpublic2016-04-21 20:322018-09-30 22:03
Marcaek 
Edward-san 
normalminoralways
closedfixed 
Windows8.1
3.0-beta 
3.03.0 
0002705: Skirmish menu crash when using mods
Starting a new game via Skirmish crashes you out if you are in an online server with certain ZDoom mods loaded.
Host a server with XA-Necro.pk3, join it then start a skirmish game.
Tested with'http://www.best-ever.org/download?file=xa-parko.pk3 [^]' as well, crashed.

No crash when not using mods.
No tags attached.
zip necroskirmcrash.zip (21,972) 2016-04-21 20:32
/tracker/file_download.php?file_id=1789&type=bug
Issue History
2016-04-21 20:32MarcaekNew Issue
2016-04-21 20:32MarcaekFile Added: necroskirmcrash.zip
2016-04-21 21:58Edward-sanAssigned To => Edward-san
2016-04-21 21:58Edward-sanStatusnew => assigned
2016-04-21 22:24Edward-sanNote Added: 0014739
2016-04-21 22:24Edward-sanStatusassigned => needs review
2016-04-21 22:24Edward-sanSummarySkrimish menu crash when using mods => Skirmish menu crash when using mods
2016-04-22 05:39Edward-sanNote Added: 0014740
2016-04-22 17:59Edward-sanNote Added: 0014741
2016-04-22 18:46Edward-sanStatusneeds review => feedback
2016-04-22 23:20Edward-sanNote Added: 0014742
2016-04-22 23:21Edward-sanNote Edited: 0014742bug_revision_view_page.php?bugnote_id=14742#r8921
2016-04-22 23:24Edward-sanNote Edited: 0014742bug_revision_view_page.php?bugnote_id=14742#r8922
2016-04-23 10:21Edward-sanNote Added: 0014743
2016-05-09 08:13Edward-sanNote Added: 0014845
2016-05-09 08:13Edward-sanStatusfeedback => needs testing
2016-05-11 22:28MarcaekNote Added: 0014870
2016-05-11 22:29Ru5tK1ngStatusneeds testing => resolved
2016-05-11 22:29Ru5tK1ngResolutionopen => fixed
2016-05-11 22:29Ru5tK1ngFixed in Version => 3.0
2016-05-11 22:29Ru5tK1ngTarget Version => 3.0
2018-09-30 22:03Blzut3Statusresolved => closed

Notes
(0014739)
Edward-san   
2016-04-21 22:24   
'https://bitbucket.org/Torr_Samaho/zandronum/pull-requests/88/fixed-possible-crashes-when-running-a/diff [^]'
(0014740)
Edward-san   
2016-04-22 05:39   
I'd like to mention that it happens also if you bind a key to "map map01" and press the key when you joined the game. It doesn't happen when the console is open and 'map map01' is executed. This might help find the very real culprit..
(0014741)
Edward-san   
2016-04-22 17:59   
Quote

<edward-san> so I analyzed a bit zdoom's code regarding why it doesn't crash in statusbar
<edward-san> and the answer is that player's mo is not touched at all from the moment 'map map01' key is pressed to the statusbar tick
<edward-san> zandronum, on the other hand, clears everything when a player disconnects
<edward-san> with PLAYER_ResetPlayerData
<edward-san> which is called by CLIENT_ClearAllPlayers
<edward-san> which is called by CLIENT_QuitNetworkGame
<edward-san> if I remove CLIENT_ClearAllPlayers call inside CLIENT_QuitNetworkGame, no crash anymore


So I made this commit aside from the pull request:

'https://bitbucket.org/crimsondusk/zandronum-sandbox/commits/dc479629c29aa71b4510c03fc7a01b0349cc029e [^]'
(0014742)
Edward-san   
2016-04-22 23:20   
(edited on: 2016-04-22 23:24)
The new approach introduced a crash:

Quote

<WaTaKiD> host server, connect 2 clients, the second client (idx 1) crashes when trying to start a skirmish
<WaTaKiD> whereas if u repeat these steps but with the first client, no crash


so I added this code:


    for ( ULONG ulIdx = 1; ulIdx < MAXPLAYERS; ++ulIdx )
    {
        playeringame[ulIdx] = false;
    }


where I removed CLIENT_ClearAllPlayers, but then the crash happens at the next doom loop, inside the player sprite code:


Program received signal SIGSEGV, Segmentation fault.
0x0000000000619495 in userinfo_t::GetSkin (this=0x1a914d0 <players+1808>)
    at /home/edward-san/zdoom/zandronum/sandbox/src/d_player.h:381
381 return *static_cast<FIntCVar *>(*CheckKey(NAME_Skin));
(gdb) bt
#0 0x0000000000619495 in userinfo_t::GetSkin (this=0x1a914d0 <players+1808>)
    at /home/edward-san/zdoom/zandronum/sandbox/src/d_player.h:381
#1 0x00000000007c7109 in P_CheckPlayerSprite (actor=0x2e33620,
    spritenum=@0x7fffffffc270: 30, scalex=@0x7fffffffc274: 65536,
    scaley=@0x7fffffffc278: 65536)
    at /home/edward-san/zdoom/zandronum/sandbox/src/p_user.cpp:2488
0000002 0x0000000000804ab5 in R_ProjectSprite (thing=0x2e33620, fakeside=0,
    fakefloor=0x0, fakeceiling=0x0)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_things.cpp:548
0000003 0x0000000000805de7 in R_AddSprites (sec=0x266b6b0, lightlevel=112,
    fakeside=0)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_things.cpp:949
0000004 0x00000000007e1033 in R_Subsector (sub=0x2655fb8)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1294
0000005 0x00000000007e15db in R_RenderBSPNode (node=0x2655fb9)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1391
0000006 0x00000000007e1585 in R_RenderBSPNode (node=0x26496a8)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000007 0x00000000007e1585 in R_RenderBSPNode (node=0x26496f0)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000008 0x00000000007e1585 in R_RenderBSPNode (node=0x26497c8)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000009 0x00000000007e1585 in R_RenderBSPNode (node=0x2649930)
---Type <return> to continue, or q <return> to quit---
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000010 0x00000000007e1585 in R_RenderBSPNode (node=0x2649cd8)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000011 0x00000000007e1585 in R_RenderBSPNode (node=0x264a620)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000012 0x00000000007e1585 in R_RenderBSPNode (node=0x264a668)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000013 0x00000000007e1585 in R_RenderBSPNode (node=0x264bd78)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_bsp.cpp:1382
0000014 0x00000000007ea9c9 in R_RenderActorView (actor=0x26c1af0,
    dontmaplines=false)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_main.cpp:846
0000015 0x00000000007d9b0e in FSoftwareRenderer::RenderView (this=0x204da20,
    player=0x1a90dc0 <players>)
    at /home/edward-san/zdoom/zandronum/sandbox/src/r_swrenderer.cpp:117
0000016 0x000000000064a3a8 in D_Display ()
    at /home/edward-san/zdoom/zandronum/sandbox/src/d_main.cpp:974
0000017 0x000000000064b47e in D_DoomLoop ()
    at /home/edward-san/zdoom/zandronum/sandbox/src/d_main.cpp:1331
0000018 0x000000000064f7fc in D_DoomMain ()
    at /home/edward-san/zdoom/zandronum/sandbox/src/d_main.cpp:3249
0000019 0x00000000005cbede in main (argc=6, argv=0x7fffffffdf88)
    at /home/edward-san/zdoom/zandronum/sandbox/src/sdl/i_main.cpp:371


I hope to find out why and how to solve this..

(0014743)
Edward-san   
2016-04-23 10:21   
I managed to fix this by porting manually this commit by using this zdoom-sync commit for solving the merge conflicts (done here), then use the new changes in the client code (which is done here).
(0014845)
Edward-san   
2016-05-09 08:13   
It was decided to add the workaround from this pull request for the time being, with this changeset:'https://bitbucket.org/Torr_Samaho/zandronum/commits/abcd5b533237039587156f2ea77895dafc8005c6 [^]' .
(0014870)
Marcaek   
2016-05-11 22:28   
Confirmed latest build fixed this.