• 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
Re: Use of protocols (for DO) crashing gcc3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of protocols (for DO) crashing gcc3


  • Subject: Re: Use of protocols (for DO) crashing gcc3
  • From: Wade Tregaskis <email@hidden>
  • Date: Wed, 22 Oct 2003 18:32:46 +1000

In the code below, if I uncomment either of the lines that set the
protocol gcc3 crashes while building, with an internal bus error. Any

Can you post the compile instruction complete with all options. I am
wondering if your problem is similar to ones we have seen.

This is the full code:

#import <Foundation/Foundation.h>

@protocol BenchmarkServerProtocol

- (NSDictionary*)resultForBenchmark:(NSString*)benchmark rule:(enum BenchmarkRule)rule performNowIfNecessary:(BOOL)performNow;
- (NSArray*)resultsForBenchmark:(NSString*)benchmark rule:(enum BenchmarkRule)rule resultLimit:(unsigned int)limit;

@end


@interface BenchmarkWastedClass : NSObject {}

+ (void)doNothing;

@end

@implementation BenchmarkWastedClass

+ (void)doNothing {
return;
}

@end


BOOL launchBenchmarkDaemon(void) {
NSTask *daemonTask = [[NSTask alloc] init];
BOOL result;

[BenchmarkWastedClass doNothing];

[daemonTask setLaunchPath:[[NSBundle bundleForClass:[BenchmarkWastedClass class]] pathForAuxiliaryExecutable:@"benchmarkd"]];

[daemonTask launch];
[daemonTask waitUntilExit];

result = ([daemonTask terminationStatus] != 0);

[daemonTask release];

return result;
}

id BenchmarkingClient(BOOL startupIfRequired) {
static id result = nil;

if (!result) { // If we haven't already obtained a benchmarking object
result = [NSConnection rootProxyForConnectionWithRegisteredName:@"benchmarkd" host:nil];

if (!result) {
if (startupIfRequired) { // Presumably server not running
if (launchBenchmarkDaemon()) {
result = [NSConnection rootProxyForConnectionWithRegisteredName:@"benchmarkd" host:nil];

if (result) {
[result setProtocolForProxy:@protocol(BenchmarkServerProtocol)];
}
} else {
NSLog(@"Unable to launch benchmarking daemon");
}
}
} else {
//[result setProtocolForProxy:@protocol(BenchmarkServerProtocol)];
}
}

return result;
}

If you compile it using just "gcc3 theCode.m", it dies as I stated earlier.

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.

  • Prev by Date: Re: Loading multiple NIBs == multiple awakeFromNib calls
  • Next by Date: Re: NSTask and Notification?
  • Previous by thread: Re: Use of protocols (for DO) crashing gcc3
  • Next by thread: Re: cocoa-dev digest, Vol 2 #3061 - 14 msgs
  • Index(es):
    • Date
    • Thread