Crashing when working out of a folder

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Brohnesorge
Posts: 474
Joined: Sat Oct 08, 2016 9:10 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Win10
Graphics Processor: nVidia with Vulkan support
Contact:

Crashing when working out of a folder

Post by Brohnesorge »

So I didn't make this in bug-reporting cause I'm pretty sure it's user error and not a GZDoom bug.

But I'm trying to run a mod out of a folder for development purposes using ZDE, and it was working last night. Now suddenly this morning it crashes on start up and generates a crash report, which I've attached. It runs fine if I load a ZIP/WAD/PK3 whatever, and it runs with no PWADs. It crashes on GZDoom 3.7.2, 4.0.0 and 4.1.1.

What's going on here?

EDIT: After a restart it works now? Even though it "broke" after a restart?
Attachments
CrashReport.zip
(19.51 KiB) Downloaded 90 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Crashing when working out of a folder

Post by _mental_ »

If a separate file cannot be opened for some reason (due to permission, file system issues, exclusive access by other software, etc), GZDoom crashes.
There are plenty of FWadCollection::OpenLumpReader() calls, but no FileReader::isOpen() checks before further file operations.

This can solved in two ways.
The first one is obviously to add twenty isOpen() conditions with appropriate actions when it returned false.
The second one is to create dummy reader that will return zero length and no data.
Both approaches have own pros and cons. Got a better idea? Let me know.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Crashing when working out of a folder

Post by Graf Zahl »

I think the only good solution is to return a dummy FileReader that holds the file name, does not have any length, does not report as being open and which throws an exception if the code tries to read from it.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Crashing when working out of a folder

Post by _mental_ »

Downside of the exception approach is inability to start GZDoom if at least one file cannot be accessed.
Probably, it's not a big deal because this should be a very rare situation.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Crashing when working out of a folder

Post by Graf Zahl »

Normally the file reading code should check if the file is readable. Maybe the exception should be delayed for the second attempt to read. The first should return 0, and if the calling code does not deal with the error, then it should abort.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Crashing when working out of a folder

Post by _mental_ »

Not sure how this supposed to work. Let's take the actual crash location as example.
A file reader is created FImageSource::GetImage(), and the crash happens in IMGZImage_TryCreate().
Even if the first call won't abort (which is Seek() in this case), it will fail on Read() in the next line.
I assume that seeking a file is qualified as reading it.
Post Reply

Return to “Bugs [GZDoom]”