95% of the time I run Windows 8 on my MacBook Air, but for music stuff or iOS dev I boot back into MacOS Mountain Lion. So one day I log into MacOS and every 5 seconds Finder crashed, lost the desktop, with the dialog box:
The last time you opened Finder, it unexpectedly quit while reopening windows. Do you want to try to reopen its windows again?
But irresepctive of what I selected (even if I selected nothing) it would re-open about 5 seconds later, then crash again almost immediately afterwards. My desktop icons looked like they had been set to <Blink></Blink>
And I was forced to browse files using Terminal (OK, that is typically my preferred method anyway, so no loss there…)
To diagnose I started with MacOS in-built file monitoring utility, and filtered on finder:
sudo fs_usage | grep –i “finder”
You will then need to put in the root password to elevate fs_usage
You will get some quick scrolling output, something like this:
You can hit Ctrl+C to terminate. Unforuntately the beginning of paths are often chopped off, so you may need to run
find . -name “<folder/filename>” to find what you’re looking for
In this case however I looked through the files / processes with “Finder” and one stuck out as being “non-standard” This was process CitrixFMDAgent that was trying to open files used by Finder, which is part of Citrix CloudGateway with ShareFile + Follow-me Data solution.
I found the location of the process using
ps -e | grep -i “citrix”
I then removed the application using (this will forcefully delete the application, you will need to re-install from source files)
sudo rm -f -R /Applications/Citrix
Immediately after removing Citrix folder my Finder stopped crashing, logging on/off the problem remained resolved. Of course I no longer had Citrix installed…but as to why Citrix caused this, I’ll save that for another day of debugging…