Possible clue to the cause of crashes

A user today reported that she had repeat crashes of PanX when running a particular procedure; none of my suggestions worked to stop them.

Then she reported that she restarted her computer and the crashes stopped. She had been obviously restarting PanX each time.

Later today, I also started getting a repeat crash and could not stop it. I have enabled the Instrumentation Log and embedded several zlog statements, but I still did not see the cause.

Then, I restarted my computer and crashes stopped! What the heck? The procedure that had crashed five times in a row at approximately the same place now worked ten times in a row. Why would restarting fix some problem that was leading to crashes? The procedures that crash are all adding records to the database (but not saving the file until much later); could that be related to whatever could be fixed by a restart. (I feel like I’m back to System 6.)

That sounds like more of a clue to despair.

The zlog statement won’t show a cause, it will just help precisely pin down where in the code the crash is occurring.

Remember, Panorama X uses Apple’s auto-save system so just because your code doesn’t contain a save statement doesn’t mean a save isn’t happening. However, I’m not sure if an auto-save could happen while a procedure is running. The auto-save code is all written by Apple so I have no idea how it is triggered. Maybe something in Apple’s code is getting confused and a restart clears out the problem. If so, wow, I don’t know how I’ll ever track that down.

Hmm, I see that Apple does notify me when auto-saving, and gives me a chance to tell them to not do it. Currently it is disabling auto-save when a dialog is open or a cell is being edited. Maybe it needs to disable auto-save whenever a procedure is running. That’s pure speculation, and seems odd because if that were the case I would expect this to have been a problem all along, including with single user versions of Panorama. But I suppose not too many people are running 400 line procedures (though I do all the time, but I guess mine aren’t usually making multiple modifications to the database).