Re: NSThread Crashes on Intel
Re: NSThread Crashes on Intel
- Subject: Re: NSThread Crashes on Intel
- From: "Mr. Gecko" <email@hidden>
- Date: Thu, 6 Nov 2008 23:11:32 -0600
Tried that and still crashes.
Here is the crash report if it helps
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c0000023
Crashed Thread: 1
Thread 0:
0 libSystem.B.dylib 0x967414a6 mach_msg_trap + 10
1 libSystem.B.dylib 0x96748c9c mach_msg + 72
2 com.apple.CoreFoundation 0x962510ce CFRunLoopRunSpecific +
1790
3 com.apple.CoreFoundation 0x96251cf8 CFRunLoopRunInMode + 88
4 com.apple.HIToolbox 0x9581b480
RunCurrentEventLoopInMode + 283
5 com.apple.HIToolbox 0x9581b299 ReceiveNextEventCommon +
374
6 com.apple.HIToolbox 0x9581b10d
BlockUntilNextEventMatchingListInMode + 106
7 com.apple.AppKit 0x912183ed _DPSNextEvent + 657
8 com.apple.AppKit 0x91217ca0 -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
9 com.apple.AppKit 0x91210cdb -[NSApplication run] + 795
10 com.apple.AppKit 0x911ddf14 NSApplicationMain + 574
11 ...sMedia.Thread_Testing 0x000025a6 _start + 216
12 ...sMedia.Thread_Testing 0x000024cd start + 41
Thread 1 Crashed:
0 libobjc.A.dylib 0x96a31688 objc_msgSend + 24
1 com.apple.CoreFoundation 0x962d0a7d __invoking___ + 29
2 com.apple.CoreFoundation 0x962d0468 -[NSInvocation invoke] +
136
3 com.apple.CoreFoundation 0x962d0538 -[NSInvocation
invokeWithTarget:] + 72
4 com.apple.CoreFoundation 0x962d09aa ___forwarding___ + 986
5 com.apple.CoreFoundation 0x962d0a12 _CF_forwarding_prep_0 + 50
6 com.apple.CoreFoundation 0x962d0a7d __invoking___ + 29
7 com.apple.CoreFoundation 0x962d0468 -[NSInvocation invoke] +
136
8 com.apple.Foundation 0x93abf154 -[NSConnection
dispatchInvocation:] + 132
9 com.apple.Foundation 0x93abd107 -[NSConnection
handleRequest:sequence:] + 1319
10 com.apple.Foundation 0x93abc94d -[NSConnection
handlePortCoder:] + 1149
11 com.apple.Foundation 0x93abc47e -[NSConcretePortCoder
dispatch] + 142
12 com.apple.Foundation 0x93abbbe3 __NSFireMachPort + 339
13 com.apple.CoreFoundation 0x9622d635 __CFMachPortPerform + 117
14 com.apple.CoreFoundation 0x96251908 CFRunLoopRunSpecific +
3896
15 com.apple.CoreFoundation 0x96251cf8 CFRunLoopRunInMode + 88
16 com.apple.Foundation 0x93ab6135 -[NSRunLoop(NSRunLoop)
runMode:beforeDate:] + 213
17 com.apple.Foundation 0x93ac2254 -[NSRunLoop(NSRunLoop)
run] + 84
18 ...sMedia.Thread_Testing 0x00002779 +[Recover connectWithPorts:] +
283
19 com.apple.Foundation 0x93a81bad -[NSThread main] + 45
20 com.apple.Foundation 0x93a81754 __NSThread__main__ + 308
21 libSystem.B.dylib 0x967726f5 _pthread_start + 321
22 libSystem.B.dylib 0x967725b2 thread_start + 34
Thread 1 crashed with X86 Thread State (32-bit):
eax: 0x0019a170 ebx: 0x962d03ee ecx: 0x96ae3514 edx: 0xc0000003
edi: 0xb00a0248 esi: 0x0013f780 ebp: 0xb00a0238 esp: 0xb00a0218
ss: 0x0000001f efl: 0x00010202 eip: 0x96a31688 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x0000001f gs: 0x00000037
cr2: 0xc0000023
On Nov 6, 2008, at 7:10 PM, Nir Soffer wrote:
On Nov 7, 2008, at 01:25, Mr. Gecko wrote:
Hello I am working on a program that uses threads to add some multi
tasking function to it and it works perfect on my PPC machine, but
on every intel based machine that my friends use crashes. the crash
report says that it is with this function below
+ (void)connectWithPorts:(NSArray *)portArray {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSConnection *connectionToController = [NSConnection
connectionWithReceivePort:[portArray objectAtIndex:0] sendPort:
[portArray objectAtIndex:1]];
Recover *serverObject = [[Recover alloc] initWithProxy:
[connectionToController rootProxy]];
[(id)[connectionToController rootProxy] setServer:serverObject];
This seems like an early release.
[serverObject release];
[[NSRunLoop currentRunLoop] run];
Try to release the serverObject here:
[serverObject release];
[pool release];
}
The example code here http://www.cocoadev.com/index.pl?DistributedObjectsForInterThreadCommunication
Does work on both intel and ppc and 10.4 and 10.5.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden