Known Problems w/ ZeroLink and multi-threading (race condition on symbol lookup)?
Known Problems w/ ZeroLink and multi-threading (race condition on symbol lookup)?
- Subject: Known Problems w/ ZeroLink and multi-threading (race condition on symbol lookup)?
- From: Daniel Vollmer <email@hidden>
- Date: Thu, 30 Nov 2006 22:31:53 +0100
Hi all,
I'm having a bit of trouble diagnosing a problem in some multi-
threaded code of mine, where an [[SomeObject] alloc] init] call
returns nil, which is impossible in this case (unless NSObject's init
fails, which it doesn't here).
I spawn a few threads (in this particular case 3) using NSThread,
which all run through the same code path. At some point in these
threads, I create a new object with the following:
(1) SICompressedChannel *channel = [[SICompressedChannel alloc]
initWithWaveletChannel:chan];
where [SICompressedChannel iniWithWaveletChannel] looks as follows
(SICompressedChannel is derived from NSObject):
- (id)initWithWaveletChannel:(t_wv_channel *)aChannel
{
self = [super init];
if (self)
{
NSLog(@"init: %@", self);
channel = aChannel;
indexInFile = -1;
}
return self;
}
Unfortunately, the statement in (1) results in nil. Breaking on this
and looking at the stack of one of the other threads made me think of
ZeroLink
Thread-3:
#0 0x8fe10e34 in
__dyld__ZN16ImageLoaderMachO8doRebaseERKN11ImageLoader11LinkContextE
#1 0x8fe0a59b in
__dyld__ZN11ImageLoader15recursiveRebaseERKNS_11LinkContextE
#2 0x8fe0caca in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_
18InitializerRunningEj
#3 0x8fe03982 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18Initializ
erRunningE
#4 0x8fe08721 in __dyld_NSLinkModule
#5 0x90025335 in NSLinkModule
#6 0x9608820c in findSymbolAnywhere
#7 0x96088a4f in undefinedClassHandler
#8 0x90a55b73 in look_up_class
#9 0x00060b30 in -[SIWorkUnit process] at SIWorkUnit.m:105
#10 0x00058ac2 in -[SIWorkThread doAllTheWork:] at SIWorkThread.m:64
#11 0x925f736c in forkThreadForFunction
#12 0x90023d87 in _pthread_body
The statement in #9 is exactly the line shown in (1) which returns
nil in the other thread. So maybe the function call fails in one
thread while the symbol is being looked up in the other...
This problem only occurs very occasionally (on my MacPro), but is
this a known problem? Or is it something else altogether?
Thanks,
Daniel.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden