Re: ZeroLink causing odd errors
Re: ZeroLink causing odd errors
- Subject: Re: ZeroLink causing odd errors
- From: David Dunham <email@hidden>
- Date: Sat, 10 Sep 2005 10:10:37 -0700
At 23:54 -0700 05-09-09, Chris Espinosa wrote:
I'm struggling with converting a perfectly good CodeWarrior app to
Xcode. It'd be nice to debug it. However, the standard debug
configuration includes ZeroLink. I don't know for sure that this is
the cause of the problem, but I'm getting a crash in a C++ static
constructor only in my debug build, so I suspect ZeroLink.
ZeroLink shifts fatal link errors to run time from build time. It
works best if you don't have any fatal link errors.
I built a release build first, so I don't think this is the problem.
BTW, did you know that turning off ZeroLink won't link? Oh I see, the
target had ZeroLink on as well as the project.
With that said, getting a C++ static constructor in your debug build
only doesn't seem like a ZeroLink issue (especially if it links and
runs in your Release build).
What's the crash?
The debugger outputs
Program received signal: "EXC_BAD_ACCESS".
Previous frame inner to this frame (corrupt stack?)
Previous frame inner to this frame (corrupt stack?)
with a stack trace of
#0 0x90b25c58 in MPCreateCriticalRegion
#1 0x000fba18 in InitializeCriticalSection at MacThreading.cpp:77
#2 0x000fba98 in EnterCriticalSection at MacThreading.cpp:66
#3 0x0044e058 in ??
#4 0x0044eb48 in ??
#5 0x0043874c in util::Hashtable::put at Hashtable.cpp:241
#6 0x00438960 in util::Hashtable::put at Hashtable.cpp:268
#7 0x0056c77c in lang::Class::Class at Class.h:49
#8 0x0056ddd8 in
sprite::AnimateSprite::AnimateSpriteClass::AnimateSpriteClass at
AnimateSprite.h:36
#9 0x0056b868 in __static_initialization_and_destruction_0 at
AnimateSprite.cpp:44
#10 0x0056b908 in global constructors keyed to
_ZN6sprite13AnimateSprite12forceIncludeEv at AnimateSprite.cpp:764
#11 0x8fe16584 in
__dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
#12 0x8fe0b6f0 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE
#13 0x8fe0f378 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#14 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#15 0x8fe08c48 in __dyld_NSLinkModule
#16 0x9002dbb8 in NSLinkModule
#17 0x968d9cb8 in findSymbolInSet
#18 0x968d9d3c in undefinedHandler
#19 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#20 0x8fe113ec in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#21 0x8fe15a38 in
__dyld__ZN16ImageLoaderMachO25doBindExternalRelocationsERKN11ImageLoader11LinkContextEb
#22 0x8fe15d80 in
__dyld__ZN16ImageLoaderMachO6doBindERKN11ImageLoader11LinkContextENS0_15BindingLazinessE
#23 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#24 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#25 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#26 0x8fe08c48 in __dyld_NSLinkModule
#27 0x9002dbb8 in NSLinkModule
#28 0x968d9cb8 in findSymbolInSet
#29 0x968d9d3c in undefinedHandler
#30 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#31 0x8fe113ec in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#32 0x8fe11f48 in
__dyld__ZN16ImageLoaderMachO28doBindIndirectSymbolPointersERKN11ImageLoader11LinkContextENS0_15BindingLazinessEb
#33 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#34 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#35 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#36 0x8fe08c48 in __dyld_NSLinkModule
#37 0x9002dbb8 in NSLinkModule
#38 0x968d9cb8 in findSymbolInSet
#39 0x968d9d3c in undefinedHandler
#40 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#41 0x8fe116dc in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#42 0x8fe11f48 in
__dyld__ZN16ImageLoaderMachO28doBindIndirectSymbolPointersERKN11ImageLoader11LinkContextENS0_15BindingLazinessEb
#43 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#44 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#45 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#46 0x8fe08c48 in __dyld_NSLinkModule
#47 0x9002dbb8 in NSLinkModule
#48 0x968d9cb8 in findSymbolInSet
#49 0x968d9d3c in undefinedHandler
#50 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#51 0x8fe113ec in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#52 0x8fe15a38 in
__dyld__ZN16ImageLoaderMachO25doBindExternalRelocationsERKN11ImageLoader11LinkContextEb
#53 0x8fe15d80 in
__dyld__ZN16ImageLoaderMachO6doBindERKN11ImageLoader11LinkContextENS0_15BindingLazinessE
#54 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#55 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#56 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#57 0x8fe08c48 in __dyld_NSLinkModule
#58 0x9002dbb8 in NSLinkModule
#59 0x968d9cb8 in findSymbolInSet
#60 0x968d9d3c in undefinedHandler
#61 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#62 0x8fe113ec in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#63 0x8fe15a38 in
__dyld__ZN16ImageLoaderMachO25doBindExternalRelocationsERKN11ImageLoader11LinkContextEb
#64 0x8fe15d80 in
__dyld__ZN16ImageLoaderMachO6doBindERKN11ImageLoader11LinkContextENS0_15BindingLazinessE
#65 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#66 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#67 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#68 0x8fe08c48 in __dyld_NSLinkModule
#69 0x9002dbb8 in NSLinkModule
#70 0x968d9cb8 in findSymbolInSet
#71 0x968d9d3c in undefinedHandler
#72 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#73 0x8fe116dc in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#74 0x8fe11f48 in
__dyld__ZN16ImageLoaderMachO28doBindIndirectSymbolPointersERKN11ImageLoader11LinkContextENS0_15BindingLazinessEb
#75 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#76 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#77 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#78 0x8fe08c48 in __dyld_NSLinkModule
#79 0x9002dbb8 in NSLinkModule
#80 0x968d9cb8 in findSymbolInSet
#81 0x968d9d3c in undefinedHandler
#82 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#83 0x8fe113ec in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#84 0x8fe15a38 in
__dyld__ZN16ImageLoaderMachO25doBindExternalRelocationsERKN11ImageLoader11LinkContextEb
#85 0x8fe15d80 in
__dyld__ZN16ImageLoaderMachO6doBindERKN11ImageLoader11LinkContextENS0_15BindingLazinessE
#86 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#87 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#88 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#89 0x8fe08c48 in __dyld_NSLinkModule
#90 0x9002dbb8 in NSLinkModule
#91 0x968d9cb8 in findSymbolInSet
#92 0x968d9d3c in undefinedHandler
#93 0x8fe03e0c in
__dyld__ZN4dyld18findExportedSymbolEPKcbPPKN11ImageLoader6SymbolEPPS2_
#94 0x8fe113ec in
__dyld__ZN16ImageLoaderMachO16resolveUndefinedERKN11ImageLoader11LinkContextEPK11macho_nlistbPPS0_
#95 0x8fe15a38 in
__dyld__ZN16ImageLoaderMachO25doBindExternalRelocationsERKN11ImageLoader11LinkContextEb
#96 0x8fe15d80 in
__dyld__ZN16ImageLoaderMachO6doBindERKN11ImageLoader11LinkContextENS0_15BindingLazinessE
#97 0x8fe0ac34 in
__dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextENS_15BindingLazinessE
#98 0x8fe0f154 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
#99 0x8fe044d4 in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
#100 0x8fe08c48 in __dyld_NSLinkModule
#101 0x9002dbb8 in NSLinkModule
#102 0x968da424 in runInitializers
#103 0x968d9bbc in __zero_link_init_app
#104 0x0000299c in __darwin_gcc3_preregister_frame_info
#105 0x000021d0 in start
#106 (null)
When I turn off ZeroLink, I get the same crash I do in a release
build (in one of my threads, long after main starts -- not the same
one as above).
I will concede that crashing in an MPCreateCriticalRegion call in a
static constructor might actually be my bug, in that I haven't yet
called MPLibraryIsLoaded(). However, the same code works fine when
compiled with CodeWarrior, and doesn't crash if I don't use ZeroLink.
--
David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
Efficiency is intelligent laziness.
_______________________________________________
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