Weirdness in my PowerBook. /bin/ps spawned by NSTask never exits
Weirdness in my PowerBook. /bin/ps spawned by NSTask never exits
- Subject: Weirdness in my PowerBook. /bin/ps spawned by NSTask never exits
- From: Jerry Krinock <email@hidden>
- Date: Sat, 01 Apr 2006 20:20:25 -0800
- Thread-topic: Weirdness in my PowerBook. /bin/ps spawned by NSTask never exits
My app needs info about other running processes when it launches, and due to
the limitations of NSWorkspace, I create an NSTask to do
/bin/ps -xca -o pid -o command -o user
and then -waitUntilExit. All in the main thread. Released this code 6
months ago, no problems.
Today, while testing an update, I found my app hanging on -waitUntilExit.
After much head-scratching, I launched our latest public release and it
hangs upon launch too. OH MY GOSH!!
What could cause this? This powerbook is otherwise running OK, except that
I see that it has a couple dozen zombie processes named "(smbclient)" and
"(nmblookup)". I imagine a restart would "fix" it, but of course I want to
nail this bug before it happens to a real user.
Prior to this NSTask, the app launches another NSTask to do
/usr/bin/uuidgen. That task works fine.
But this is some kind of Cocoa problem, because if I paste that /bin/ps...
command into a Terminal window and hit return it works fine there.
Also, if I do a "ps" in Terminal, I see that the other "ps" spawned by my
app is indeed stuck in state (STAT) Ss, which means that it is in
interruptible sleep, waiting for some child process to complete, and has
made itself a session leader. If I kill it, my app un-hangs and continues
as expected.
I'll take any little clues I can get. Of course, I could spawn a thread to
monitor this NSTask, time out, and notify the user of the problem. But I
want to say more than "DUHHHHH. Try a restart?"
Jerry Krinock
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden