Process Hacker and Windows discussion

 
User avatar
LonelyPixel
Member
Posts: 76
OS: Windows 7 x64
Location: Erlangen, DE
Contact:

Configuration file corrupted

12 Aug 2016, 18:53

After the last logoff and logon, Process Hacker reports that my settings file is corrupted. It's attached for further analysis. The XML file is incomplete. The write process seems to be unreliable when the user is logging off and processes don't quit fast enough. Maybe the settings file should be written to a temporary file and then renamed, or keep the last version as a backup so that it can be restored automatically (after telling the user about it).
Attachments
settings.xml
(8 KiB) Downloaded 40 times
 
User avatar
dmex
Admin
Posts: 1328
Location: Australia

Re: Configuration file corrupted

13 Aug 2016, 05:13

LonelyPixel wrote:
After the last logoff and logon, Process Hacker reports that my settings file is corrupted. The write process seems to be unreliable when the user is logging off and processes don't quit fast enough.
I've had this problem a few times and I believe it's caused by a race condition between Windows and Process Hacker when PH takes too long to shutdown and gets terminated by Windows while in the process of saving the settings file resulting in the settings being corrupted.

I'll ask wj32 to look into it :thinking:
 
User avatar
LonelyPixel
Member
Posts: 76
OS: Windows 7 x64
Location: Erlangen, DE
Contact:

Re: Configuration file corrupted

13 Aug 2016, 08:40

I have the impression that Windows has gotten really quick with killing processes on system shutdown with the years. Yesterday I restarted my system a few times for testing, and I've seen "file restored" messages from Visual Studio as well. It seems to be the better approach to write files on change (after a ~1s delay), not just on quit. (I do this with settings files in all my applications.)
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Configuration file corrupted

13 Aug 2016, 18:53

ProcessHacker thinks the XML is corrupted if the path to the dbghelp.dll contains strange chars like " ´ " (accent)

Who is online

Users browsing this forum: No registered users and 2 guests