Monday, July 6, 2009

iPhone debug zombies and finally VMware

A few weeks ago I had an iPhone app running in the simulator that wouldn't quit. I also could not kill it, not using Activity Monitor nor kill or kill -9 or killall.

cyrus:~ ajbrehm$ ps auxc|grep Vocky
ajbrehm
76450 0.0 0.1 153116 5212 ?? UE 12:59pm 0:00.05 Vocky
ajbrehm
76437 0.0 0.1 153116 5212 ?? UE 12:58pm 0:00.05 Vocky
ajbrehm
76350 0.0 0.1 153116 5212 ?? UE 12:57pm 0:00.05 Vocky
ajbrehm
76336 0.0 0.1 153116 5212 ?? UE 12:56pm 0:00.05 Vocky
ajbrehm
76329 0.0 0.1 153116 5212 ?? UE 12:56pm 0:00.05 Vocky
ajbrehm
76276 0.0 0.1 153116 5212 ?? UE 12:56pm 0:00.05 Vocky
ajbrehm
76245 0.0 0.1 153116 5212 ?? UE 12:55pm 0:00.05 Vocky
ajbrehm
76176 0.0 0.1 153116 5212 ?? UE 12:55pm 0:00.05 Vocky
ajbrehm
76159 0.0 0.1 153116 5212 ?? UE 12:54pm 0:00.05 Vocky
ajbrehm
76150 0.0 0.1 155136 9264 ?? UE 12:54pm 0:00.10 Vocky

This happened whenever I ran the application in the simulator. Sometimes Xcode's debugger picked up on it and the simulator wouldn't run the application any more because, as the console sayd, it was already running.

It took me a while to figure out what was going on. But then misfortune struck and taught me the solution.

After a while VMware also started behaving oddly and left "vmware" zombies behind in Activity Monitor. One of the VMware instances then blocked the GUI. (It also kept changing the mouse pointer tracking speed for some reason. I have no idea why VMware is allowed to change system preferences and block the GUI.)

Ultimately I had to bring down the GUI (I killed loginwindow and windowserver) and solve the problem.

A few days earlier I had tried switching off Spotlight search because it had started indexing 600 GB of incoming data during a copy process (which took nearly 6 hours because of that, from a Firewire 800 disk). For some reason the only way to stop Spotlight from restarting itself during that copy process was to rename ReportCrash to something else ("ReportCrash2") so that it couldn't be found. That made sense at the time.

The problem was that I had forgotten that I had done that.

Once ReportCrash was usable again, each of the zombies reported its crash and went away, both the iPhone program and the many instances of the VMware interface. This took about 5 minutes. (In the process I learned that the 24" Apple Cinema Display is an EXCELLENT monitor for a text interface! Finally I could see each line without linebreaks.)

After that was done, I restarted windowserver and loginwindow and could log back into the GUI. My VMware VMs had also survived (since I didn't reboot) and VMware worked again and I could connect to all the Windows VMs and the zombie processes had gone.

Turned out it was a ten minute issue once it was clear that it had nothing to do with Xcode or gdb.

I hate ReportCrash.


3 comments: