-[ABMetaDataController validateMetaDataIfNeeded] and NSZombie
-[ABMetaDataController validateMetaDataIfNeeded] and NSZombie
- Subject: -[ABMetaDataController validateMetaDataIfNeeded] and NSZombie
- From: Ken Victor <email@hidden>
- Date: Sun, 11 Jun 2006 19:20:21 -0700
in my app's delegate's i cache 2 value's from the address book as follows:
[self setUserFirstName: [[[ABAddressBook sharedAddressBook] me]
valueForProperty: kABFirstNameProperty]];
[self setUserLastName: [[[ABAddressBook sharedAddressBook] me]
valueForProperty: kABLastNameProperty]];
this eventually leads to a call to -[ABMetaDataController
validateMetaDataIfNeeded] that detaches a new thread with the
following stack trace:
#0 0x929303d4 in +[NSThread detachNewThreadSelector:toTarget:withObject:]
#1 0x94cb8614 in -[ABMetaDataController validateMetaDataIfNeeded]
#2 0x9293cbf8 in __NSFireDelayedPerform
#3 0x907ef550 in __CFRunLoopDoTimer
#4 0x907dbec8 in __CFRunLoopRun
#5 0x907db47c in CFRunLoopRunSpecific
#6 0x931d8980 in RunCurrentEventLoopInMode
#7 0x931d8014 in ReceiveNextEventCommon
#8 0x931d7e80 in BlockUntilNextEventMatchingListInMode
#9 0x936dae84 in _DPSNextEvent
#10 0x936dab48 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#11 0x936d708c in -[NSApplication run]
#12 0x937c7bfc in NSApplicationMain
#13 0x00003b84 in main at main.m:12
via the debugger the new thread selector is workLoop with a target of
ABMetaDataController
if i close my initially created untitled document or the document
that was opened at app launch after this thread has been detached,
everything works fine. also, if i comment out the above 2 lines of
code (the thread is not created) and close a document immediately
after launch, everything still works fine. however, if i leave in the
above 2 lines and then close a document immediately after launch (ie,
before the above thread is detached) i get the following exception
stack trace and message on the console window:
#0 0x929303d4 in +[NSThread detachNewThreadSelector:toTarget:withObject:]
#1 0x94cb8614 in -[ABMetaDataController validateMetaDataIfNeeded]
#2 0x9293cbf8 in __NSFireDelayedPerform
#3 0x907ef550 in __CFRunLoopDoTimer
#4 0x907dbec8 in __CFRunLoopRun
#5 0x907db47c in CFRunLoopRunSpecific
#6 0x931d8980 in RunCurrentEventLoopInMode
#7 0x931d8014 in ReceiveNextEventCommon
#8 0x931d7e80 in BlockUntilNextEventMatchingListInMode
#9 0x936dae84 in _DPSNextEvent
#10 0x936dab48 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#11 0x936d708c in -[NSApplication run]
#12 0x937c7bfc in NSApplicationMain
#13 0x00003b84 in main at main.m:12
2006-06-11 15:01:28.841 Accounts[7841] Exception raised during
posting of notification. Ignored. exception: *** -[_NSZombie
forward::] not overridden!
this aberrant behavior seems to be 100% repeatable. i do believe that
i am carefully obeying the cocoa memory contract, and if you'll not
in both stack traces, not of my code or objects are involved.
can anyone shed any light on this?
or can anyone suggest a workaround? i do not believe that waiting for
the NSWillBecomeMultiThreadedNotification is a reasonable workaround
for 2 reasons:
1) it seems it would be a bad user experience to prevent closing a
document until this thread has been launched. and
2) depending on which windows were opened when the user launches my
app, the first new thread created could be the ui heartbeat thread
and not this offending thread.
help please??? :-)
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden