[Fixed] GZDoom eats and overrides config files

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Re: GZDoom eats and overrides config files

Postby JPL » Sun Nov 15, 2020 5:37 pm

Just in case it's a useful data point and without speculating as to causes, I've been running GZDoom from Linux for over 10 years and I've never seen this issue.
User avatar
JPL
 
 
 
Joined: 09 Apr 2012

Re: GZDoom eats and overrides config files

Postby drfrag » Tue Nov 17, 2020 4:00 am

A question for people experiencing this issue, do you have any third party antivirus software installed and which one?
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: GZDoom eats and overrides config files

Postby SanyaWaffles » Tue Nov 17, 2020 5:54 am

I have Malwarebytes installed, however I don't have the realtime protection enabled. I find that stuff intrusive.
User avatar
SanyaWaffles
Certified Heretic and Grill Champion
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: GZDoom eats and overrides config files

Postby drfrag » Tue Nov 17, 2020 6:21 am

I also have that antimalware installed, must be something else. Seems this is a windows only problem after all so a simple _stat check would do then.
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: GZDoom eats and overrides config files

Postby drfrag » Tue Nov 17, 2020 11:22 am

First i did the _stat version but then i upgraded it to C++ 17, PR here: https://github.com/coelckers/gzdoom/pull/1235
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: GZDoom eats and overrides config files

Postby Graf Zahl » Tue Nov 17, 2020 11:43 am

GZDoom already has a stat based FileExists function. Please use that. std::filesystem is not available on macOS 10.14 and lower so thanks to Apple being dicks we can't use it for the time being.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: GZDoom eats and overrides config files

Postby Caligari87 » Tue Nov 17, 2020 11:53 am

Sorry if this disrupts the path to the bug, I do want to briefly chime in and say this has happened to me at least once on Linux earlier this year. Weirdly, it resulted in a partial overwrite of my settings (some were preserved, some set to defaults). I have no idea why it happened and haven't been able to reproduce it.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: GZDoom eats and overrides config files

Postby drfrag » Tue Nov 17, 2020 2:15 pm

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: GZDoom eats and overrides config files

Postby drfrag » Wed Nov 18, 2020 1:25 pm

Seems it's fixed in the PR but now i've found another issue on windows and it's potentially very serious. It's about the _stat function, it's broken and it's used by FileExists. If you remove the permissions (or it's blocked by something else) _stat returns -1 like if the file didn't exist. I'm using VS 2017 but i think it also happens in 2019 (_mental_ has reported it). I've confirmed that the internal version works properly with the PR, it's still in GZDoom guarded by #ifdef USING_V110_SDK71 and it's _wstat64i32 but now GZDoom uses _wstat64 instead. I don't know what would be a better solution here, either using the internal version or fileSystem::exists on windows.
Last edited by drfrag on Sat Nov 21, 2020 5:39 am, edited 1 time in total.
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: GZDoom eats and overrides config files

Postby drfrag » Sat Nov 21, 2020 5:37 am

Having a look at the source at least you can't lose savegames so may be it's not that bad. There are two completely different FileExists functions and the _stat problem is in DirEntryExists and that one is used by BaseFileSearch , D_AddFile and AddFile (besides the uses of FileExists itself). So what should i do now? Probably it's better to upgrade to filesystem::exists in FileExists for now on windows only and later do the transition for other OSes (stat works there).
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: GZDoom eats and overrides config files

Postby drfrag » Sat Nov 21, 2020 1:25 pm

I've done it but now i'm not so sure the "upgrade" to <filesystem> was such a good idea. For filesystem::last_write_time you can't convert from file_time_type to time_t until C++ 20, on the other side the time parameter is unused in GetFileInfo so i could just change the specification.
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: GZDoom eats and overrides config files

Postby drfrag » Sat Nov 21, 2020 2:50 pm

Done another PR, the alternative would be to use the internal _stat function and change it to use 64 bit file sizes. Or report the bug to Monkeysoft and wait for VS 2021.
https://github.com/coelckers/gzdoom/pull/1237
Edit: closed it and opened https://github.com/coelckers/gzdoom/pull/1238
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: GZDoom eats and overrides config files

Postby Apeirogon » Tue Dec 15, 2020 3:02 pm

Maybe, just maybe, it have a some sense to add "void CrashIfIniFileCannotBeRead(const ErrorReport& txt) const {}" function to next release of Gzdoom to try replicate this bug on large numbers of Gzdoom instances!?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: GZDoom eats and overrides config files

Postby Apeirogon » Sat Feb 27, 2021 3:24 am

Just letting you know that happened again right now. And I didnt launch Gzdoom for quite some time. It was first time I launched it in two weeks I think.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: GZDoom eats and overrides config files

Postby _mental_ » Sat Feb 27, 2021 3:59 am

I don't know how many times I need to emphasize the right way of investigating this issue.

_mental_ wrote:None of the provided reports didn't answer one simple question: was the config screwed during exiting from the first run or did it happen at beginning of the second one?
_mental_ wrote:If it's blocking file from reading, and then, it allows writing to the same file, we really need to know more details about this.

What you need to do is to keep GZDoom running (or kill it from Task Manager to avoid writing the config file), copy .ini to other location, and make sure that last modification time is preserved.
Now you can figure out was the config already screwed or not. This way, we will have an answer to the question from my first quote.
And once again, if this happened to you, it's completely useless to just post about the fact. Doing this won't make it fixed any faster.
_mental_
 
 
 
Joined: 07 Aug 2011

PreviousNext

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests