Why does a "corrupted" preferences file break stuff?

Isn't it just a record of some parameters? If there's other stuff in it, why not put it in a separate file so that you don't lose your settings when you delete it? Why doesn't this happen in other apps?

iMac Line (2012 and Later)

Posted on Sep 6, 2020 1:13 AM

Reply
15 replies

Sep 6, 2020 2:57 AM in response to betaneptune

betaneptune wrote:

Isn't it just a record of some parameters? If there's other stuff in it, why not put it in a separate file so that you don't lose your settings when you delete it? Why doesn't this happen in other apps?


It is a record of some parameters that have been set.

Preferences are loaded when the application starts. If this file is corrupted, wrong values can be read into the active parameters of the application. This can have devastating effects. If you have done even a small amount of programming it is easy to imagine how, for example, a loop with the wrong termination condition can step out of the bounds of an array - just to give a fairly trivial example.

Sep 6, 2020 1:52 PM in response to betaneptune

What I meant was the closed state and other actions don't get written into the prefs file when the application crashes or force quits. For those things to be recorded the application has to quit from the menu or the keyboard and closed properly.


Not sure what you mean by write to a different file. A different file would have the same problem.


No, no, the preferences are user modified, but the preferences file holds a lot more, like the closing state. That's a user preference. Prefman is a good tool if you want to restore your preference set.


You mean exit handler that can operate while an application is crashing? I don't know anything about coding, so no idea if that's possible.

Sep 6, 2020 3:14 PM in response to Tom Wolsky

Tom Wolsky wrote:

What I meant was the closed state and other actions don't get written into the prefs file when the application crashes or force quits. For those things to be recorded the application has to quit from the menu or the keyboard and closed properly.

OK.

Not sure what you mean by write to a different file. A different file would have the same problem.

Write the preferences in the preferences file, and write all the other stuff that's currently written in that file to another file. this way you can delete that file and thereby not lose your preference customizations.

No, no, the preferences are user modified, but the preferences file holds a lot more, like the closing state. That's a user preference. Prefman is a good tool if you want to restore your preference set.

The closing state is a user pref? That's what should be written to a separate file.

You mean exit handler that can operate while an application is crashing? I don't know anything about coding, so no idea if that's possible.

Yeah, maybe the exit handler is only good when the app is hung. Also, a "nice crash" could dump memory contents, e.g., for analysis by the programmers, but maybe not with a "hard crash".

Sep 6, 2020 2:20 PM in response to Ian R. Brown

Ian R. Brown wrote:

It's not just FCP X and iMovie that suffer as I mentioned above.

I first came across the problem with Adobe Premiere around 2004 and then legacy Final Cut Pro/Final Cut Express in 2005.

If you do a Google search you will find that it is a common occurrence in most of Adobe's apps like Premiere, Photoshop, Illustrator etc. etc.

It appears that audio/visual applications are most susceptible.

Bummer. Thanks for the info.

Sep 6, 2020 3:08 AM in response to Luis Sequeira1

But why is this file being corrupted so often? And by what? FCP itself? How? No other files seem to get corrupted so often. I've written programs with parameter files and haven't had this problem. OK, not at the level of FCP, and it was in the 1980s, but still. If other files got corrupted this often, macOS would get totally messed up, and probably rapidly become unfixable.

Sep 6, 2020 4:06 AM in response to Luis Sequeira1

It's not just FCP X and iMovie that suffer as I mentioned above.


I first came across the problem with Adobe Premiere around 2004 and then legacy Final Cut Pro/Final Cut Express in 2005.


If you do a Google search you will find that it is a common occurrence in most of Adobe's apps like Premiere, Photoshop, Illustrator etc. etc.


It appears that audio/visual applications are most susceptible.

Sep 6, 2020 1:44 PM in response to Tom Wolsky

You say it happens when the app crashes, but then you say it doesn't happen when there's a crash. Please clarify.


So then why doesn't it write those functions and stuff to a different file?


The preferences, AFAIK, aren't modified except by the user, and I have yet to see the program crash while changing the preferences.


Why isn't there an exit handler that can handle this? OK, that might be tough to do. I've written exit handlers in DCL command procedures (scripts), but I don't think I've ever done it in compiled code, and it was years since I've done such stuff.

Sep 6, 2020 2:26 PM in response to betaneptune

Actually, I recall now that there are exit handlers in compiled code. The Unix/Linux kill command has the -9 option, which is a sure kill, as it doesn't allow the exit handlers to run. At one place where I was an OpenVMS system admin, the previous admins wrote a FORCEX command, which would be gentler than the STOP/ID=nnnnnnnn, which was the equivalent of the kill -9 command, AFAICT. But there may well be something else involved. I don't really know. Oh, so I'm guessing that a Force Quit in macOS is the equivalent of a kill -9. Is that right?

Sep 6, 2020 1:59 PM in response to Luis Sequeira1

So how does a file that stores preferences get corrupted in the first place? Seems to me that it should only be modified when the user does so, unless there's other stuff in there, in which case why not put that other stuff in another file so that you don't wipe out your personalized preferences?


Yes, I did some programming years ago. Yes, I can see problems from messed up data in the preferences file, but I still don't see how it gets corrupted in the first place. Aren't there plenty of other files that if they get corrupted would cause big problems? OK, I guess that's where the totally reinstall from scratch bit comes in.


Hard drives have special firmware or whatever that in the event of an app or OS crash, or a sudden loss of power has firmware that keeps critical file system files from getting corrupted to the point where you can't even mount the drive and access files, at least. Why can't something like that be done here?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why does a "corrupted" preferences file break stuff?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.