Basically what it says in the thread title. Not sure what causes it. I haven't found many maps that cause it, only the WIP training map for my mod. My mod's radar (use "give all" to get it) seems to cause it reliably, though the moment it happens is random.
I don't have a minimal example right now, but I'll try to make one as soon as I figure out what in the map causes it.
Edit: Just speculation, but it might be related to portals. Would explain why I hadn't found the crash when testing in the IWAD maps.
Edit 2: Added a simpler BlockLinesIterator example as an attachment. I also tried to make a simpler map, but couldn't get it to crash reliably.
Edit 3: Updated the thread title. This is nastier than I thought.
Edit 3.1: Updated the thread title to add the first version I can find this in. Uhhhhhhhhh.
Edit 4: Updated the thread title again and added a fully minimal example.
[2.4]Portals + polyobjs + BlockLinesIterator heap corruption
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.
- phantombeta
- Posts: 2088
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
[2.4]Portals + polyobjs + BlockLinesIterator heap corruption
- Attachments
-
- Portals-Polyobjs-BlockLinesIterator_crash.PK3
- (3.67 KiB) Downloaded 28 times
-
- LineCounter.PK3
- (718 Bytes) Downloaded 31 times
Last edited by phantombeta on Fri Oct 25, 2019 9:05 pm, edited 6 times in total.
- phantombeta
- Posts: 2088
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: Consistent, repeatable crash with BlockLinesIterator
Okay, so, it's definitely something to do with portals. I took a moment to look at the callstack, and then it was pretty obvious:
Seems like the "data" TArray in here may not be getting initialized.
Seems like the "data" TArray in here may not be getting initialized.
- phantombeta
- Posts: 2088
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: [2.4]Portals + polyobjs + BlockLinesIterator heap corrup
Sorry for the bump, but I have some more important, bump-worthy (IMO) info to add:
So it turns out it's even weirder. For some reason, portals combined with polyobjects and BlockLinesIterator causes heap corruption. Unfortunately, this seems to be something I can't figure out how to fix myself.
So it turns out it's even weirder. For some reason, portals combined with polyobjects and BlockLinesIterator causes heap corruption. Unfortunately, this seems to be something I can't figure out how to fix myself.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [2.4]Portals + polyobjs + BlockLinesIterator heap corrup
Out of curiosity, why does this kind of change help fix it?
Re: [2.4]Portals + polyobjs + BlockLinesIterator heap corrup
Well, this means my commit comments really suck.
DBlockLinesIterator was derived from FMultiBlockLinesIterator.
DBlockLinesIterator::check was passed to FMultiBlockLinesIterator's constructor while it wasn't initialized because parent class' constructor is called before all members' constructors.
The problem was FMultiBlockLinesIterator's constructor is using its check argument.
For this reason, DBlockLinesIterator cannot be derived from FMultiBlockLinesIterator. It should be made a member initialized after check.
DBlockLinesIterator was derived from FMultiBlockLinesIterator.
DBlockLinesIterator::check was passed to FMultiBlockLinesIterator's constructor while it wasn't initialized because parent class' constructor is called before all members' constructors.
The problem was FMultiBlockLinesIterator's constructor is using its check argument.
For this reason, DBlockLinesIterator cannot be derived from FMultiBlockLinesIterator. It should be made a member initialized after check.
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: [2.4]Portals + polyobjs + BlockLinesIterator heap corrup
Superb work as usual. I've just ported the fix to LZDoom.