mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

Today i had an unknown problem with all of my opened mirc.exe clients, so i had my computer put it into the sleep mode and when my computer did it with success when i re-open my computer (about 2 days after) the sleep mode did not recover (for some unknown reason the pc terminate the computer probably from battery issues) but this one effect all of my open mirc.exe to destroy the mirc.ini and when i open the mirc.exe the mirc.ini started from the begin (not any remotes loaded cause the fail) but i saw that this problem appeared only on mirc, so i report it may it is an mirc bug that cleared the mirc.ini of each client, also i try to reproduce it but i could not find anything about it.

OS: 8.1 pro (64-bit)
mIRC: 7.38

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Yep. I lost all my .ini files in mIRC as recently as a few months ago. It's unnerving.

I try to keep a backup of my .inis but kind of which mIRC did it automatically, as how it creates .bak of script files.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks for your bug report. This has been reported occasionally in the past, however I have never been able to reproduce it myself. There are so many possible combinations of Windows configurations, background applications, and anti-virus/security software that could cause issues like this. That said, if you were experiencing a problem with all of your mIRC clients, and you then put your computer into sleep mode, and it then failed to restart from sleep mode ie. crashed, it sounds like something was already wrong somewhere and it would be difficult to know how to reproduce the same situation.

mIRC v7.37 actually added a check for sleep mode where it saves ini files immediately to disk when sleep mode is triggered, just in case something goes wrong with sleep mode. However, if there is already an issue with Windows or mIRC, for example due to low memory, it can be difficult to predict what will happen in this situation.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Khaled, would putting /saveini on a timer do anything interesting? I never really understood the modern purpose of /saveini, but I remember it seemed to help way-back-when. Or at least it made me feel good.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Well i will try again manually to put into sleep mode and disable the antivirus and have activate 2 mirc clients open to see if the problem is from antivirus, and i will report you, also i have and a lot of friend that having the same issue, i will ask them how did they experience this problem and i will write you more information, i will do my best to give you steps for reproduce it.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Oh, I forgot to report that I do not use Antivirus software of any kind.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Using /saveini is unlikely to make any difference. The purpose of /saveini is to make sure that any cached settings are saved immediately for scripts that want to access mirc.ini directly.

mIRC saves files in a two step process. It creates a temporary file first, saves all settings to it, and only if that is successful, with no errors, does it then delete mirc.ini and rename the temporary file to mirc.ini. If there is an error of any kind during the process, it leaves the original mirc.ini untouched. This is the safest way to update files.

I assume that in your case, you are using mIRC on a daily basis, and that you are repeatedly running and closing it, and that it is constantly updating the mirc.ini file. For you to see this error once every few months, under such intensive use, it really does seem more likely that the cause is due to something else, such as low memory, a Windows issue, interference from other applications, and so on.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Oh, and it's also usually mirc.ini and/or servers.ini that are affected if this happens, though I have also lost script files further in the past. It hasn't been as much an issue since multiple server support was added, but does still happen.

Running mIRC twice on the same settings and resources does often end in tragedy and maybe this should be prohibited?


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Well, some users report me that this problem appear when the power cuts off so Windows does not shutdown property and also when a user is idle the windows via power settings going into sleep mode and after they came back the mirc.ini was destroyed and also when the Windows does not shutdown correctly, since now i could not find more details about it i need to make some tests more and give you more feedback information about this issue.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
This happens to me from time to time (mirc.ini getting lost/corrupted, but not related to sleep mode), usually because I get mIRC to crash in some ways (if you just run an infinite loop and force mIRC to shutdown, it will almost never corrupt/replace/whatever mirc.ini (I don't know for the others INI files, I don't use them much)).
Well, yesterday, somehow, I got very low on space on C:\ (explorer was reporting 0 mb free, mIRC is running with an old install type on C:\mIRC). I was testing some stuff (7.39), I manually disconnected from a server and reconnected, mIRC froze for 3mins+ after the reconnection.
In the meantime I was eventually trying to free some spaces on C:\, knowing mIRC wasn't really in an infinite loop state and knowing it would eventually get back to a normal state, which happened. Well then I noticed mIRC was using 400 mb in ram which is very unusual for me (mIRC usually stay between 20-50 MB max) and I decided to reboot with /exit -nr.
After mIRC reboot, I saw that my font setting was gone, otherwise everything was there. I was still a bit low on C:\ at this point, I /exit'd -nr once again, this time the whole mirc.ini was gone.

Well if mIRC makes sure the temporary file is created without any problem, how come it's even possible to see that kind of stuff happening? Shouldn't mIRC ran into a situation where the user requested an exit of the application and mIRC is recieving an error of some kind when trying to save the INI file (either for the temp file, or maybe just for the renaming of the temp file to mirc.ini)? Wouldn't that mean mIRC is exiting anyway, without saving properly?
While I think the saving of INI files could be handled better, I agree that mIRC should back up mirc.ini (and eventually others INI files) before renaming the temp file, at least if anything goes wrong, we would still have a back up "~mirc.ini" we can rename manually.


Last edited by Wims; 02/02/15 11:26 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Quote:
This happens to me from time to time (mirc.ini getting lost/corrupted, but not related to sleep mode), usually because I get mIRC to crash in some ways

If mIRC crashes, there is no way to guarantee that a file will be saved properly. For example, if the crash is due to a bug that overwrites mIRC's settings in memory, and mIRC then attempts to save the settings to mirc.ini, it may end up saving invalid data. The only solution in this case is to try to find out the cause of the crash so that it can be fixed. That said, when Windows is in a low resource state, and Windows and/or applications are unable to allocate memory or save files to disk, and end up freezing/crashing because of the low resource state, almost anything can happen, including crashing and file corruption.

Quote:
Well if mIRC makes sure the temporary file is created without any problem, how come it's even possible to see that kind of stuff happening?

Good question. The only reason I can think of is write caching. Most primary drives have write caching enabled to speed up disk access. Microsoft states that "By enabling write caching, file system corruption and/or data loss could occur if the machine experiences a power, device or system failure and cannot be shutdown properly". However, I cannot say for sure whether this also applies in low resource situations where Windows itself has run out of disk space and/or memory.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Quote:
If mIRC crashes, there is no way to guarantee that a file will be saved properly. For example, if the crash is due to a bug that overwrites mIRC's settings in memory, and mIRC then attempts to save the settings to mirc.ini, it may end up saving invalid data. The only solution in this case is to try to find out the cause of the crash so that it can be fixed. That said, when Windows is in a low resource state, and Windows and/or applications are unable to allocate memory or save files to disk, and end up freezing/crashing because of the low resource state, almost anything can happen, including crashing and file corruption.
I was just talking about infinite loop + force closing to simulate crashes, but yes, when the app crash all handles are closed and their content might be corrupted, however, in this case mIRC does not have mirc.ini opened so mirc.ini will never be corrupted, that situation only happens when mIRC exits, where it has to save the settings. I'm sure a lot of people use sleep mode with mIRC without any trouble, so the real issue is probably just low spaces on the disk or too few ram available when mIRC is about to do this saving process.

I got my C:\ to be full again for the purpose of this test and I reproduced the issue.
$disk(C:\).free returned 0 and I immediately /exit -nr, mIRC reboot with a blank mirc.ini. I had plenty of ram so the temp file was probably fine, it's just when you are writting to the disk that it must get an error.
I'm not blaming mIRC, clearly I have no space left on the disk, mIRC can't magically find spaces but I'm saying that, well, for one thing it could check if there is spaces available, but in any case the current mirc.ini file on disk should not be touched in this situation, what do you think?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks, I was able to reproduce this issue. It was due to the file writing routine not propagating one of the write error checks back to calling routines correctly. As far as I can tell, it would only have occurred in a disk full context. This fix will affect a number of features. For example, in older versions of mIRC, if you use /write on a full disk, it will not report an error. In the next version, it will. This also resolves the mirc.ini file becoming empty in a disk full context.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Great smile I hope this will eventually reduce the number of users getting their settings deleted!


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Thats very good news Khaled!! well done, good catch Wims!!!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard