Archive build is crashing on launch - macos

Can anybody help me out, I'm getting error on app launch with archive build. Debug build is working fine.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xffffffffffffffe8
VM Regions Near 0xffffffffffffffe8:
--> shared memory 00007fffffe36000-00007fffffe37000 [ 4K] r-x/r-x SM=SHM
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libc++.1.dylib 0x00007fff8fb6c4f1 std::__1::basic_istream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_istream<char, std::__1::char_traits<char> >&, bool) + 29
1 libc++.1.dylib 0x00007fff8fb6e437 std::__1::basic_istream<char, std::__1::char_traits<char> >::tellg() + 191
2 ??? 0x000000010d0b44ee 0 + 4513809646
3 ??? 0x000000010d0b35d8 0 + 4513805784
4 ??? 0x000000010d1213cd 0 + 4514255821
5 ??? 0x000000010d18e5c7 0 + 4514702791
6 ??? 0x000000010d159251 0 + 4514484817
7 ??? 0x000000010d18df0a 0 + 4514701066
8 ??? 0x000000010d144b1a 0 + 4514401050
9 ??? 0x000000010d0b121a 0 + 4513796634
10 ??? 0x000000010d0b66b1 0 + 4513818289
11 dyld 0x00007fff659f1d0b ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 265
12 dyld 0x00007fff659f1e98 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
13 dyld 0x00007fff659ee891 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 305
14 dyld 0x00007fff659ee718 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 138
15 dyld 0x00007fff659ee989 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 75
16 dyld 0x00007fff659e1245 dyld::initializeMainExecutable() + 187
17 dyld 0x00007fff659e4c19 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2669
18 dyld 0x00007fff659e0276 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 512
19 dyld 0x00007fff659e0036 _dyld_start + 54

This was due to library image not loaded in release build. I didn't added library in 'Linked Binary With Libraries'.

Related

LLDB crashes whenever Breakpoints are added

I have a project in Xcode 10.1 which contains both Objective C and Swift code.Whenever I apply breakpoints in my swift code the LLDB crashes, which eventually end the debugging session.I am completely stuck in this scenario as I cannot debug my code.I have tried moving the breakpoints to other lines(suggested by some other posts), but its not working.
Is there any workaround on this?
Message from debugger: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'.
Crash summary:
Thread 11 Crashed:: RPC packet thread for client tid 0028defc (2678524)
0 libsystem_kernel.dylib 0x00007fff6d6a223e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff6d758c1c pthread_kill + 285
2 libsystem_c.dylib 0x00007fff6d60b1c9 abort + 127
3 com.apple.LLDB.framework 0x0000000106bd2443 swift::ModuleFile::fatal(llvm::Error) + 835
4 com.apple.LLDB.framework 0x0000000106be3753 swift::ModuleFile::getDeclCheckedImpl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 30515
5 com.apple.LLDB.framework 0x0000000106bd321e swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 78
6 com.apple.LLDB.framework 0x0000000106c0a707 swift::ModuleFile::loadExtensions(swift::NominalTypeDecl*) + 1911
7 com.apple.LLDB.framework 0x0000000106c13011 swift::SerializedModuleLoader::loadExtensions(swift::NominalTypeDecl*, unsigned int) + 49
8 com.apple.LLDB.framework 0x00000001062246bf swift::ASTContext::loadExtensions(swift::NominalTypeDecl*, unsigned int) + 63
9 com.apple.LLDB.framework 0x00000001062a6272 swift::NominalTypeDecl::getExtensions() + 82
10 com.apple.LLDB.framework 0x000000010631681e populateLookupTableEntryFromExtensions(swift::ASTContext&, swift::MemberLookupTable&, swift::NominalTypeDecl*, swift::DeclName, bool) + 46
11 com.apple.LLDB.framework 0x0000000106316e98 swift::NominalTypeDecl::lookupDirect(swift::DeclName, bool) + 616
12 com.apple.LLDB.framework 0x0000000106301a66 swift::ModuleDecl::lookupMember(llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::DeclContext*, swift::DeclName, swift::Identifier) const + 86
13 com.apple.LLDB.framework 0x000000010643e5a1 FindNamedDecls(swift::ASTContext*, swift::DeclBaseName const&, VisitNodeResult&, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >) + 1313
14 com.apple.LLDB.framework 0x0000000106437cdf VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 2703
15 com.apple.LLDB.framework 0x0000000106439e25 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 11221
16 com.apple.LLDB.framework 0x000000010643d94c swift::ide::getTypeFromMangledSymbolname(swift::ASTContext&, llvm::StringRef, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 204
17 com.apple.LLDB.framework 0x000000010705e2e7 lldb_private::SwiftASTContext::GetTypeFromMangledTypename(char const*, lldb_private::Status&) + 535
18 com.apple.LLDB.framework 0x0000000106db6241 DWARFASTParserSwift::ParseTypeFromDWARF(lldb_private::SymbolContext const&, DWARFDIE const&, lldb_private::Log*, bool*) + 933
19 com.apple.LLDB.framework 0x0000000106ee6a15 SymbolFileDWARF::ParseType(lldb_private::SymbolContext const&, DWARFDIE const&, bool*) + 209
20 com.apple.LLDB.framework 0x0000000106ee01fa SymbolFileDWARF::GetTypeForDIE(DWARFDIE const&, bool) + 486
21 com.apple.LLDB.framework 0x0000000106edf9ce SymbolFileDWARF::ResolveType(DWARFDIE const&, bool, bool) + 68
22 com.apple.LLDB.framework 0x0000000106edf94d SymbolFileDWARF::ResolveTypeUID(unsigned long long) + 45
23 com.apple.LLDB.framework 0x0000000106f2e87d lldb_private::Function::GetType() + 105
24 com.apple.LLDB.framework 0x0000000106f2e73c lldb_private::Function::GetStartLineSourceInfo(lldb_private::FileSpec&, unsigned int&) + 60
25 com.apple.LLDB.framework 0x0000000106c6c488 lldb_private::BreakpointResolverFileLine::FilterContexts(lldb_private::SymbolContextList&) + 262
26 com.apple.LLDB.framework 0x0000000106c6c88d lldb_private::BreakpointResolverFileLine::SearchCallback(lldb_private::SearchFilter&, lldb_private::SymbolContext&, lldb_private::Address*, bool) + 263
27 com.apple.LLDB.framework 0x0000000106d51f80 lldb_private::SearchFilter::DoModuleIteration(lldb_private::SymbolContext const&, lldb_private::Searcher&) + 346
28 com.apple.LLDB.framework 0x0000000106d51dd9 lldb_private::SearchFilter::Search(lldb_private::Searcher&) + 153
29 com.apple.LLDB.framework 0x0000000106f96b9f lldb_private::Target::AddBreakpoint(std::__1::shared_ptr<lldb_private::Breakpoint>, bool) + 203
30 com.apple.LLDB.framework 0x0000000106f97f29 lldb_private::Target::CreateBreakpoint(std::__1::shared_ptr<lldb_private::SearchFilter>&, std::__1::shared_ptr<lldb_private::BreakpointResolver>&, bool, bool, bool) + 249
31 com.apple.LLDB.framework 0x0000000106f98352 lldb_private::Target::CreateBreakpoint(lldb_private::FileSpecList const*, lldb_private::FileSpec const&, unsigned int, unsigned long long, lldb_private::LazyBool, lldb_private::LazyBool, bool, bool, lldb_private::LazyBool) + 920
32 com.apple.LLDB.framework 0x0000000103dda3d8 lldb::SBTarget::BreakpointCreateByLocation(lldb::SBFileSpec const&, unsigned int, unsigned long long, lldb::SBFileSpecList&) + 246
33 com.apple.LLDB.framework 0x0000000103dda2b0 lldb::SBTarget::BreakpointCreateByLocation(lldb::SBFileSpec const&, unsigned int, unsigned long long) + 62
34 com.apple.LLDB.framework 0x0000000103dda226 lldb::SBTarget::BreakpointCreateByLocation(char const*, unsigned int) + 64
35 lldb-rpc-server 0x0000000103af6f5d rpc_server::_ZN4lldb8SBTarget26BreakpointCreateByLocationEPKcj::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 179
36 lldb-rpc-server 0x0000000103b0073f rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 469
37 lldb-rpc-server 0x0000000103b014e0 rpc_common::Connection::HandleRPCPacket(rpc_common::RPCPacket&) + 62
38 lldb-rpc-server 0x0000000103b04f12 Packets::ProcessPackets() + 256
39 lldb-rpc-server 0x0000000103b04d95 Packets::ReadThread() + 289
40 lldb-rpc-server 0x0000000103b04c6f Packets::RunReadThread(void*) + 9
41 libsystem_pthread.dylib 0x00007fff6d756305 _pthread_body + 126
42 libsystem_pthread.dylib 0x00007fff6d75926f _pthread_start + 70
43 libsystem_pthread.dylib 0x00007fff6d755415 thread_start + 13
Thread 11 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000700010856000 rcx: 0x00007000108534f8 rdx: 0x0000000000000000
rdi: 0x0000000000003e0b rsi: 0x0000000000000006 rbp: 0x0000700010853530 rsp: 0x00007000108534f8
r8: 0x000000000000000b r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000206
r12: 0x0000000000003e0b r13: 0x0000000107fd4d70 r14: 0x0000000000000006 r15: 0x000000000000002d
rip: 0x00007fff6d6a223e rfl: 0x0000000000000206 cr2: 0x00007fffa0349188
Complete crash log
The crash is happening in swift code, Objective C code is working fine. Also, it is not occasional, it is happening every time.
I have also tried clearing all Xcode caches and derived data.
I meet the same situation, hopes my solution helps you.
The reason of my Xcode LLDB crashing while adding breakpoints is that my project name (Security) is same to Apple's framework.
After switch project name to another random name, the problem solved.

Crash in protobuf after upgrading to Mojave

After upgrading to Mojave the application started to crash in XCode debugger. It does run normally as a standalone application.
The backtrace looks like the following:
frames 0-5 call for the custom new, which is not initialized, the app initializes custom memory allocator in main
frame #6: 0x00007fff53ee006f libprotobuf.dylib`wireless_diagnostics::google::protobuf::(anonymous namespace)::InitGeneratedPool() + 20
frame #7: 0x00007fff53ecdd47 libprotobuf-lite.dylib`wireless_diagnostics::google::protobuf::internal::FunctionClosure0::Run() + 17
frame #8: 0x00007fff53ecdd1b libprotobuf-lite.dylib`wireless_diagnostics::google::protobuf::GoogleOnceInitImpl(long*, wireless_diagnostics::google::protobuf::Closure*) + 73
frame #9: 0x00007fff53edffbe libprotobuf.dylib`wireless_diagnostics::google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) + 78
frame #10: 0x00007fff53edfbf9 libprotobuf.dylib`wireless_diagnostics::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() + 68
frame #11: 0x0000000117de8cc8 dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 518
frame #12: 0x0000000117de8ec6 dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
frame #13: 0x0000000117de40da dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 358
frame #14: 0x0000000117de406d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249
frame #15: 0x0000000117de406d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249
frame #16: 0x0000000117de406d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249
frame #17: 0x0000000117de406d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249
frame #18: 0x0000000117de406d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249
frame #19: 0x0000000117de3254 dyld`ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 134
frame #20: 0x0000000117de32e8 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 74
frame #21: 0x0000000117dd2756 dyld`dyld::initializeMainExecutable() + 169
frame #22: 0x0000000117dd778f dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 6237
frame #23: 0x0000000117dd14f6 dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 1154
frame #24: 0x0000000117dd1036 dyld`_dyld_start + 54
Xcode injects the dynamic library libViewDebuggerSupport.dylib, which causes the crash. And problematic *.dylib is
/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/Versions/A/Libraries/libprotobuf.dylib
Fixing the custom allocator is the one of the options, but I want to avoid doing it.
Do you know any way to prevent XCode from injecting libViewDebuggerSupport.dylib?
It is appeared to be a bug in Mojave. Apple is working on fixing it, but they did not give me any ETA.
For now I fixed the crash by fixing my custom allocator.

app signed on sierra crashed on el capitan

I have an application built with Xcode , all third party frameworks and dylib-s are code signed separtly , Application works fine on os x sierra ( tested in different devices) but crashed on os x El Capitan with
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
( and again tested on several devices).
here is the stack trace on crash on El Capitan
Process: BeSafe [671] Path:
/Applications/BeSafe.app/Contents/MacOS/BeSafe Identifier:
com.onecryptor.besafe Version: 0.2.6.0 (0.2.6.0) Code
Type: X86-64 (Native) Parent Process: ??? [1]
Responsible: BeSafe [671] User ID: 501
Date/Time: 2017-05-22 14:12:38.209 +0400 OS Version:
Mac OS X 10.11 (15A284) Report Version: 11 Anonymous UUID:
48F622B8-8E74-B38C-B200-580A63C6EFA7
Time Awake Since Boot: 1400 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x0000000107462000
Exception Note: EXC_CORPSE_NOTIFY
kernel messages:
-0 sec CODE SIGNING: cs_invalid_page(0x107462000): p=671[BeSafe] final status 0x3004200, denying page sending SIGKILL
-0 sec CODE SIGNING: process 671[BeSafe]: rejecting invalid page at address 0x107462000 from offset 0x0 in file
"/Applications/BeSafe.app/Contents/Frameworks/libboost_date_time-mt.dylib"
(cs_mtime:1495447699.0 == mtime:1495447699.0) (signed:1 validated:1
tainted:1 wpmapped:0 slid:0)
VM Regions Near 0x107462000:
__LINKEDIT 00000001073b3000-0000000107462000 [ 700K] r--/rwx SM=COW /Applications/BeSafe.app/Contents/MacOS/BeSafe
--> mapped file 0000000107462000-0000000107463000 [ 4K] r-x/r-x SM=PRV 1
VM_ALLOCATE 0000000107463000-0000000107464000 [ 4K] rw-/rwx SM=ALI
Application Specific Information: dyld: launch, loading dependent
libraries #executable_path/../Frameworks/libboost_date_time-mt.dylib
Thread 0 Crashed: 0 dyld
0x00007fff66b70a10 memcmp + 208 1 dyld
0x00007fff66b5d905
ImageLoaderMachO::validateFirstPages(linkedit_data_command const*,
int, unsigned char const*, unsigned long, long long,
ImageLoader::LinkContext const&) + 145 2 dyld
0x00007fff66b62b7b
ImageLoaderMachOCompressed::instantiateFromFile(char const*, int,
unsigned char const*, unsigned long, unsigned long long, unsigned long
long, stat const&, unsigned int, unsigned int, linkedit_data_command
const*, encryption_info_command const*, ImageLoader::LinkContext
const&) + 283 3 dyld 0x00007fff66b5ca6f
ImageLoaderMachO::instantiateFromFile(char const*, int, unsigned char
const*, unsigned long long, unsigned long long, stat const&,
ImageLoader::LinkContext const&) + 299 4 dyld
0x00007fff66b4f8c3 dyld::loadPhase6(int, stat const&, char const*,
dyld::LoadContext const&) + 402 5 dyld
0x00007fff66b54469 dyld::loadPhase5(char const*, char const*,
dyld::LoadContext const&, std::__1::vector >) + 710 6 dyld
0x00007fff66b54189 dyld::loadPhase4(char const, char const*,
dyld::LoadContext const&, std::__1::vector >) + 180 7 dyld
0x00007fff66b53c9f dyld::loadPhase3(char const, char const*,
dyld::LoadContext const&, std::__1::vector >) + 1019 8 dyld
0x00007fff66b53643 dyld::loadPhase1(char const, char const*,
dyld::LoadContext const&, std::__1::vector >) + 135 9 dyld
0x00007fff66b4f47b dyld::loadPhase0(char const, char const*,
dyld::LoadContext const&, std::__1::vector >) + 213 10 dyld
0x00007fff66b4f15f dyld::load(char const, dyld::LoadContext const&)
+ 180 11 dyld 0x00007fff66b54706 dyld::libraryLocator(char const*, bool, char const*,
ImageLoader::RPathChain const*) + 52 12 dyld
0x00007fff66b5a85e
ImageLoader::recursiveLoadLibraries(ImageLoader::LinkContext const&,
bool, ImageLoader::RPathChain const&) + 384 13 dyld
0x00007fff66b5a564 ImageLoader::link(ImageLoader::LinkContext const&,
bool, bool, bool, ImageLoader::RPathChain const&) + 80 14 dyld
0x00007fff66b50a12 dyld::link(ImageLoader*, bool, bool,
ImageLoader::RPathChain const&) + 149 15 dyld
0x00007fff66b51b97 dyld::_main(macho_header const*, unsigned long,
int, char const**, char const**, char const**, unsigned long*) + 3083
16 dyld 0x00007fff66b4d276
dyldbootstrap::start(macho_header const*, int, char const**, long,
macho_header const*, unsigned long*) + 512 17 dyld
0x00007fff66b4d036 _dyld_start + 54
Thread 0 crashed with X86 Thread State (64-bit): rax:
0x0000000000000000 rbx: 0x0000000107462000 rcx: 0x0000000000000000
rdx: 0x0000000000000768 rdi: 0x0000000107462000 rsi:
0x00007fff58bb6ad0 rbp: 0x00007fff58bb5d90 rsp: 0x00007fff58bb5d90
r8: 0x0000000000000003 r9: 0x0000000000000000 r10:
0x0000000000000001 r11: 0x0000000000000202 r12: 0x0000000000000000
r13: 0x0000000000000003 r14: 0x0000000000000768 r15:
0x00007fff66b8cce8 rip: 0x00007fff66b70a10 rfl: 0x0000000000010246
cr2: 0x0000000107462000 Logical CPU: 3 Error Code:
0x00000004 Trap Number: 14
Binary Images:
0x107046000 - 0x107375ffb +com.onecryptor.besafe (0.2.6.0 - 0.2.6.0) <880A6212-7110-317E-B4FA-1CF533E79AE5>
/Applications/BeSafe.app/Contents/MacOS/BeSafe
0x107465000 - 0x1074a1ff7 +org.sparkle-project.Sparkle (1.14.0 - 1.14.0) <85A19559-55A6-3BA3-AC85-543D647D8F30>
/Applications/BeSafe.app/Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle
0x7fff66b4c000 - 0x7fff66b82f5f dyld (360.14) /usr/lib/dyld
External Modification Summary: Calls made by other processes
targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0 Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0 Calls made by all processes on this machine:
task_for_pid: 683
thread_create: 0
thread_set_state: 0
VM Region Summary: ReadOnly portion of Libraries: Total=4696K
resident=0K(0%) swapped_out_or_unallocated=4696K(100%) Writable
regions: Total=10.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%)
unallocated=10.2M(100%)
VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= ======= Process Corpse Info 2048K 2 STACK GUARD 56.0M 2
Stack 8192K 2 VM_ALLOCATE
4K 2
__DATA 536K 6
__LINKEDIT 968K 4
__TEXT 3728K 4 mapped file 4K 2 shared memory 8K 3
=========== ======= ======= TOTAL 71.1M 18
Model: iMac11,3, BootROM VirtualBox, 4 processors, 2.2 GHz, 2 GB, SMC
2.3f35 Graphics: Display, PCI, 3 MB Memory Module: Bank 0/DIMM 0, 2 GB, DRAM, 1600 MHz, innotek GmbH, - Network Service: Ethernet,
Ethernet, en0 Serial ATA Device: VBOX HARDDISK, 84.83 GB Serial ATA
Device: VBOX CD-ROM, 59.4 MB USB Device: USB Bus USB Device: USB
Tablet USB Device: USB Keyboard Thunderbolt Bus:

Patching a Mach-O binary with LC_LOAD_DYLIB requires reboot to work

I'm patching a Mach-O binary with a dylib (by appending a LC_LOAD_DYLIB command at the end of the load commands + adjusting the mach header's sizeofcmds + incrementing its ncmds) and I would expect to be able to compile over and over the dylib itself and just rerun the binary.
However, for some reason, when doing so, after the first run, the binary crashes for various reasons (e.g EXC_CRASH or EXC_BAD_ACCESS at different addresses)
If I restart the machine, everything works perfectly fine(the lib is patched and the exec runs). I bet this has to do with some obscure (for me at least) memory mapping or caching the dynamic linker does, but my expertise in that area is slim. Any chance you guys know something about it?
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fffd43d3829 map_images_nolock + 588
1 libobjc.A.dylib 0x00007fffd43d3521 map_2_images + 43
2 dyld 0x00000001164e5d4c dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) + 1124
3 dyld 0x00000001164e5f25 dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) + 50
4 libdyld.dylib 0x00007fffd4cbd584 _dyld_objc_notify_register + 77
5 libobjc.A.dylib 0x00007fffd43d3074 _objc_init + 115
6 libdispatch.dylib 0x00007fffd4c84c64 _os_object_init + 13
7 libdispatch.dylib 0x00007fffd4c84c13 libdispatch_init + 295
8 libSystem.B.dylib 0x00007fffd36f1a02 libSystem_initializer + 121
9 dyld 0x00000001164f6063 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 385
10 dyld 0x00000001164f6266 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
11 dyld 0x00000001164f1bf0 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 338
12 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
13 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
14 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
15 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
16 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
17 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
18 dyld 0x00000001164f1b87 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 233
19 dyld 0x00000001164f0c60 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 138
20 dyld 0x00000001164f0cf5 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 75
21 dyld 0x00000001164e32f6 dyld::initializeMainExecutable() + 195
22 dyld 0x00000001164e7459 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 3789
23 dyld 0x00000001164e2249 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 470
24 dyld 0x00000001164e2036 _dyld_start + 54

