• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTask autorelease OR retain/release -> SIGBUS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTask autorelease OR retain/release -> SIGBUS


  • Subject: NSTask autorelease OR retain/release -> SIGBUS
  • From: Seth Delackner <email@hidden>
  • Date: Thu, 3 Apr 2003 23:59:43 +0000
  • Mail-followup-to: email@hidden

This should not happen:
1. call doFoo. Runs fine.
2. call doFoo a second time.
a. If on line (A) I autorelease the task, we crash SIGBUS.
b. If on line (A) I retain, then at line (B) release, SIGBUS.
c. If I simply leave it as listed below, "leaking", it runs fine.

This isn't the actual code, but it seems to be the relevent portion. The
NSTask is not referenced ANYWHERE else in the program.

foo.m:
static NSTask* myTask;

+ (void)doFoo{
NSString* myPath = "/my/binary/path";
myTask = [[NSTask alloc] init]; // (A)
[myTask setLaunchPath: myPath];
[myTask setArguments: [NSArray arrayWithObjects: @"first", nil]];
[myTask launch];
[myTask waitUntilExit];
// (B)
myTask = nil;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTask autorelease OR retain/release -> SIGBUS
      • From: Phill Kelley <email@hidden>
    • Re: NSTask autorelease OR retain/release -> SIGBUS
      • From: Nick Zitzmann <email@hidden>
    • Re: NSTask autorelease OR retain/release -> SIGBUS
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: import statement issues - SOLVED
  • Next by Date: Notifications & threads
  • Previous by thread: nspopupbutton smoothness
  • Next by thread: Re: NSTask autorelease OR retain/release -> SIGBUS
  • Index(es):
    • Date
    • Thread