Hi all,I have a task prepared and launched with the code below, and when it returns (in this situation that status code returned from terminationStatus is 0), it hangs in availableData, never to return. The stack at this point is very deep because of a recursive function (see the stack trace below), which might be a factor in this hanging problem. Could this be a problem with the stack depth? This code functions perfectly most of the time.
messagePipeError = [NSPipe pipe];
messagePipeOutput = [NSPipe pipe];
[task setLaunchPath:@"/usr/bin/hdiutil"];
[task setArguments:[NSArray
arrayWithObjects:@"info", nil]];
[task setStandardError:messagePipeError];
[task setStandardOutput:messagePipeOutput];
[task launch];
[task waitUntilExit];
status = [task terminationStatus];
NSData *messageDataError = [[messagePipeError fileHandleForReading]
availableData];
messageError = [[[NSString alloc] initWithData:messageDataError
encoding:NSUTF8StringEncoding] autorelease];
This is the stack: 0 read$UNIX2003 1 NSReadFromFileDescriptor 2 -[NSConcreteFileHandle availableData] 3 MyFunction . . . 221 PThread::run 222 PThread::threadFunction 223 _pthread_body The code the debugger shows in read$UNIX2003: <+0000> mov $0xc0003,%eax <+0005> call 0x93d38a14 <sysenter_trap> <+0010> jae 0x93d5beea <read$UNIX2003+26> <<<<< hung here <+0012> call 0x93d5bee1 <read$UNIX2003+17> <+0017> pop %edx <+0018> mov 0xcce61df(%edx),%edx <+0024> jmp *%edx <+0026> ret Michael Domino [email protected]
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
