Preference file corruption

Captain Code

Moderator
Staff member
Mod
Does anyone else think that preference file corruption that causes applications to crash is a serious problem? It seems to happen a lot, and way more than it used to. This seems a pretty big problem to me which Apple really should fix. Pretty much all the preference files in ~/Library/Preferences are generated and read by Apple API functions, so it would seem that it would be Apple's problem that it's getting corrupted, even if the app crashes while it's being written to or something.

They should really fix this because it seems like a major problem which causes a lot of problems.
 
How long does it take, after you trash the pref files, for it to start crashing again?
 
I'm not having any problems right now, but it seems like it happens a lot on this board where trashing the pref file is the fix to the application problem. I don't recall this happening much in OS9 for example.
 
The last time I fixed a pref file problem, it was on OS9 :-) But, yes, you have a point, it does seem to be a regular cause of problems, and it could probably be fixed by Apple making the APIs for handling pref files more robust.
 
Trashing a preference file doesn't necessarily mean that the problem was being caused solely by a corrupted preference -- but in many cases, as said, trashing the preference file sure does help.

A re-format and re-install of the system and/or software would surely also cure whatever problem, but that doesn't mean that it was the installation of software that caused the problem.

A deleted preference file may cause the application in question to rebuild more than that preference file alone, so trashing preferences is kind of an all-in-one solution to many problems. The problem may have been with some other file related to the preferences, and if said file is known, rebuilding/trashing that file instead of the preference file may yield good results as well.

I think trashing preference files is becoming an ubiquitous solution, much like rebuilding the desktop in the OS 9 days or zapping PRAM. They're an all-purpose swiss army knife of sorts when troubleshooting. You know the people you help -- they have a problem, and the first things you say are, "Have you tried (a. trashing preferences) (b. zapping PRAM) (c. restarting/logging in/out) (d. etc.)" And you know that most times it worked -- but we're still left without a definite solution. We just say, "Well, I don't know what it is, but trashing the preferences worked. Must have been a corrupt preference."
 
I've never really gotten what file corruption means. I know that when someone has an infection, there are lots of bacteria or viruses spreading through the body from the source, which is usually a cut or other sort of opening in the skin... How does file corruption actually work?
 
Infection and corruption, in computer terms, are two different things.

Preference corruption happens when either a) the program, b) the system or c) some other application writes "invalid" or incomplete data to a preference file, rendering the file partially or completely unreadable by the host application. It can also be caused by a preference being written to a faulty section of the hard drive, or by the power being interrupted during a write to a preference file.

Most all applications simply re-write a new preference file with pre-set defaults if the program doesn't find the preference file in the default location. That's why deleting the preference file for an application can sometimes solve instability or weird happenings with the program -- if the preference file is truly corrupted, then the program could be trying to read information from that file that isn't correct because it's corrupt or could have trouble writing new or modified data to that file, causing problems.

I believe that preference files are more prone to corruption than other files in the system because they're read from and written to quite often in certain cases. Every time you start a program, it reads the preference file to check for various settings, and every time you change a setting in that program, a little bit of data is written or re-written to that preference file.
 
Back
Top