Xcode 5.02 crash on opening any xib - Yosemite

I am running Yosemite 10.10.4 on a Macbook Air. I have a number of Xcode projects that worked successfully under Xcode 6.4. However, I downloaded Xcode 5.02 from Apple in order to use the Big Nerd Ranch book "IOS Programming" which is written for Xcode 5. Any time I open a xib file, Xcode crashes. As suggested, I opened the console app,found the crash log, and copied it.
Process: Interface Builder Cocoa Touch Tool [1370]
Path: /Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/Interface Builder Cocoa Touch Tool
Identifier: Interface Builder Cocoa Touch Tool
Version: 4.3 (141)
Code Type: X86 (Native)
Parent Process: Xcode [1315]
Responsible: Xcode [1315]
User ID: 501
Date/Time: 2015-08-16 17:49:29.223 -0500
OS Version: Mac OS X 10.10.4 (14E46)
Report Version: 11
Anonymous UUID: EFE6107D-FC8B-4F16-13CF-5078BA3A872D
Sleep/Wake UUID: AC708070-A2AD-4BD3-97E0-72E185438011
Time Awake Since Boot: 2400 seconds
Time Since Wake: 1400 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x94ecb69a __pthread_kill + 10
1 libsystem_pthread.dylib 0x92192f19 pthread_kill + 101
2 libsystem_sim_c.dylib 0x02a78e12 abort + 127
3 libsystem_sim_c.dylib 0x02a43900 __assert_rtn + 284
4 libsystem_override.dylib 0x0297e73c _sim_host_bootstrap_init + 264
5 libsystem_override.dylib 0x0297e7aa _sim_host_bootstrap_port + 26
6 libxpc.dylib 0x02ba4b06 _libxpc_initializer + 870
7 libSystem.B.dylib 0x98a9daae libSystem_initializer + 167
8 dyld 0x8fe710b3 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 291
9 dyld 0x8fe71218 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 64
10 dyld 0x8fe6d2f0 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 296
11 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
12 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
13 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
14 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
15 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
16 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
17 dyld 0x8fe6d288 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
18 dyld 0x8fe6d176 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 120
19 dyld 0x8fe6d3e1 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 79
20 dyld 0x8fe5f125 dyld::initializeMainExecutable() + 183
21 dyld 0x8fe62bad dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2793
22 dyld 0x8fe5e232 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 428
23 dyld 0x8fe5e047 _dyld_start + 71
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x02980015 ecx: 0xbfffd5ac edx: 0x00000000
edi: 0xa08481d4 esi: 0x00000006 ebp: 0xbfffd5c8 esp: 0xbfffd5ac
ss: 0x00000023 efl: 0x00000206 eip: 0x94ecb69a cs: 0x0000000b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0x02a78d93
Logical CPU: 0
Error Code: 0x00080148
Trap Number: 132

Resources