Strange Problems

Hello all.

Problem: Scrivener has been running fine for several days on end, with no problems, but now today, it’s crash-city. This morning I adjusted the hidden preference that keeps the Find panel open after a search, then quit so I could restart and try it out. When Scrivener came back up, it loaded my project, and promptly crashed so hard that it nearly locked up the entire system. Scrivener has, in fact, done this a few times over the past several weeks, and it’s heart-stoppingly frightening when it does — this is a very large and complex project that would take months to rebuild. It’s also INCREDIBLY frustrating. I’ve had to reinstall Scrivener about seven or eight times in order to get it to behave. I’ve checked, and I’m not running anything in the background that could cause this kind of trouble; besides, everything else on the system runs flawlessly. Sometimes, the culprit is the ui.plist file, which I need to delete from inside the project, and then let the program rebuild it; I did that here three or four times before I got it to work again.

Well, I FINALLY got Scrivener to load the project again this morning — which took five or six tries and five or six repeated crashes — and when it did . . . of course . . . no symbol or text substitutions, and no automatic spell-checking. At first I tried the fix suggested in the other thread — setting preferences to defaults (and optionally trying to reload the last preferences that worked) — but that did nothing; no change. (In fact, it didn’t even reset all of the preferences; my custom background textures remained in place.) I even tried resetting the preferences and then restarting, which also did nothing. Then, I held down the “Option” key while launching Scrivener. It asked me if I wanted to restore windows. I told it ‘Don’t Restore.’ (Of course, it restored them anyway!) But this time, Scrivener stayed open and behaved itself, and ran properly, and — huzzah — symbol and text substitutions — and spell-checking — were working again. I think this might go some way toward proving your theory about the state-saving code in Lion causing some of these problems. It doesn’t explain the crashes, though.

If it will help, I’ve included a zip file containing the crash reports from ~/Library/Logs/DiagnosticReports, to maybe see if you can make heads or tails out of what’s going on . . . most the crash reports refer to something called ‘PropertyListSourceSynchronizer’ as being the start of the problems. Whatever that is!

—A.H. (227 KB)

All of those crashes are coming from the preferences. It looks as though Apple’s NSColor object is having problems loading one of the textures you have assigned it. There’s no indication which view background or which texture it is, but that’s definitely the cause. So the fix is either to reset your preferences or to go through them and try removing the texture backgrounds one-by-one until things run smoothly again. I recommend keeping any textures you use to a minimum and ensure the texture files are small, too.

Scrivener doesn’t use Lion’s restore code for a number of reasons (for a start, Layouts depend on Scrivener having its own state-saving code). Holding shift while opening Scrivener should prevent windows opening, but only if shift is held down throughout the launch.

This is very interesting. Next time spelling and substitution stops working, try using the Shift key again and again choose not to restore. If that consistently fixes the spelling and substitution problems - and I’ll get others with the same problem to test this - then that would prove for certain that the problem lies in Lion’s restore code, which Scrivener doesn’t even use but which Lion must be imposing on certain areas behind the scenes regardless.

I HOPE that has helped. :slight_smile:

All the best,

That makes sense. Next time the substitutions go crazy, I’ll give that remedy a shot. The texture I was using was Apple’s linen texture, from /System/Library/CoreServices…something else. It’s a huge texture file, which of course, given your explanation, would certainly explain the crashes. It seems to be running fine with it now, though, and everything is working properly. If anything goes nuts again, I’ll definitely let you know (and will try that shift-key remedy first). Generally, I only use two textures — one for paper (a nice parchment texture I found) and the other for he background (the linen texture). But I think it’s the size of the latter that may be causing it to occasionally freak out. Like I say, it’s running fine with it right now, but if it chokes again, at least I’ll know what the issue was.

Thanks Keith, all the best,