Spoiler:But if I start my debug compile of zdoom, it runs fine. (A little detail I just remembered - its not exactly a Release compile but its a "MinSizeRel" compile set through cmake. This has always worked for me, until this issue came up a few revisions or so ago.)Code: Select all
ZDoom v2.2.0 - SVN revision 1249 - SDL version Compiled on Sep 27 2008 M_LoadDefaults: Load system defaults. W_Init: Init WADfiles. adding /home/chris/Desktop/zdoom_svn/zdoom.pk3 adding /usr/local/share/doom2.wad (2919 lumps) I_Init: Setting up machine state. CPU Vendor ID: GenuineIntel Name: Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz Family 6, Model 15, Stepping 10 Features: MMX SSE SSE2 SSE3 SSSE3 I_InitSound: Initializing FMOD FMOD Sound System, copyright � Firelight Technologies Pty, Ltd., 1994-2008. V_Init: allocate screen. S_Init: Setting up sound. ST_Init: Init startup screen. P_Init: Checking cmd-line parameters... G_ParseMapInfo: Load map definitions. S_InitData: Load sound definitions. Texman.Init: Init texture manager. TEAMINFO_Init: Load team definitions. LoadDecorations: Load external actors. *** glibc detected *** ./zdoom: free(): invalid pointer: 0x0000000000ac0790 *** ======= Backtrace: ========= /lib/libc.so.6[0x7f6e7446d08a] /lib/libc.so.6(cfree+0x8c)[0x7f6e74470c1c] ./zdoom(_ZN17FStateDefinitions16ResolveGotoLabelEP6AActorPK6PClassPc+0x154)[0x577ace] ./zdoom(_ZN17FStateDefinitions17ResolveGotoLabelsEP10FActorInfoP6AActorR6TArrayI12FStateDefineS5_E+0x4b)[0x577b59] ./zdoom(_ZN17FStateDefinitions12FinishStatesEP10FActorInfoP6AActorR6TArrayI6FStateS5_E+0xf0)[0x577c90] ./zdoom(_Z11FinishActorR8FScannerP10FActorInfoR7Baggage+0x35)[0x649791] ./zdoom(_Z10ParseActorR8FScanner+0x9bf)[0x64291f] ./zdoom[0x649668] ./zdoom[0x6495d4] ./zdoom(_Z15LoadDecorationsv+0x40)[0x6496f8] ./zdoom(_ZN10FActorInfo10StaticInitEv+0x5d)[0x51fae1] ./zdoom(_Z10D_DoomMainv+0xf37)[0x4ff5af] ./zdoom(main+0x1ca)[0x4e11bc] /lib/libc.so.6(__libc_start_main+0xf4)[0x7f6e744171c4] ./zdoom(__gxx_personality_v0+0x2f1)[0x4df149] ======= Memory map: ======== 00400000-00748000 r-xp 00000000 08:11 3719171 /home/chris/Desktop/zdoom_svn/zdoom 00948000-00963000 rwxp 00348000 08:11 3719171 /home/chris/Desktop/zdoom_svn/zdoom 00963000-010da000 rwxp 00963000 00:00 0 [heap] 40a5d000-40a5e000 ---p 40a5d000 00:00 0 40a5e000-4125e000 rwxp 40a5e000 00:00 0 4125e000-4125f000 ---p 4125e000 00:00 0 4125f000-41a5f000 rwxp 4125f000 00:00 0 41a5f000-41a60000 ---p 41a5f000 00:00 0 41a60000-42260000 rwxp 41a60000 00:00 0 7f6e68000000-7f6e68021000 rwxp 7f6e68000000 00:00 0 7f6e68021000-7f6e6c000000 ---p 7f6e68021000 00:00 0 7f6e6d638000-7f6e6d70c000 r-xp 00000000 08:11 14092002 /usr/lib/libasound.so.2.0.0 7f6e6d70c000-7f6e6d90c000 ---p 000d4000 08:11 14092002 /usr/lib/libasound.so.2.0.0 7f6e6d90c000-7f6e6d913000 rwxp 000d4000 08:11 14092002 /usr/lib/libasound.so.2.0.0 7f6e6d913000-7f6e6d973000 rwxs 00000000 00:09 5603344 /SYSV00000000 (deleted) 7f6e6d973000-7f6e6d98c000 r-xp 00000000 08:11 3392296 /lib/libselinux.so.1 7f6e6d98c000-7f6e6db8c000 ---p 00019000 08:11 3392296 /lib/libselinux.so.1 7f6e6db8c000-7f6e6db8e000 rwxp 00019000 08:11 3392296 /lib/libselinux.so.1 7f6e6db8e000-7f6e6db8f000 rwxp 7f6e6db8e000 00:00 0 7f6e6db8f000-7f6e6db9e000 r-xp 00000000 08:11 3392297 /lib/libbz2.so.1.0.4 7f6e6db9e000-7f6e6dd9d000 ---p 0000f000 08:11 3392297 /lib/libbz2.so.1.0.4 7f6e6dd9d000-7f6e6dd9f000 rwxp 0000e000 08:11 3392297 /lib/libbz2.so.1.0.4 7f6e6dd9f000-7f6e6de0d000 r-xp 00000000 08:11 14091900 /usr/lib/libgio-2.0.so.0.0.0 7f6e6de0d000-7f6e6e00d000 ---p 0006e000 08:11 14091900 /usr/lib/libgio-2.0.so.0.0.0 7f6e6e00d000-7f6e6e010000 rwxp 0006e000 08:11 14091900 /usr/lib/libgio-2.0.so.0.0.0 7f6e6e010000-7f6e6e14d000 r-xp 00000000 08:11 14090280 /usr/lib/libxml2.so.2.6.31 7f6e6e14d000-7f6e6e34d000 ---p 0013d000 08:11 14090280 /usr/lib/libxml2.so.2.6.31 7f6e6e34d000-7f6e6e356000 rwxp 0013d000 08:11 14090280 /usr/lib/libxml2.so.2.6.31 7f6e6e356000-7f6e6e357000 rwxp 7f6e6e356000 00:00 0 7f6e6e357000-7f6e6e38f000 r-xp 00000000 08:11 14091678 /usr/lib/libcroco-0.6.so.3.0.1 7f6e6e38f000-7f6e6e58e000 ---p 00038000 08:11 14091678 /usr/lib/libcroco-0.6.so.3.0.1 7f6e6e58e000-7f6e6e592000 rwxp 00037000 08:11 14091678 /usr/lib/libcroco-0.6.so.3.0.1 7f6e6e592000-7f6e6e5c9000 r-xp 00000000 08:11 14090444 /usr/lib/libgsf-1.so.114.0.7 7f6e6e5c9000-7f6e6e7c8000 ---p 00037000 08:11 14090444 /usr/lib/libgsf-1.so.114.0.7 7f6e6e7c8000-7f6e6e7cc000 rwxp 00036000 08:11 14090444 /usr/lib/libgsf-1.so.114.0.7 7f6e6e7cc000-7f6e6e7cd000 rwxp 7f6e6e7cc000 00:00 0 7f6e6e7cd000-7f6e6e801000 r-xp 00000000 08:11 14090546 /usr/lib/librsvg-2.so.2.22.2 7f6e6e801000-7f6e6ea01000 ---p 00034000 08:11 14090546 /usr/lib/librsvg-2.so.2.22.2 7f6e6ea01000-7f6e6ea03000 rwxp 00034000 08:11 14090546 /usr/lib/librsvg-2.so.2.22.2 7f6e6ea03000-7f6e6ea05000 r-xp 00000000 08:11 14156140 /usr/lib/gtk-2.0/2.10.0/loaders/svg_loader.so 7f6e6ea05000-7f6e6ec04000 ---p 00002000 08:11 14156140 /usr/lib/gtk-2.0/2.10.0/loaders/svg_loader.so 7f6e6ec04000-7f6e6ec05000 rwxp 00001000 08:11 14156140 /usr/lib/gtk-2.0/2.10.0/loaders/svg_loader.so 7f6e6ec05000-7f6e6ef58000 r-xp 00000000 08:11 14434899 /usr/share/icons/hicolor/icon-theme.cache 7f6e6ef58000-7f6e6f6c8000 r-xp 00000000 08:11 14434878 /usr/share/icons/gnome/icon-theme.cache 7f6e6f6c8000-7f6e6f773000 r-xp 00000000 08:11 14436409 /usr/share/icons/Tangerine/icon-theme.cache 7f6e6f773000-7f6e6f8d9000 r-xp 00000000 08:11 14434865 /usr/share/icons/Human/icon-theme.cache 7f6e6f8d9000-7f6e6f96a000 r-xp 00000000 08:11 14303418 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf 7f6e6f96a000-7f6e6f96c000 r-xp 00000000 08:11 14221328 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so 7f6e6f96c000-7f6e6fb6b000 ---p 00002000 08:11 14221328 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so 7f6e6fb6b000-7f6e6fb6c000 rwxp 00001000 08:11 14221328 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so 7f6e6fb6c000-7f6e6fb7e000 r-xp 00000000 08:11 14155783 /usr/lib/gtk-2.0/2.10.0/engines/libubuntulooks.so 7f6e6fb7e000-7f6e6fd7e000 ---p 00012000 08:11 14155783 /usr/lib/gtk-2.0/2.10.0/engines/libubuntulooks.so 7f6e6fd7e000-7f6e6fd7f000 rwxp 00012000 08:11 14155783 /usr/lib/gtk-2.0/2.10.0/engines/libubuntulooks.so 7f6e6fd7f000-7f6e6fdb3000 rwxp 7f6e6fdb3000 00:00 0 7f6e6fdd6000-7f6e6fde0000 r-xp 00000000 08:11 3391725 /lib/libnss_files-2.7.so 7f6e6fde0000-7f6e6ffe0000 ---p 0000a000 08:11 3391725 /lib/libnss_files-2.7.so 7f6e6ffe0000-7f6e6ffe2000 rwxp 0000a000 08:11 3391725 /lib/libnss_files-2.7.so 7f6e6ffe2000-7f6e6ffec000 r-xp 00000000 08:11 3391727 /lib/libnss_nis-2.7.so 7f6e6ffec000-7f6e701eb000 ---p 0000a000 08:11 3391727 /lib/libnss_nis-2.7.so 7f6e701eb000-7f6e701ed000 rwxp 00009000 08:11 3391727 /lib/libnss_nis-2.7.so 7f6e701ed000-7f6e70203000 r-xp 00000000 08:11 3391722 /lib/libnsl-2.7.so 7f6e70203000-7f6e70402000 ---p 00016000 08:11 3391722 /lib/libnsl-2.7.so 7f6e70402000-7f6e70404000 rwxp 00015000 08:11 3391722 /lib/libnsl-2.7.so 7f6e70404000-7f6e70406000 rwxp 7f6e70404000 00:00 0 7f6e70406000-7f6e7040e000 r-xp 00000000 08:11 3391723 /lib/libnss_compat-2.7.so 7f6e7040e000-7f6e7060d000 ---p 00008000 08:11 3391723 /lib/libnss_compat-2.7.so 7f6e7060d000-7f6e7060f000 rwxp 00007000 08:11 3391723 /lib/libnss_compat-2.7.so 7f6e7060f000-7f6e70614000 r-xp 00000000 08:11 14091567 /usr/lib/libXdmcp.so.6.0.0 7f6e70614000-7f6e70813000 ---p 00005000 08:11 14091567 /usr/lib/libXdmcp.so.6.0.0 7f6e70813000-7f6e70814000 rwxp 00004000 08:11 14091567 /usr/lib/libXdmcp.so.6.0.0 7f6e70814000-7f6e70816000 r-xp 00000000 08:11 14091556 /usr/lib/libXau.so.6.0.0 7f6e70816000-7f6e70a15000 ---p 00002000 08:11 14091556 /usr/lib/libXau.so.6.0.0 7f6e70a15000-7f6e70a16000 rwxp 00001000 08:11 14091556 /usr/lib/libXau.so.6.0.0 7f6e70a16000-7f6e70a38000 r-xp 00000000 08:11 14091415 /usr/lib/libexpat.so.1.5.2 7f6e70a38000-7f6e70c38000 ---p 00022000 08:11 14091415 /usr/lib/libexpat.so.1.5.2 7f6e70c38000-7f6e70c3a000 rwxp 00022000 08:11 14091415 /usr/lib/libexpat.so.1.5.2 7f6e70c3a000-7f6e70c55000 r-xp 00000000 08:11 14091460 /usr/lib/libxcb.so.1.0.0 7f6e70c55000-7f6e70e54000 ---p 0001b000 08:11 14091460 /usr/lib/libxcb.so.1.0.0 7f6e70e54000-7f6e70e55000 rwxp 0001a000 08:11 14091460 /usr/lib/libxcb.so.1.0.0 7f6e70e55000-7f6e70e56000 r-xp 00000000 08:11 14091704 /usr/lib/libxcb-xlib.so.0.0.0 7f6e70e56000-7f6e71055000 ---p 00001000 08:11 14091704 /usr/lib/libxcb-xlib.so.0.0.0 7f6e71055000-7f6e71056000 rwxp 00000000 08:11 14091704 /usr/lib/libxcb-xlib.so.0.0.0 7f6e71056000-7f6e7106d000 r-xp 00000000 08:11 14091183 /usr/lib/libICE.so.6.3.0 7f6e7106d000-7f6e7126c000 ---p 00017000 08:11 14091183 /usr/lib/libICE.so.6.3.0 7f6e7126c000-7f6e7126e000 rwxp 00016000 08:11 14091183 /usr/lib/libICE.so.6.3.0 7f6e7126e000-7f6e71271000 rwxp 7f6e7126e000 00:00 0 7f6e71271000-7f6e71279000 r-xp 00000000 08:11 14091546 Aborted
[r1249] Release compile of zdoom doesn't run
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Macil
- Posts: 2529
- Joined: Mon Mar 22, 2004 7:00 pm
- Preferred Pronouns: He/Him
- Location: California, USA. Previously known as "Agent ME".
- Contact:
[r1249] Release compile of zdoom doesn't run
On my 64-bit ubuntu system, if I start up a release compile of zdoom, I get this: (It asks for the iwad, but crashes after that)
Spoiler:But if I start my debug compile of zdoom, it runs fine. (A little detail I just remembered - its not exactly a Release compile but its a "MinSizeRel" compile set through cmake. This has always worked for me, until this issue came up a few revisions or so ago.)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Unfortunately, since I can't reproduce this you will have to help me out. The functions causing the crash are listed so if you could put in some debug output to see what actor definition is passing the incorrect data it would help a lot.
- Macil
- Posts: 2529
- Joined: Mon Mar 22, 2004 7:00 pm
- Preferred Pronouns: He/Him
- Location: California, USA. Previously known as "Agent ME".
- Contact:
Re: [r1249] Release compile of zdoom doesn't run
(Talking about r1250)
If I comment out line 708 (delete[] namestart;) on p_states.cpp, zdoom no longer crashes, so it has something to do with that - guess somewhere else in the code tries to also free the same variable.
Looking at the code, I see no use for the namestart variable. I would just remove it, but I'm curious to what this means:
Does this mean namestart is a pointer to name? Or that name is a pointer to the value pointed to by name? Or that its the same as name?
And what does using delete[] do to it? Delete just the pointer that namestart is, or the data associated with it (making 'name' also deleted)? If its the latter, then I'd assume the code expects name to be deleted and I can't just remove the two lines of code from p_states.cpp referencing namestart.
I also added in a line of code before line 708:
Here's the relevant output from the release version, which crashes immediately following this output:
Apparently for some reason in release mode, ResolveGotoLabels decides to parse through the PoisonBolt actor, when it shouldn't be. Commenting the line that defines namestart and the line that deletes it stops it from crashing, but not fixing the problem that it is mistakenly parsing PoisonBolt. It then parses through PoisonBolt again (with name set to nothing, or no visible characters at least), then continues as normal. PoisonBolt is the only actor it parses through mistakenly - all others look correct.
In Debug mode, PoisonBolt is not parsed at all. Looking into this still.
If I comment out line 708 (delete[] namestart;) on p_states.cpp, zdoom no longer crashes, so it has something to do with that - guess somewhere else in the code tries to also free the same variable.
Looking at the code, I see no use for the namestart variable. I would just remove it, but I'm curious to what this means:
Code: Select all
char *namestart = name;
And what does using delete[] do to it? Delete just the pointer that namestart is, or the data associated with it (making 'name' also deleted)? If its the latter, then I'd assume the code expects name to be deleted and I can't just remove the two lines of code from p_states.cpp referencing namestart.
I also added in a line of code before line 708:
Code: Select all
printf("In class %s, namestart=%s\n",type->TypeName.GetChars(),namestart);
Spoiler:Here's the similar from the debug build, which as is apparent, continues on and starts the game fine:
Spoiler:EDIT:
Apparently for some reason in release mode, ResolveGotoLabels decides to parse through the PoisonBolt actor, when it shouldn't be. Commenting the line that defines namestart and the line that deletes it stops it from crashing, but not fixing the problem that it is mistakenly parsing PoisonBolt. It then parses through PoisonBolt again (with name set to nothing, or no visible characters at least), then continues as normal. PoisonBolt is the only actor it parses through mistakenly - all others look correct.
In Debug mode, PoisonBolt is not parsed at all. Looking into this still.
- Macil
- Posts: 2529
- Joined: Mon Mar 22, 2004 7:00 pm
- Preferred Pronouns: He/Him
- Location: California, USA. Previously known as "Agent ME".
- Contact:
Re: [r1249] Release compile of zdoom doesn't run
Argh... I've set up a few commands in the ResolveGotoLabels function that trigger only when its parsing "PoisonBolt", as I ironically can't really use a debugger to debug this.
When in debug mode, which I assumed was correct, I get
list[0].DefineFlags=5
list[1].DefineFlags=32
list[2].DefineFlags=32
list[3].DefineFlags=5
which seems to work fine. But in release mode I get
list[0].DefineFlags=5
list[1].DefineFlags=4
list[2].DefineFlags=4
list[3].DefineFlags=5
And SDF_LABEL=4, which means the ResolveGotoLabels function passes list items 1 and 2 to ResolveGotoLabel, which isn't supposed to happen. What is the point of DefineFlags? I assumed it was to store one of 6 values (SDF_*) defined from thingdef.h, but a lot of actors have DefineFlags set to a lot higher, commonly 96. (Also, there's a misspelling on line 62 of thingdef.h of an E that should be F, not that it affects anything.)
I've checked the two parts of the code that set certain DefineFlags to SDF_LABEL - PoisonBolt's list items don't have it set there, but all other list items with SDF_LABEL set have it set there.
I'm now attempting to search where DefineFlags is set and work from that direction now.
When in debug mode, which I assumed was correct, I get
list[0].DefineFlags=5
list[1].DefineFlags=32
list[2].DefineFlags=32
list[3].DefineFlags=5
which seems to work fine. But in release mode I get
list[0].DefineFlags=5
list[1].DefineFlags=4
list[2].DefineFlags=4
list[3].DefineFlags=5
And SDF_LABEL=4, which means the ResolveGotoLabels function passes list items 1 and 2 to ResolveGotoLabel, which isn't supposed to happen. What is the point of DefineFlags? I assumed it was to store one of 6 values (SDF_*) defined from thingdef.h, but a lot of actors have DefineFlags set to a lot higher, commonly 96. (Also, there's a misspelling on line 62 of thingdef.h of an E that should be F, not that it affects anything.)
I've checked the two parts of the code that set certain DefineFlags to SDF_LABEL - PoisonBolt's list items don't have it set there, but all other list items with SDF_LABEL set have it set there.
I'm now attempting to search where DefineFlags is set and work from that direction now.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Looks like an uninitialized variable. This is going to be fun... 
The best place to start is to debug ParseStates for the PoisonBolt actor.

The best place to start is to debug ParseStates for the PoisonBolt actor.
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: [r1249] Release compile of zdoom doesn't run
Valgrind gives me this:
Code: Select all
LoadDecorations: Load external actors.
==4176==
==4176== Thread 1:
==4176== Conditional jump or move depends on uninitialised value(s)
==4176== at 0x822A08E: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x822A392: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839BB0B: FinishActor(FScanner&, FActorInfo*, Baggage&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839002D: ParseActor(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839B9CD: ParseDecorate(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839B8B2: ParseDecorate(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839BA50: LoadDecorations() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x8191CAD: FActorInfo::StaticInit() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x815CA79: D_DoomMain() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x812C722: main (in /home/kitty/zdoom/build/src/zdoom)
==4176==
==4176== Conditional jump or move depends on uninitialised value(s)
==4176== at 0x822A08E: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x822A15C: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x822A392: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839BB0B: FinishActor(FScanner&, FActorInfo*, Baggage&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839002D: ParseActor(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839B9CD: ParseDecorate(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839B8B2: ParseDecorate(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839BA50: LoadDecorations() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x8191CAD: FActorInfo::StaticInit() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x815CA79: D_DoomMain() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x812C722: main (in /home/kitty/zdoom/build/src/zdoom)
==4176==
==4176== Conditional jump or move depends on uninitialised value(s)
==4176== at 0x40236E3: strcpy (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==4176== by 0x8191D5D: GetSpriteIndex(char const*) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839E8C1: Handler_crouchsprite_S_PlayerPawn(APlayerPawn*, Baggage&, FPropParam*) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839C346: ParsePropertyParams(FScanner&, FPropertyInfo*, AActor*, Baggage&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839C666: ParseActorProperty(FScanner&, Baggage&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x838FFA6: ParseActor(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839B9CD: ParseDecorate(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839B8B2: ParseDecorate(FScanner&) (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x839BA50: LoadDecorations() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x8191CAD: FActorInfo::StaticInit() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x815CA79: D_DoomMain() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x812C722: main (in /home/kitty/zdoom/build/src/zdoom)
R_Init: Init Doom refresh subsystem.
DecalLibrary: Load decals.
M_Init: Init miscellaneous info.
P_Init: Init Playloop state.
==4176==
==4176== Use of uninitialised value of size 4
==4176== at 0x826CBB6: R_InitSpriteDefs() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x826CEA5: R_InitSprites() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x8214E47: P_Init() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x815CDFF: D_DoomMain() (in /home/kitty/zdoom/build/src/zdoom)
==4176== by 0x812C722: main (in /home/kitty/zdoom/build/src/zdoom)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Too bad that the dump doesn't tell me anything I don't know yet. Was that a 32 bit or 64 bit compile?
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: [r1249] Release compile of zdoom doesn't run
32-bit. I'll try to see if I can rebuild zdoom with more debug info..
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Can you test what happens if you replace this function:
It sure was wrong but for me it doesn't make any difference.
Code: Select all
void FStateDefinitions::FixStatePointers (FActorInfo *actor, TArray<FStateDefine> & list)
{
for(unsigned i=0;i<list.Size(); i++)
{
if (list[i].DefineFlags == SDF_INDEX)
{
size_t v=(size_t)list[i].State;
list[i].State = actor->OwnedStates + v - 1;
list[i].DefineFlags = SDF_STATE;
}
if (list[i].Children.Size() > 0) FixStatePointers(actor, list[i].Children);
}
}
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: [r1249] Release compile of zdoom doesn't run
It gives me line numbers this time
So it seems list.State and/or list.DefineFlags aren't being initialized in some circumstances.
Code: Select all
LoadDecorations: Load external actors.
==9241==
==9241== Thread 1:
==9241== Conditional jump or move depends on uninitialised value(s)
==9241== at 0x822AB22: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:745)
==9241== by 0x822AE26: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:810)
==9241== by 0x839CE93: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==9241== by 0x83912C1: ParseActor(FScanner&) (thingdef.cpp:579)
==9241== by 0x839CD55: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==9241== by 0x839CC3A: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==9241== by 0x839CDD8: LoadDecorations() (thingdef_main.cpp:148)
==9241== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==9241== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==9241== by 0x812C8F2: main (i_main.cpp:272)
==9241==
==9241== Conditional jump or move depends on uninitialised value(s)
==9241== at 0x822AB22: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:745)
==9241== by 0x822ABF0: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:750)
==9241== by 0x822AE26: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:810)
==9241== by 0x839CE93: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==9241== by 0x83912C1: ParseActor(FScanner&) (thingdef.cpp:579)
==9241== by 0x839CD55: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==9241== by 0x839CC3A: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==9241== by 0x839CDD8: LoadDecorations() (thingdef_main.cpp:148)
==9241== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==9241== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==9241== by 0x812C8F2: main (i_main.cpp:272)
==9241==
==9241== Conditional jump or move depends on uninitialised value(s)
==9241== at 0x40236E3: strcpy (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==9241== by 0x8192305: GetSpriteIndex(char const*) (info.cpp:77)
==9241== by 0x839FC59: Handler_crouchsprite_S_PlayerPawn(APlayerPawn*, Baggage&, FPropParam*) (thingdef_properties.cpp:1978)
==9241== by 0x839D6CE: ParsePropertyParams(FScanner&, FPropertyInfo*, AActor*, Baggage&) (thingdef_parse.cpp:452)
==9241== by 0x839D9EE: ParseActorProperty(FScanner&, Baggage&) (thingdef_parse.cpp:496)
==9241== by 0x839123A: ParseActor(FScanner&) (thingdef.cpp:566)
==9241== by 0x839CD55: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==9241== by 0x839CC3A: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==9241== by 0x839CDD8: LoadDecorations() (thingdef_main.cpp:148)
==9241== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==9241== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==9241== by 0x812C8F2: main (i_main.cpp:272)
R_Init: Init Doom refresh subsystem.
DecalLibrary: Load decals.
M_Init: Init miscellaneous info.
P_Init: Init Playloop state.
==9241==
==9241== Use of uninitialised value of size 4
==9241== at 0x826DA9E: R_InitSpriteDefs() (r_things.cpp:371)
==9241== by 0x826DD8D: R_InitSprites() (r_things.cpp:889)
==9241== by 0x8215833: P_Init() (p_setup.cpp:3605)
==9241== by 0x815D09F: D_DoomMain() (d_main.cpp:2586)
==9241== by 0x812C8F2: main (i_main.cpp:272)
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: [r1249] Release compile of zdoom doesn't run
With that change to the function, I get a couple more valgrind errors:
So it definitely appears list.DefineFlags isn't getting initialized sometimes.
Code: Select all
==9418== Conditional jump or move depends on uninitialised value(s)
==9418== at 0x8229C98: FStateDefinitions::FixStatePointers(FActorInfo*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:724)
==9418== by 0x822ACC6: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:780)
==9418== by 0x839CEB7: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==9418== by 0x83912E5: ParseActor(FScanner&) (thingdef.cpp:579)
==9418== by 0x839CD79: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==9418== by 0x839CC5E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==9418== by 0x839CDFC: LoadDecorations() (thingdef_main.cpp:148)
==9418== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==9418== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==9418== by 0x812C8F2: main (i_main.cpp:272)
..and..
==9418== Conditional jump or move depends on uninitialised value(s)
==9418== at 0x8229C98: FStateDefinitions::FixStatePointers(FActorInfo*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:724)
==9418== by 0x8229D41: FStateDefinitions::FixStatePointers(FActorInfo*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:730)
==9418== by 0x822ACC6: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:780)
==9418== by 0x839CEB7: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==9418== by 0x83912E5: ParseActor(FScanner&) (thingdef.cpp:579)
==9418== by 0x839CD79: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==9418== by 0x839CC5E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==9418== by 0x839CDFC: LoadDecorations() (thingdef_main.cpp:148)
==9418== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==9418== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==9418== by 0x812C8F2: main (i_main.cpp:272)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Are these messages printed when the uninitialized data is accessed or are they collected? If they are immediately printed, please add the following line at the beginning of FStateDefinitions::FinishStates. Hopefully that brings me closer to the real problem.
Code: Select all
Printf("Finishing states for %s\n", actor->Class->TypeName.GetChars());
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: [r1249] Release compile of zdoom doesn't run
They're printed when they occur, yes. The following ones seem to produce errors (still including the function change from earlier)..
All the others finish without triggering a valgrind error.
Code: Select all
Finishing states for Inventory
==10731==
==10731== Thread 1:
==10731== Conditional jump or move depends on uninitialised value(s)
==10731== at 0x8229C98: FStateDefinitions::FixStatePointers(FActorInfo*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:724)
==10731== by 0x822AEDB: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:781)
==10731== by 0x839CED7: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==10731== by 0x8391305: ParseActor(FScanner&) (thingdef.cpp:579)
==10731== by 0x839CD99: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==10731== by 0x839CC7E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==10731== by 0x839CE1C: LoadDecorations() (thingdef_main.cpp:148)
==10731== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==10731== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==10731== by 0x812C8F2: main (i_main.cpp:272)
==10731==
==10731== Conditional jump or move depends on uninitialised value(s)
==10731== at 0x822AD40: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:746)
==10731== by 0x822B061: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:812)
==10731== by 0x839CED7: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==10731== by 0x8391305: ParseActor(FScanner&) (thingdef.cpp:579)
==10731== by 0x839CD99: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==10731== by 0x839CC7E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==10731== by 0x839CE1C: LoadDecorations() (thingdef_main.cpp:148)
==10731== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==10731== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==10731== by 0x812C8F2: main (i_main.cpp:272)
...
Finishing states for StealthChaingunGuy
==10731==
==10731== Conditional jump or move depends on uninitialised value(s)
==10731== at 0x822AD40: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:746)
==10731== by 0x822AE0E: FStateDefinitions::ResolveGotoLabels(FActorInfo*, AActor*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:751)
==10731== by 0x822B061: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:812)
==10731== by 0x839CED7: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==10731== by 0x8391305: ParseActor(FScanner&) (thingdef.cpp:579)
==10731== by 0x839CD99: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==10731== by 0x839CC7E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==10731== by 0x839CE1C: LoadDecorations() (thingdef_main.cpp:148)
==10731== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==10731== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==10731== by 0x812C8F2: main (i_main.cpp:272)
...
Finishing states for HereticImpLeader
==10731==
==10731== Conditional jump or move depends on uninitialised value(s)
==10731== at 0x8229C98: FStateDefinitions::FixStatePointers(FActorInfo*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:724)
==10731== by 0x8229D41: FStateDefinitions::FixStatePointers(FActorInfo*, TArray<FStateDefine, FStateDefine>&) (p_states.cpp:730)
==10731== by 0x822AEDB: FStateDefinitions::FinishStates(FActorInfo*, AActor*, TArray<FState, FState>&) (p_states.cpp:781)
==10731== by 0x839CED7: FinishActor(FScanner&, FActorInfo*, Baggage&) (thingdef_parse.cpp:532)
==10731== by 0x8391305: ParseActor(FScanner&) (thingdef.cpp:579)
==10731== by 0x839CD99: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==10731== by 0x839CC7E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==10731== by 0x839CE1C: LoadDecorations() (thingdef_main.cpp:148)
==10731== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==10731== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==10731== by 0x812C8F2: main (i_main.cpp:272)
...
Finishing states for ChexMineCart
==10731==
==10731== Conditional jump or move depends on uninitialised value(s)
==10731== at 0x40236E3: strcpy (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==10731== by 0x8192305: GetSpriteIndex(char const*) (info.cpp:77)
==10731== by 0x839FC9D: Handler_crouchsprite_S_PlayerPawn(APlayerPawn*, Baggage&, FPropParam*) (thingdef_properties.cpp:1978)
==10731== by 0x839D712: ParsePropertyParams(FScanner&, FPropertyInfo*, AActor*, Baggage&) (thingdef_parse.cpp:452)
==10731== by 0x839DA32: ParseActorProperty(FScanner&, Baggage&) (thingdef_parse.cpp:496)
==10731== by 0x839127E: ParseActor(FScanner&) (thingdef.cpp:566)
==10731== by 0x839CD99: ParseDecorate(FScanner&) (thingdef_main.cpp:117)
==10731== by 0x839CC7E: ParseDecorate(FScanner&) (thingdef_main.cpp:80)
==10731== by 0x839CE1C: LoadDecorations() (thingdef_main.cpp:148)
==10731== by 0x8192255: FActorInfo::StaticInit() (info.cpp:107)
==10731== by 0x815CD19: D_DoomMain() (d_main.cpp:2503)
==10731== by 0x812C8F2: main (i_main.cpp:272)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Looks a bit random... 

- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1249] Release compile of zdoom doesn't run
Can you retry with the latest SVN revision?