I have developed a strange problem on my primary development machine such that when my app creates and launches an NSTask while running in Xcode _with_ the debugger (even if there are no breakpoints set), the launch never occurs.
I believe I'm getting back a status code of 5 from the NSTask. Which I'm assuming may be this (from sys/errno.h): #define EIO 5 /* Input/output error */
In addition I get a spinning cursor in my application until I click the "Terminate" button in Xcode, then the app quits and creates a crash log.
If I run my app from Finder, or in Xcode without the debugger then launching the NSTask works fine.
So I created a brand new really simple project with a class containing this one method triggered from a button...
- (IBAction)myAction:(id)sender { NSTask * aTask = [[NSTask alloc] init]; NSMutableArray * args = [NSMutableArray array];
[args addObject:@"/Applications/TextEdit.app"]; [aTask setLaunchPath:@"/usr/bin/open"]; [aTask setArguments:args]; [aTask launch]; }
This app has the same problem. Running from Finder or Xcode without the debugger works, but attempting to run in the debugger crashes.
Here's the call stack from a crash. This small test app as well as my larger application both always seems to die in "send_event".
Host Name: hermasjx.msfc.nasa.gov Date/Time: 2005-06-02 17:31:07 -0500 OS Version: 10.3.9 (Build 7W98) Report Version: 2
Command: TaskTest Path: /Users/hermasj/Documents/Development/TaskTest/build/TaskTest.app/Contents/MacOS/TaskTest Version: ??? (???) PID: 927 Thread: 0
Exception: EXC_BREAKPOINT (0x0006) Code[0]: 0x00000001 Code[1]: 0x8fe17050
Thread 0 Crashed: 0 dyld 0x8fe17050 send_event + 0 1 dyld 0x8fe11390 link_in_need_modules + 0x140 2 dyld 0x8fe10f6c bind_lazy_symbol_reference + 0x534 3 dyld 0x8fe01040 stub_binding_helper_interface + 0x40 4 com.apple.Foundation 0x90a4e2c4 -[NSConcreteTask launchWithDictionary:] + 0x658 5 MyController.ob 0x002fae54 -[MyController myAction:] + 0x108 6 com.apple.AppKit 0x92f27b2c -[NSApplication sendAction:to:from:] + 0x6c 7 com.apple.AppKit 0x92f2e848 -[NSControl sendAction:to:] + 0x60 8 com.apple.AppKit 0x92f68b28 -[NSCell _sendActionFrom:] + 0x9c 9 com.apple.AppKit 0x92f08580 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 0x3fc 10 com.apple.AppKit 0x92f79738 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 0x234 11 com.apple.AppKit 0x92f3e918 -[NSControl mouseDown:] + 0x218 12 com.apple.AppKit 0x92eb2a24 -[NSWindow sendEvent:] + 0x10e4 13 com.apple.AppKit 0x92ea50d0 -[NSApplication sendEvent:] + 0xebc 14 com.apple.AppKit 0x92ead500 -[NSApplication run] + 0x240 15 com.apple.AppKit 0x92f69bec NSApplicationMain + 0x1d0 16 main.ob 0x000e0f74 main + 0x38 (main.m:13) 17 com.apple.myCocoaApp 0x00001b28 start + 0x1c8 18 dyld 0x8fe1a278 _dyld_start + 0x64
In addition, the crashdump entries in system.log look slightly different than what I've seen before. There's always an initial line stating: "Unable to determine CPSProcessSerialNum pid: 927 name: TaskTest"
I've tried running the same code in Xcode with the debugger on two other machines and it runs fine on them so I believe something is hosed on my primary development machine that's causing this. Has anyone seen this kind of behavior before who could perhaps offer some advice? I've completely removed and re-installed Xcode Tools but that didn't help. I've also tried running Xcode under a different user account on this machine and had the same problem.
The machine with the problem is 10.3.9 & Xcode 1.5.
I'd like to avoid going through a complete OS re-install if possible.
Thanks, Steve
|