Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash in CFRunLoopSourceIsValid



The crash address of 0x00000006 means that your -closeService method is passing in a NULL pointer to CFRunLoopSourceIsValid().


Chris Kane
CoreFoundation, Apple


On May 7, 2004, at 7:58 AM, Christian Weykopf wrote:

Hello,
my programm sometimes crashes during shutdown in the CFRunLoopSourceIsValid call.
It is a background programm, that does some asynchron IO transfers.
Any thoughts?


After opening the Userclient I do

kernResult = IOCreateReceivePort( kOSAsyncCompleteMessageID, &_asyncPort);
_cfAsyncPort = CFMachPortCreateWithPort (kCFAllocatorDefault, _asyncPort, (CFMachPortCallBack) IODispatchCalloutFromMessage, &cfPortContext, &shouldFreeInfo) ;
_runLoopSource = CFMachPortCreateRunLoopSource (kCFAllocatorDefault, _cfAsyncPort, 0) ;
CFRunLoopAddSource (CFRunLoopGetCurrent(), _runLoopSource, kCFRunLoopCommonModes);

And in closing the Service:
- (BOOL) closeService
{
kern_return_t kernResult;

// NSLog (@"%s", __PRETTY_FUNCTION__);

if (CFRunLoopSourceIsValid (_runLoopSource)) <-- here is the crash
CFRunLoopSourceInvalidate (_runLoopSource);

// This closes the connection to our user client and destroys the connect handle.
kernResult = IOServiceClose (_dataPort);
if (kernResult != KERN_SUCCESS)
{
syslog (1, "%s ERROR IOServiceClose returned 0x%X", __PRETTY_FUNCTION__, kernResult);
syslog (1, "System: %d Subsystem: %d Errorcode: %d\n", err_get_system(kernResult), err_get_sub(kernResult), err_get_code(kernResult));
return NO;
}

return YES;
}

the crashlog:

Date/Time: 2004-05-04 17:43:30 -0700
OS Version: 10.2.8 (Build 6R73)
Host: Dual1.25-Silver-Server-X

Command: Remote Control
PID: 602

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000006

Thread 0 Crashed:
#0 0x90181024 in CFRunLoopSourceIsValid
#1 0x00009e30 in -[IOConnect closeService]
#2 0x0000996c in -[IOConnect dealloc]
#3 0x0000a4b8 in -[MSTFernDelegate applicationWillTerminate:]
#4 0x97dfab58 in _nsNotificationCenterCallBack
#5 0x901684d0 in _postNotification
#6 0x90165be4 in _CFNotificationCenterPostLocalNotification
#7 0x931559c4 in -[NSApplication terminate:]
#8 0x0000a398 in -[MSTFernDelegate applicationDidFinishLaunching:]
#9 0x97dfab58 in _nsNotificationCenterCallBack
#10 0x901684d0 in _postNotification
#11 0x90165be4 in _CFNotificationCenterPostLocalNotification
#12 0x9318a720 in -[NSApplication _sendFinishLaunchingNotification]
#13 0x93161624 in _requiredAEEventHandler
#14 0x91b56570 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*)
#15 0x91b590cc in dispatchEventAndSendReply(AEDesc const*, AEDesc*)
#16 0x91b56478 in aeProcessAppleEvent
#17 0x96a83778 in AEProcessAppleEvent
#18 0x9308e0a8 in _DPSNextEvent
#19 0x930a0158 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#20 0x930b1d88 in -[NSApplication run]
#21 0x9315fc58 in NSApplicationMain
#22 0x00009298 in _start (crt.c:267)
#23 0x8fe190f4 in _dyld_start

Thread 1:
#0 0x90073ba8 in mach_msg_trap
#1 0x90005ed0 in mach_msg
#2 0xc0009528 in __ape_internal
#3 0xc0001368 in __ape_agent
#4 0x90020c28 in _pthread_body

PPC Thread State:
srr0: 0x90181024 srr1: 0x0200f030 vrsave: 0x00000000
xer: 0x00000000 lr: 0x00009e30 ctr: 0x90181024 mq: 0x00000000
r0: 0x00009e30 r1: 0xbfffe060 r2: 0x00000182 r3: 0x00000000
r4: 0x0000bd38 r5: 0x00000090 r6: 0x00000000 r7: 0x00000000
r8: 0x00000000 r9: 0x00000001 r10: 0xbfffd0db r11: 0x901f7af8
r12: 0x90181024 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0x00000000 r17: 0x00000000 r18: 0x00000002 r19: 0x00000000
r20: 0x00089280 r21: 0x36ca4bad r22: 0xa30759f0 r23: 0xbfffe660
r24: 0xa30759f0 r25: 0x00089280 r26: 0x00000000 r27: 0xbfffe6b4
r28: 0x00089280 r29: 0x0019efa0 r30: 0x00000000 r31: 0x0019efa0

--
Christian Weykopf
Meilenstein Mac OS Software

Neue Strasse 5
D-31582 Nienburg
Fax: +49 (0) 5021 91 24 45
<http://www.meilenstein.de/>
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Crash in CFRunLoopSourceIsValid (From: Christian Weykopf <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.