Re: Exception reading pipe from NSTask using debugger
Re: Exception reading pipe from NSTask using debugger
- Subject: Re: Exception reading pipe from NSTask using debugger
- From: James Bucanek <email@hidden>
- Date: Fri, 11 Mar 2005 08:42:49 -0700
email@hidden wrote on Thursday, March 10, 2005:
>Well, your code runs fine in the scenarios you give on my PB17 1.33GHz,
>10.3.8 (no haxies...) so it might be an issue that only shows up on
>dual CPU machines. If you have the CHUD tools installed you'll have a
>'Hardware' System Preference that can turn off one of your G5's cpus to
>see if that makes a difference. The CHUD tools are not installed by
>default, but they are located on the Xcode developer tools CD.
I had the CHUD tools installed already, so I turned off one CPU. It didn't make any difference. Maybe it's a G5 issue?
>If you know you will always have less data than the socket buffers
>(~32K if memory serves) you could try calling -waitUntilExit before
>-readDataToEndOfFile.
I don't like to make those kinds of assumptions. I'm sure ps is unlikely to return more than 32K of data, but somewhere in the universe someone is going have a system that does; The app will hang, and I'll get blamed for it. ;)
Regardless, I did try putting the waitUntilExit before the read and it works fine. I also tried using a loop calling availableData, but that did the same thing.
It appears that almost any significant delay between launch and read prevents this from occurring. I would guess some race condition introduced by the debugger, but I haven't a clue as to what it might be.
>(Also, in my code I wrap -launch in an exception handler since the
>documentation says it can raise an exception if something prevents the
>process from running...)
This whole block is wrapped in a NS_DURING block, which is how I was catching the exception. But all that was superfluous to the example, so I left it out.
Thanks for the suggestion.
--
James Bucanek <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden