-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Occasional crash when exiting levels #95
Comments
Here's an ASAN build you can share with users: nugget-doom-debug.zip (Windows 10/11 x64 only) The game should be launched with nugget-doom.com -skill 4 -warp 1 -verbose > _log.txt 2>&1 The parameters can be changed as needed but |
Many thanks! |
Feel free, I don't mind. My attention has been focused elsewhere, so I can't dive in myself just yet. |
We got something: Crash log
|
@fabiangreffrath, I hope you don't mind me bringing the discussion here (which I should have done to begin with). How exactly could fabiangreffrath@80e7fa3 be fixing it? If I'm not mistaken, that merely initializes |
NB: A widget line is allowed to contain |
This leaves me wondering why Woof wasn't affected; I'm pretty sure that it should've been, but I don't recall any reports. |
I was wrong. They are terminated, in the same function.
Good question. Is it possible that people were playing with ASAN builds? |
Doesn't appear to be an overflow, though. This patch reliably crashes the game: --- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -1445,6 +1445,7 @@ static void HU_widget_build_sttime(void)
char hud_timestr[HU_MAXLINELENGTH/2];
int offset = 0;
extern int time_scale;
+ memset(hud_timestr, HU_FONTEND + 6 + 1, sizeof(hud_timestr));
if ((hud_level_time & HUD_WIDGET_HUD && !automapactive) ||
(hud_level_time & HUD_WIDGET_AUTOMAP && automapactive)) The issue is that you add the width of certain glyphs to the string width, but these glyphs haven't been added to the font before. Of course, these glyphs are never added to a regular Lines 188 to 189 in 331c2b3
|
How about this: --- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -440,6 +440,7 @@ void HU_Init(void)
for (i = HU_FONTSIZE + 6, j = 0; j < 3; i++, j++)
{
static const char *names[] = { "HUDKILLS", "HUDITEMS", "HUDSCRTS" };
+ static const char fallback[] = { 'K', 'I', 'S' };
const char *icon = names[j];
if (W_CheckNumForName(icon) != -1)
@@ -447,7 +448,11 @@ void HU_Init(void)
sml_font.patches[i] =
big_font.patches[i] = (patch_t *) W_CacheLumpName(icon, PU_STATIC);
}
- else { sml_font.patches[i] = big_font.patches[i] = NULL; }
+ else
+ {
+ sml_font.patches[i] = sml_font.patches[fallback[j]-HU_FONTSTART];
+ big_font.patches[i] = big_font.patches[fallback[j]-HU_FONTSTART];
+ }
}
// [FG] calculate font height once right here |
Is it really necessary if we zero-initialize |
Nope, just future-proof. |
Fair enough. I'll apply these fixes later. Thanks for your research! FWIW, and a bit of a note-to-self: when I said that the description of the error didn't sound like a buffer overflow, I was talking about how the crash log mentioned an attempt to access address zero. The stats icons being initialized to |
May solve #95. Thanks @fabiangreffrath.
As reported by a few users on the Doomworld thread; I seemingly encountered it myself, too. Very infrequent, I'd say.
It seems to happen upon the first exit of the session (i.e. since the game was launched).
Probably related to the Alternative Intermission Background.
The text was updated successfully, but these errors were encountered: