MantisBT - Zandronum
View Issue Details
0001557Zandronum[All Projects] Bugpublic2013-10-26 21:082018-09-30 23:51
StrikerMan780 
Dusk 
normalmajoralways
closedfixed 
1.2 
1.41.4 
0001557: SetFont and SetHudSize leak into other scripts online
This bug needs two people to test, and I've made a test wad. This is a problem that has been around for a while now. Online, if another user executes a script that uses SetFont or SetHudSize, while another person is viewing a HudMessage, those functions will leak into the other user's script.
zandronum -host -file setfonttest.pk3
zandronum -connect localhost -file setfonttest.pk3
In console: puke 1
No tags attached.
zip TestWad_SetFontLeak.zip (18,994) 2013-10-26 21:08
/tracker/file_download.php?file_id=1090&type=bug
zip TestWad_SetFontLeak2.zip (162,761) 2013-10-26 23:00
/tracker/file_download.php?file_id=1091&type=bug
? setfonttest.pk3 (1,119) 2014-11-30 03:08
/tracker/file_download.php?file_id=1335&type=bug
Issue History
2013-10-26 21:08StrikerMan780New Issue
2013-10-26 21:08StrikerMan780File Added: TestWad_SetFontLeak.zip
2013-10-26 21:09StrikerMan780Note Added: 0007469
2013-10-26 21:11StrikerMan780Note Edited: 0007469bug_revision_view_page.php?bugnote_id=7469#r4165
2013-10-26 21:12DuskNote Added: 0007470
2013-10-26 21:12DuskStatusnew => feedback
2013-10-26 22:00IvanNote Added: 0007471
2013-10-26 23:00StrikerMan780Note Added: 0007473
2013-10-26 23:00StrikerMan780Statusfeedback => new
2013-10-26 23:00StrikerMan780File Added: TestWad_SetFontLeak2.zip
2013-10-26 23:01StrikerMan780Note Edited: 0007473bug_revision_view_page.php?bugnote_id=7473#r4167
2013-10-27 20:40DuskAssigned To => Dusk
2013-10-27 20:40DuskStatusnew => assigned
2013-10-30 14:20ToxicityNote Added: 0007492
2013-11-06 12:09DuskStatusassigned => new
2014-06-15 14:43DuskAssigned ToDusk =>
2014-07-29 03:34WatermelonNote Added: 0010071
2014-07-29 03:39StrikerMan780Note Added: 0010072
2014-10-11 07:17CatastropheNote Added: 0010466
2014-10-11 07:21CatastropheNote Edited: 0010466bug_revision_view_page.php?bugnote_id=10466#r5672
2014-10-11 07:22CatastropheNote Edited: 0010466bug_revision_view_page.php?bugnote_id=10466#r5673
2014-10-11 07:25CatastropheNote Edited: 0010466bug_revision_view_page.php?bugnote_id=10466#r5674
2014-10-11 15:23CatastropheNote Edited: 0010466bug_revision_view_page.php?bugnote_id=10466#r5689
2014-10-12 01:30DuskNote Added: 0010518
2014-10-12 01:31DuskAssigned To => Dusk
2014-10-12 01:31DuskStatusnew => confirmed
2014-11-30 02:41DuskFile Added: setfonttest.pk3
2014-11-30 02:42DuskNote Added: 0011003
2014-11-30 02:42DuskDescription Updatedbug_revision_view_page.php?rev_id=6059#r6059
2014-11-30 02:42DuskSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6061#r6061
2014-11-30 02:42DuskStatusconfirmed => assigned
2014-11-30 02:44DuskNote Edited: 0011003bug_revision_view_page.php?bugnote_id=11003#r6063
2014-11-30 02:45DuskNote Edited: 0011003bug_revision_view_page.php?bugnote_id=11003#r6064
2014-11-30 02:53DuskNote Edited: 0011003bug_revision_view_page.php?bugnote_id=11003#r6065
2014-11-30 03:07DuskNote Added: 0011004
2014-11-30 03:07DuskStatusassigned => needs review
2014-11-30 03:08DuskFile Deleted: setfonttest.pk3
2014-11-30 03:08DuskFile Added: setfonttest.pk3
2014-11-30 03:29DuskNote Edited: 0011004bug_revision_view_page.php?bugnote_id=11004#r6067
2014-11-30 17:03cobaltStatusneeds review => needs testing
2014-11-30 17:03cobaltTarget Version => 1.4
2014-11-30 17:03cobaltSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6068#r6068
2014-11-30 17:03cobaltNote Added: 0011007
2015-01-18 06:09TerminusEst13Note Added: 0011424
2015-01-18 06:10TerminusEst13Note Edited: 0011424bug_revision_view_page.php?bugnote_id=11424#r6432
2015-01-18 10:44DuskStatusneeds testing => resolved
2015-01-18 10:44DuskFixed in Version => 1.4
2015-01-18 10:44DuskResolutionopen => fixed
2018-09-30 23:51Blzut3Statusresolved => closed

Notes
(0007469)
StrikerMan780   
2013-10-26 21:09   
(edited on: 2013-10-26 21:11)
Another thing you can do, is pick up one mystery item, then have another player pick one up a few seconds after. If the timing is right, the font on your end will be huge all of the sudden.

Also, SMMP is OpenGL-only, so you'll need it in order to see where the 3 mystery items are.

(0007470)
Dusk   
2013-10-26 21:12   
Do you seriously expect us to download a 140mb wad to try confirm an issue? Make a stand-alone example WAD.
(0007471)
Ivan   
2013-10-26 22:00   
I know what he means. Try to have two scripts execute, where one executes shortly after the another and have them both have SetFont and SetHudsize, each with a different value. (To observe easier hudsize could be 640x480 on one and 320x200 on the other) You'll notice that the script that executes after the first one will override the previous' hudsize value and make it look bigger. This is very common in GvH and has been there for a while.
(0007473)
StrikerMan780   
2013-10-26 23:00   
(edited on: 2013-10-26 23:01)
"Do you seriously expect us to download a 140mb wad to try confirm an issue? Make a stand-alone example WAD."

It takes twice, if not three times longer to make a test wad with the necessary scripts and actors cherry-picked from a large project without them messing up/breaking, than to download a PK3/Wad that is already known to reproduce the problem without fail.

Anyhow, a took the last 45/50 minutes to put an updated test wad together. No other resources are necessary now. I'll attach it in a second.

(0007492)
Toxicity   
2013-10-30 14:20   
This has been a bug since forever.

'http://zandronum.com/forum/showthread.php?tid=224 [^]'


The only way to safely prevent it is to make all of your SetFont and HudMessage calls in a CLIENTSIDE script that you call from your main script.
(0010071)
Watermelon   
2014-07-29 03:34   
Youll have to use something like this I believe due to how ZDoom is structured:


// Might need some more args
function void drawImage(str imgName, int x, int y, int id, int time)
{
    SetHudSize(...);
    SetFont(imgName);
    HudMessage(s: "a"; ...);
}
(0010072)
StrikerMan780   
2014-07-29 03:39   
It's an online-only bug. Offline it doesn't happen, no matter what the situation is, even with bots. I doubt it has to do with ZDoom's structure, otherwise I'd think the same issue would happen there. (Which it doesn't, even in multiplayer from my testing so far.)
(0010466)
Catastrophe   
2014-10-11 07:17   
(edited on: 2014-10-11 15:23)
Just gonna add a little more info here. The issue is definitely setfont and not sethudsize. Basically if you do a setfont, it leaks into other scripts. The only way to fix this is to call setfont before every single hud message. But I've had strange anomalies where if I display an image using setfont, it will leak into other hudmessages and turn all of them into the same image regardless if I did setfont the tic before.

I think the best way to test is going to some "big" mods like all out war or GvH and finding some scripts where the same setfont is called multiple times in a script and get rid of all but one.

Edit: You guys might as well mark this confirmed. This happens for sure online on various mods.

(0010518)
Dusk   
2014-10-12 01:30   
The server doesn't have a screen so it stores the font elsewhere. I guess said elsewhere doesn't get reset properly.
(0011003)
Dusk   
2014-11-30 02:42   
(edited on: 2014-11-30 02:53)
Added a simpler testcase

EDIT: Found out why this happens. The server stores the string value of 'activefont', however 'activefont' is a member of DLevelScript and thus script-dependant.
EDIT 2: SetHudSize() works fine for me and doesn't leak anywhere.

(0011004)
Dusk   
2014-11-30 03:07   
(edited on: 2014-11-30 03:29)
'https://bitbucket.org/Torr_Samaho/zandronum-stable/pull-request/108 [^]'

(0011007)
cobalt   
2014-11-30 17:03   
Issue addressed by commit b4c7a59679a7: - fixed: setfont() would 'leak' into other scripts online (fixes 1557)
Committed by Teemu Piippo [Dusk] on Sunday 30 November 2014 05:28:08

Changes in files:
 docs/zandronum-history.txt | 1 +
 src/p_acs.cpp | 15 +++++++--------
 src/p_acs.h | 1 +
 src/sv_main.cpp | 16 ----------------
 src/sv_main.h | 2 --
 5 files changed, 9 insertions(+), 26 deletions(-)
(0011424)
TerminusEst13   
2015-01-18 06:09   
(edited on: 2015-01-18 06:10)
In Push, there's a map (Push42) where there's a constant HudMessage loop noting the gravity of the area--there's also setfont wonkery going on when the player gets hit with a serious blow, as the script makes a series of Matrix-y fonts scroll down the screen and alternates between smallfont and bigfont constantly.

On the newest 2.0 build, this leak seems to be fixed, as the hudmessage loop on Push42 remained smallfont the entire time.