[Fixed] 4.7.0 Has broken my PDAs

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

4.7.0 Has broken my PDAs

Postby Enjay » Wed Sep 22, 2021 3:18 pm

Using Nash's PDA starter kit as a base, I have made myself a set of PDAs.

They worked fine in 4.6.1 with the exception of the bug mentioned here, but I employed the workaround of not pausing the game when the PDAs were open, so it never caused a problem.

However, in 4.7.0, the text in the messages is all messed up (perhaps I formatted it wrong? But as you can see, it worked in 4.6.1).

4.6.1




4.7.0




More seriously, if you click around the PDA list for a while, sooner or later GZDoom will crash - and its a Windows screen going white, gathering information to send to Microsoft kind of crash, not a GZDoom one (so no crash report to post - but it looks like an out of memory issue).

If I run stat gc with a PDA open, the menu-non-pause workaround does seem to still be working (the garbage collector gets a chance to catch up), So something is obviously causing an issue, but I don't *think* it's the same bug.

I couldn't get it to happen with the PDA starter kit demo file, so I'll send a link to a cut down version of my PDAs which does seem to manage to show the problem.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby Graf Zahl » Wed Sep 22, 2021 3:31 pm

There's way too much script code involved here to quickly find out where the formatting goes off the rails. As a very first step, please try to narrow it down on the script side. Trying to hunt down a bug in unknown code that I cannot debug is not something leading to a quick result.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 4.7.0 Has broken my PDAs

Postby Enjay » Wed Sep 22, 2021 3:39 pm

I'll try but, honestly, I don't understand a great deal of the code myself. I'm just piggybacking onto what was in the kit.

However, I do have at least a bit of a clue. I just tried running the test file that I sent again and I actually got a message and a proper GZDoom crash report:

Message: Could not allocate memory for vulkan buffer: out of device memory

CrashReport.zip


Given that the message mentioned Vulkan, I went back to OpenGL and tried again. The text was still messed up but after a couple of minutes, I hadn't had the crash.

[edit]
And I'm sure it won't add much more info, but here's a crash report from gzdoom-x64-g4.7.0pre-214-g7ce5bb486

CrashReportGit.zip

[/edit]
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby Graf Zahl » Wed Sep 22, 2021 3:46 pm

That hints at too many characters being processed. But I need help here - if this is Nash's code maybe he can give me some pointers at where to look.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 4.7.0 Has broken my PDAs

Postby Enjay » Wed Sep 22, 2021 3:48 pm

Link sent to all devs as requested.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby Enjay » Wed Sep 22, 2021 4:04 pm

Unfortunately, the oldest git build on DRD (gzdoom-x64-g4.7.0pre-158-g355e367a0 Sept 01) shows the problems, so I can't trace back further than that to find a working git build (other then 4.6.1 official, of course).
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby Graf Zahl » Wed Sep 22, 2021 4:12 pm

You can get older builds if you

Spoiler:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 4.7.0 Has broken my PDAs

Postby Enjay » Wed Sep 22, 2021 4:34 pm

Aha! I'd completely forgotten that was an option. Thank you.

Right, I've found where it breaks:

This one from 10th august works - text formating fine and I was able to click all over the PDA menu for over 2 minutes without a crash.
gzdoom-x64-g4.7.0pre-101-g39513cf7a

This one from the 13th of August does not work - text formatting messed up and I got a crash after around 30 seconds of clicking and scrolling around the PDAs.
gzdoom-x64-g4.7.0pre-131-gc3772fe20

There are no builds between these two.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby phantombeta » Wed Sep 22, 2021 5:14 pm

This bug has to do with colour codes. It seems named colour codes (i.e. "\c[colour name]") are breaking either text rendering or BrokenLines.
We stumbled upon this in the Discord when Agent_Ash/Jekyll Grim Payne was having an issue with colour escape codes (he wasn't using them correctly), and when he tried the named colour codes, this happened too.
Gutawer was gonna look into it, as we didn't know if it was ZForms or GZDoom causing it (we were pretty sure it was GZDoom), but it seems we don't need to now- this pretty much confirms it's a GZDoom bug, given it worked correctly before.

[Edit] I've just done a quick test with BrokenLines bypassed in ZForms' source code and it still happens, so it's most likely text rendering at fault here.
[Edit 2] Turns out my test from the first edit didn't actually test anything, because SLADE decided not to fuggin save the changes to the ZScript file :|
Last edited by phantombeta on Wed Sep 22, 2021 5:48 pm, edited 2 times in total.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: 4.7.0 Has broken my PDAs

Postby Enjay » Wed Sep 22, 2021 5:17 pm

Based purely on the descriptions of the commits and not really knowing the code, I guess that this one seems likely then?

https://github.com/coelckers/gzdoom/com ... 4cac71bfe0

But I'm really just guessing because there are one or two other descriptions from 11th August that, to me, could also be affecting this area.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby phantombeta » Wed Sep 22, 2021 5:47 pm

I just compiled a build with that commit reverted, and yep, that's it. Turns my initial test with BrokenLines bypassed in ZForms didn't work, because SLADE didn't friggin save the edited ZScript file :mad:
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: 4.7.0 Has broken my PDAs

Postby Graf Zahl » Wed Sep 22, 2021 11:43 pm

Based on that, can someone please make a more condensed example of something that does not work?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 4.7.0 Has broken my PDAs

Postby drfrag » Thu Sep 23, 2021 6:38 am

User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: 4.7.0 Has broken my PDAs

Postby Enjay » Thu Sep 23, 2021 7:34 am

Thank you kindly.

Any idea why the unfixed version was whacking the memory so hard?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: 4.7.0 Has broken my PDAs

Postby Graf Zahl » Thu Sep 23, 2021 7:40 am

Enjay wrote:Thank you kindly.

Any idea why the unfixed version was whacking the memory so hard?



It created extremely long strings repeatedly and the garbage collector failed to keep up with ever more new strings getting piled up within the menu's objects.
One thing with the garbage collector, which is often overlooked, is that the stale objects will hold on to everything they contain until they get collected.

For any such objects it is advisable to add an OnDestroy method that frees whatever the object references, including internal objects. That'd reduce memory pressure a lot in cases where GC causes issues.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests