使用SDL 2运行应用程序时,Xcode 5崩溃 [英] Xcode 5 crashes when running an app with SDL 2

查看:311
本文介绍了使用SDL 2运行应用程序时,Xcode 5崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按照这两个教程(或其中的适用部分,由于版本差异)安装SDL 2.0.2以使用Xcode 5.1:



教程1



教程2



使用SDL 2框架链接导致Xcode与以下问题细节崩溃:

 过程:Xcode 
路径: /Applications/Xcode.app/Contents/MacOS/Xcode
标识符:com.apple.dt.Xcode
版本:5.1(5084)
Build信息:IDEFrameworks-5084000000000000〜21
应用项目ID:497799835
应用外部ID:444172641
代码类型:X86-64(原生)
父进程:launchd [257]
负责:Xcode [1787]
用户ID:501

PlugIn路径:/Library/Frameworks/SDL2.framework/Versions/A/SDL2
PlugIn标识符:org.libsdl.SDL2
PlugIn版本:2.0.2(2.0.2)

日期/时间:2014-03-13 04:24:59.771 +0200
操作系统版本:Mac OS X 10.9.2(13C64)
报告版本:11
匿名UUID:EFECF2A0-A489-055E-0904-D3CD9E756EB0


崩溃主题:21< lldb.process.internal-state(pid = 1804)

异常类型:EXC_BAD_ACCESS(代码签名无效)
异常代码:0x0000000000000032,0x0000000124718000

VM区域附近0x124718000:
堆栈0000000124696000-0000000124718000 [520K ] rw- / rwx SM = COW thread 22
- >映射文件0000000124718000-00000001247fd000 [916K] r - / rwx SM = COW /Library/Frameworks/SDL2.framework/Versions/A/SDL2
CG共享映像00000001c0003000-00000001c000b000 [32K] r - / r-- SM = SHM

应用程序特定信息:
ProductBuildVersion:5B130a

线程0 ::分派队列:com.apple.main-线程
0 libsystem_kernel名为.dylib 0x00007fff8d1aca1a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8d1abd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3 com.apple.CoreFoundation 0x00007fff87ba7779 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5 com.apple.HIToolbox 0x00007fff8e776a0d RunCurrentEventLoopInMode + 226
6 com.apple.HIToolbox 0x00007fff8e7767b7 ReceiveNextEventCommon + 479
7 com.apple.HIToolbox 0x00007fff8e7765bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
8 com.apple.AppKit 0x00007fff8145a3de _DPSNextEvent + 1434
9 com.apple.AppKit 0x00007fff81459a2b - [NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
10 com.apple。 dt.DVTKit 0x00000001067a3e31 - [DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 84
11 com.apple.AppKit 0x00007fff8144db2c - [NSApplication run] + 553
12 com.apple.AppKit 0x00007fff81438913 NSApplicationMain + 940
13 libdyld.dylib 0x00007fff8dda55fd start + 1

线程1 ::分派队列:com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff8d1b1662 kevent64 + 10
1 libdispatch.dylib 0x00007fff88b8543d _dispatch_mgr_invoke + 239
2 libdispatch.dylib 0x00007fff88b85152 _dispatch_mgr_thread + 52

线程2:
0 libsystem_kernel.dylib 0x00007fff8d1b0e6a __workq_kernreturn + 10
1 libsystem_pthread。 dylib 0x00007fff8ddccf08 _pthread_wqthread + 330
2 libsystem_pthread.dylib 0x00007fff8ddcffb9 start_wqthread + 13

螺纹3:
0 libsystem_kernel.dylib 0x00007fff8d1b0e6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ddccf08 _pthread_wqthread + 330
2 libsystem_pthread.dylib 0x00007fff8ddcffb9 start_wqthread + 13

线程4 :: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x00007fff8d1aca1a mach_msg_trap + 10
1 libsystem_kernel。 dylib 0x00007fff8d1abd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3 com.apple.CoreFoundation 0x00007fff87ba7779 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5 com.apple.Foundation 0x00007fff87db8967 + [NSURLConnection(Loader)_resourceLoadLoop:] + 348
6 com.apple.Foundation 0x00007fff87db876b __NSThread__main__ + 1318
7 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
8 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
9 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程5:
0 libsystem_kernel.dylib 0x00007fff8d1aca1a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8d1abd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3 com.apple.CoreFoundation 0x00007fff87ba7779 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5 com.apple.DTDeviceKitBase 0x00000001109fb40e - [DTDKRemoteDeviceDataListener listenerThreadImplementation] + 162
6 com.apple.Foundation 0x00007fff87db876b __NSThread__main__ + 1318
7 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
8 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
9 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程6 :: com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x00007fff8d1b09aa __select + 10
1 com.apple.CoreFoundation 0x00007fff87bf3b83 __CFSocketManager + 867
2 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
3 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
4 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程7 :: DYMobileDeviceManager
0 libsystem_kernel.dylib 0x00007fff8d1aca1a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8d1abd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3 com.apple.CoreFoundation 0x00007fff87ba7779 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5 com.apple.Foundation 0x00007fff87dbaadc - [NSRunLoop(NSRunLoop)runMode:beforeDate:] + 253
6 com.apple.Foundation 0x00007fff87ea34aa - [NSRunLoop(NSRunLoop)run] + 74
7 com.apple.GPUToolsMobileFoundation 0x0000000112ab0e0d - [DYMobileDeviceManager _deviceNotificationThread:] + 134
8 com.apple.Foundation 0x00007fff87db876b __NSThread__main__ + 1318
9 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
10 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
11 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程8 :: CVDisplayLink
0 libsystem_kernel.dylib 0x00007fff8d1b0716 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ddcdc3b _pthread_cond_wait + 727
2 com.apple.CoreVideo 0x00007fff8d2d1a38 CVDisplayLink :: runIOThread()+ 656
3 com .apple.CoreVideo 0x00007fff8d2d178f startIOThread(无效*)+ 147
4 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
5 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
6 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程9:
0 libsystem_kernel.dylib 0x00007fff8d1b0e6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ddccf08 _pthread_wqthread + 330
2 libsystem_pthread.dylib 0x00007fff8ddcffb9 start_wqthread + 13

线程10:
0 libsystem_kernel.dylib 0x00007fff8d1b0e6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ddccf08 _pthread_wqthread + 330
2 libsystem_pthread.dylib 0x00007fff8ddcffb9 start_wqthread + 13

线程11:
0 libsystem_kernel.dylib 0x00007fff8d1aca1a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8d1abd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3 com.apple。的CoreFoundation 0x00007fff87ba7779 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5 com.apple.AppKit 0x00007fff815fa16e _NSEventThread + 144
6 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
7 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
8 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

导线12:
0 libsystem_kernel.dylib 0x00007fff8d1b0e6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ddccf08 _pthread_wqthread + 330
2 libsystem_pthread.dylib 0x00007fff8ddcffb9 start_wqthread + 13

导线13:
0 libsystem_kernel.dylib 0x00007fff8d1b0e6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ddccf08 _pthread_wqthread + 330
2 libsystem_pthread.dylib 0x00007fff8ddcffb9 start_wqthread + 13

线程14:
0 libsystem_kernel.dylib 0x00007fff8d1b0716 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ddcdc3b _pthread_cond_wait + 727
2 com.apple.Xcode.DevToolsCore 0x000000010c476363 - [XCBlockQueue _processBlocksInThreadSlotNumber:] + 524
3 com.apple.Foundation 0x00007fff87db876b __NSThread__main__ + 1318
4 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
5 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
6 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程15:
0 libsystem_kernel.dylib 0x00007fff8d1b0716 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ddcdc3b _pthread_cond_wait + 727
2 com.apple.Xcode.DevToolsCore 0x000000010c476363 - [XCBlockQueue _processBlocksInThreadSlotNumber:] + 524
3 com.apple.Foundation 0x00007fff87db876b __NSThread__main__ + 1318
4 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
5 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
6 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程16:
0 libsystem_kernel.dylib 0x00007fff8d1b0716 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ddcdc3b _pthread_cond_wait + 727
2 com.apple.Xcode.DevToolsCore 0x000000010c476363 - [XCBlockQueue _processBlocksInThreadSlotNumber:] + 524
3 com.apple.Foundation 0x00007fff87db876b __NSThread__main__ + 1318
4 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
5 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
6 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程17 ::< lldb.comm.debugger .input>
0 libsystem_kernel.dylib 0x00007fff8d1b09aa __select + 10
1 com.apple.LLDB.framework 0x0000000113d965f0 lldb_private :: ConnectionFileDescriptor :: BytesAvailable(unsigned int,lldb_private :: Error *)+ 888
2 com .apple.LLDB.framework 0x0000000113d96052 lldb_private :: ConnectionFileDescriptor :: Read(void *,unsigned long,unsigned int,lldb :: ConnectionStatus& lldb_private :: Error *)+ 170
3 com.apple.LLDB.framework 0x0000000113d94493 lldb_private :: Communication :: ReadFromConnection(void *,unsigned long,unsigned int,lldb :: ConnectionStatus& lldb_private :: Error *)+ 97
4 com.apple.LLDB.framework 0x0000000113d940f1 lldb_private :: Communication: :ReadThread(void *)+ 147
5 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
6 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
7 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

Thread 18 ::< lldb.comm.xcode.lldb.comm>
0 libsystem_kernel.dylib 0x00007fff8d1b09aa __select + 10
1 com.apple.LLDB.framework 0x0000000113d965f0 lldb_private :: ConnectionFileDescriptor :: BytesAvailable(unsigned int,lldb_private :: Error *)+ 888
2 com .apple.LLDB.framework 0x0000000113d96052 lldb_private :: ConnectionFileDescriptor :: Read(void *,unsigned long,unsigned int,lldb :: ConnectionStatus& lldb_private :: Error *)+ 170
3 com.apple.LLDB.framework 0x0000000113d94493 lldb_private :: Communication :: ReadFromConnection(void *,unsigned long,unsigned int,lldb :: ConnectionStatus& lldb_private :: Error *)+ 97
4 com.apple.LLDB.framework 0x0000000113d940f1 lldb_private :: Communication: :ReadThread(void *)+ 147
5 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
6 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
7 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程19:
0 libsystem_kernel.dylib 0x00007fff8d1aca1a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8d1abd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3 com。 apple.CoreFoundation 0x00007fff87ba7779 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5 com.apple.CoreFoundation 0x00007fff87c5c811 CFRunLoopRun + 97
6 com.apple.DebugSymbols 0x00007fff834007e3 SpotlightQueryThread(无效* )+ 355
7 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
8 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
9 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程20: :< lldb.process.gdb-remote.async>
0 libsystem_kernel.dylib 0x00007fff8d1b0716 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ddcdc3b _pthread_cond_wait + 727
2 com.apple.LLDB.framework 0x0000000113e37697 lldb_private :: Condition :: Wait(lldb_private :: Mutex& ,lldb_private :: TimeValue const *,bool *)+ 109
3 com.apple.LLDB.framework 0x0000000113e81752 lldb_private :: Predicate< bool> :: WaitForValueEqualTo(bool,lldb_private :: TimeValue const *,bool *)+ 90
4 com.apple.LLDB.framework 0x0000000113dadcb4 lldb_private :: Listener :: WaitForEventsInternal(lldb_private :: TimeValue const *,lldb_private :: Broadcaster *,lldb_private :: ConstString const *,unsigned int,unsigned int,std: :__ 1 :: shared_ptr< lldb_private :: Event>&)+ 324
5 com.apple.LLDB.framework 0x0000000113daddcb lldb_private :: Listener :: WaitForEvent(lldb_private :: TimeValue const *,std :: _ shared_ptr< lldb_private :: Event>&)+ 27
6 com.apple.LLDB.framework 0x0000000113e8bb51 ProcessGDBRemote :: AsyncThread(void *)+ 1213
7 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
8 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
9 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程21崩溃::< lldb.process.internal-state(pid = 1804)>
0 com.apple.LLDB.framework 0x0000000113d98990 lldb_private :: DataExtractor :: GetU32(unsigned long long *)const + 52
1 com.apple.LLDB.framework 0x0000000113e73045 ObjectFileMachO :: ParseHeader()+ 91
2 com.apple.LLDB.framework 0x0000000113e724fd ObjectFileMachO :: CreateInstance(std :: __ 1 :: shared_ptr< lldb_private :: Module> const& std :: __ 1 :: shared_ptr< lldb_private :: DataBuffer& unsigned long long,lldb_private :: FileSpec const *,unsigned long long,unsigned long long)+ 661
3 com.apple.LLDB.framework 0x0000000113ee9ac5 lldb_private :: ObjectFile :: FindPlugin(std :: __ 1 :: shared_ptr< lldb_private :: Module> const& lldb_private :: FileSpec const *,unsigned long long,unsigned long long,std :: __ 1 :: shared_ptr 4 com.apple.LLDB.framework 0x0000000113e6bf43 ObjectContainerUniversalMachO :: GetObjectFile(lldb_private :: FileSpec const *)+ 427
5 com.apple.LLDB.framework 0x0000000113ee9bd7 lldb_private :: ObjectFile :: FindPlugin(std :: __ 1 :: shared_ptr< lldb_private :: Module> const& lldb_private :: FileSpec const *,unsigned long long,unsigned long long,std :: __ 1 :: shared_ptr 6 com.apple。 LLDB.framework 0x0000000113ddafbc lldb_private :: Module :: GetObjectFile()+ 210
7 com.apple.LLDB.framework 0x0000000113dde60f lldb_private :: ModuleList :: GetSharedModule(lldb_private :: ModuleSpec const& std :: __ 1 :: shared_ptr< ; lldb_private :: Module>& lldb_private :: FileSpecList const *,std :: __ 1 :: shared_ptr< lldb_private :: Module> *,bool *,bool)+ 805
8 com.apple.LLDB.framework 0x0000000113f274d9 lldb_private ::目标:: GetSharedModule(lldb_private :: ModuleSpec常量和放大器;,lldb_private ::错误*)+ 543
9 com.apple.LLDB.framework 0x0000000113e64879 DynamicLoaderMacOSXDYLD :: FindTargetModuleForDYLDImageInfo(DynamicLoaderMacOSXDYLD :: DYLDImageInfo和放大器;,布尔, bool *)+ 391
10 com.apple.LLDB.framework 0x0000000113e6699f DynamicLoaderMacOSXDYLD :: AddModulesUsingImageInfos(std :: __ 1 :: vector< DynamicLoaderMacOSXDYLD :: DYLDImageInfo,std :: __ 1 :: allocationator< DynamicLoaderMacOSXDYLD :: DYLDImageInfo> &)+ 487
11 com.apple.LLDB.framework 0x0000000113e65d7b DynamicLoaderMacOSXDYLD :: AddModulesUsingImageInfosAddress(unsigned long long,unsigned int)+ 165
12 com.apple.LLDB.framework 0x0000000113e65612 DynamicLoaderMacOSXDYLD :: InitializeFromAllImageInfos()+ 154
13 com.apple.LLDB.framework 0x0000000113e65a0c DynamicLoaderMacOSXDYLD :: NotifyBreakpointHit(void *,lldb_private :: StoppointCallbackContext *,unsigned long long,unsigned long long)+ 44
14 com.apple .LLDB.framework 0x0000000113d45d0f lldb_private :: BreakpointOptions :: InvokeCallback(lldb_private :: StoppointCallbackContext *,unsigned long long,unsigned long long)+ 43
15 com.apple.LLDB.framework 0x0000000113d43250 lldb_private :: BreakpointLocation :: InvokeCallback lldb_private :: StoppointCallbackContext *)+ 82
16 com.apple.LLDB.framework 0x0000000113d43889 lldb_private :: BreakpointLocation :: ShouldStop(lldb_private :: StoppointCallbackContext *)+ 115
17 com.apple.LLDB.framework 0x0000000113d44386 lldb_private :: BreakpointLocationCollection :: ShouldStop(lldb_private :: StoppointCallbackContext *)+ 76
18 com.apple.LLDB.framework 0x0000000113f22748 lldb_private :: StopInfoBreakpoint :: ShouldStopSynchronous(lldb_private :: Event *)+ 232
19 com.apple.LLDB.framework 0x0000000113f319cf lldb_private :: Thread :: ShouldStop(lldb_private :: Event *)+ 653
20 com.apple.LLDB.framework 0x0000000113f365a3 lldb_private :: ThreadList :: ShouldStop(lldb_private :: Event * )+ 339
21 com.apple.LLDB.framework 0x0000000113f12485 lldb_private :: Process :: ShouldBroadcastEvent(lldb_private :: Event *)+ 375
22 com.apple.LLDB.framework 0x0000000113f1048c lldb_private :: Process: :HandlePrivateEvent(std :: __ 1 :: shared_ptr< lldb_private :: Event>&)+ 356
23 com.apple.LLDB.framework 0x0000000113f12ae7 lldb_private :: Process :: RunPrivateStateThread()+ 507
24 com.apple.LLDB.framework 0x0000000113f1262d lldb_private :: Process :: PrivateStateThread(void *)+ 9
25 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
26 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
27 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

导线22 :: DBGLLDBSessionThread
0 libsystem_kernel.dylib 0x00007fff8d1b0716 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ddcdc3b _pthread_cond_wait + 727
2个COM .apple.LLDB.framework 0x0000000113e37697 lldb_private :: Condition :: Wait(lldb_private :: Mutex& lldb_private :: TimeValue const *,bool *)+ 109
3 com.apple.LLDB.framework 0x0000000113e81752 lldb_private :: Predicate ; bool> :: WaitForValueEqualTo(bool,lldb_private :: TimeValue const *,bool *)+ 90
4 com.apple.LLDB.framework 0x0000000113dadcb4 lldb_private :: Listener :: WaitForEventsInternal(lldb_private :: TimeValue const *,lldb_private :: Broadcaster *,lldb_private :: ConstString const *,unsigned int,unsigned int,std :: __ 1 :: shared_ptr< lldb_private :: Event>&)+ 324
5 com.apple.LLDB.framework 0x0000000113daddcb lldb_private :: Listener :: WaitForEvent(lldb_private :: TimeValue const *,std :: __ 1 :: shared_ptr< lldb_private :: Event>&)+ 27
6 com.apple.LLDB.framework 0x0000000112c6f995 lldb :: SBListener: :WaitForEvent(unsigned int,lldb :: SBEvent&)+ 203
7 com.apple.dt.dbg.DebuggerLLDB 0x000000010981aa22 DBGLLDBSessionThread(void *)+ 813
8 libsystem_pthread.dylib 0x00007fff8ddcb899 _pthread_body + 138
9 libsystem_pthread.dylib 0x00007fff8ddcb72a _pthread_start + 137
10 libsystem_pthread.dylib 0x00007fff8ddcffc9 thread_start + 13

线程21与X86线程状态(64位)崩溃:
rax:0x0000000000000000 RBX:0x00007fe807c15fa0 RCX:0x00000000000e4850 RDX:0x00000000000e4850
RDI:0x00007fe807c15ff8 RSI:0x0000000124690310 RBP:0x0000000124690290 RSP:0x0000000124690290
R8:0x0000000124718000 R9:0x0000000000000004 R10:0x0000000001555568 R11:0x000000002fd20404
R12:0x0000000000001000 R13: 0x00007fe807c15fa0 r14:0x00007fe807c15ff8 r15:0x00000000000e4850
rip:0x0000000113d98990 rfl:0x0000000000010246 cr2:0x0000000124718000

逻辑CPU:2
错误代码:0x00000004
陷阱编号:14

我尝试使用磁盘工具修复权限,并且在Xcode中禁用了源代码管理。如果我简单地删除对SDL的引用,问题消失。例如,以下程序最初工作,但当我将项目链接到SDL时崩溃:

  // #include< SDL2 / SDL.h> 
#include< iostream>
int main()
{
std :: cout< 你好,世界! << std :: endl;
return 0;
}

我在这里做错了吗?

解决方案

看起来问题是SDL2没有正确签名。有一个问题需要修复,请访问 https://bugzilla.libsdl.org/show_bug.cgi?id=2058



当使用lldb从Xcode 5生成应用程序时,Xcode会加载一个插件,用于检查应用程序加载的模块, 。 Xcode设置为在从由无效签名支持的页面读取时崩溃。因为SDL2没有正确签名,当Xcode 5尝试检查SDL2库时,它将从无效的页面读取并崩溃。您可以通过上面的崩溃报告中的以下行获得线索:

 异常类型:EXC_BAD_ACCESS(代码签名无效)

要自己看看SDL没有正确签名,请从文件夹中执行以下命令SDL2位于:

  $ codesign -vvvv SDL2 
SDL2:无效的签名(代码或签名已修改)
在架构中:x86_64

如果您不想构建自己的SDL2版本您可以更新签名以使其正确:

  $ codesign -f -s  -  SDL2 
SDL2:替换现有的签名

并验证新签名是否正确:

  $ codesign -vvvv SDL2 
SDL2:磁盘上有效
SDL2:满足其指定的要求

请注意,从安全的角度来看,这是一个解决方法是有风险的,因为我不知道为什么签名是无效的。 / p>

I tried to follow these two tutorials (or the applicable parts of them, due to version differences) to install SDL 2.0.2 to work with Xcode 5.1:

Tutorial 1

Tutorial 2

Running any program with the SDL 2 framework linked causes Xcode to crash with the following problem details:

Process:         Xcode [1787]  
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode  
Identifier:      com.apple.dt.Xcode  
Version:         5.1 (5084)
Build Info:      IDEFrameworks-5084000000000000~21
App Item ID:     497799835
App External ID: 444172641
Code Type:       X86-64 (Native)
Parent Process:  launchd [257]
Responsible:     Xcode [1787]
User ID:         501

PlugIn Path:       /Library/Frameworks/SDL2.framework/Versions/A/SDL2
PlugIn Identifier: org.libsdl.SDL2
PlugIn Version:    2.0.2 (2.0.2)

Date/Time:       2014-03-13 04:24:59.771 +0200
OS Version:      Mac OS X 10.9.2 (13C64)
Report Version:  11
Anonymous UUID:  EFECF2A0-A489-055E-0904-D3CD9E756EB0


Crashed Thread:  21  <lldb.process.internal-state(pid=1804)>

Exception Type:  EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x0000000124718000

VM Regions Near 0x124718000:
    Stack                  0000000124696000-0000000124718000 [  520K] rw-/rwx SM=COW  thread 22
--> mapped file            0000000124718000-00000001247fd000 [  916K] r--/rwx SM=COW  /Library/Frameworks/SDL2.framework/Versions/A/SDL2
    CG shared images       00000001c0003000-00000001c000b000 [   32K] r--/r-- SM=SHM  

Application Specific Information:
ProductBuildVersion: 5B130a

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8d1aca1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8d1abd18 mach_msg + 64
2   com.apple.CoreFoundation        0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3   com.apple.CoreFoundation        0x00007fff87ba7779 __CFRunLoopRun + 1161
4   com.apple.CoreFoundation        0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5   com.apple.HIToolbox             0x00007fff8e776a0d RunCurrentEventLoopInMode + 226
6   com.apple.HIToolbox             0x00007fff8e7767b7 ReceiveNextEventCommon + 479
7   com.apple.HIToolbox             0x00007fff8e7765bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
8   com.apple.AppKit                0x00007fff8145a3de _DPSNextEvent + 1434
9   com.apple.AppKit                0x00007fff81459a2b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
10  com.apple.dt.DVTKit             0x00000001067a3e31 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 84
11  com.apple.AppKit                0x00007fff8144db2c -[NSApplication run] + 553
12  com.apple.AppKit                0x00007fff81438913 NSApplicationMain + 940
13  libdyld.dylib                   0x00007fff8dda55fd start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff8d1b1662 kevent64 + 10
1   libdispatch.dylib               0x00007fff88b8543d _dispatch_mgr_invoke + 239
2   libdispatch.dylib               0x00007fff88b85152 _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib          0x00007fff8d1b0e6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8ddccf08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8ddcffb9 start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff8d1b0e6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8ddccf08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8ddcffb9 start_wqthread + 13

Thread 4:: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x00007fff8d1aca1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8d1abd18 mach_msg + 64
2   com.apple.CoreFoundation        0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3   com.apple.CoreFoundation        0x00007fff87ba7779 __CFRunLoopRun + 1161
4   com.apple.CoreFoundation        0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5   com.apple.Foundation            0x00007fff87db8967 +[NSURLConnection(Loader) _resourceLoadLoop:] + 348
6   com.apple.Foundation            0x00007fff87db876b __NSThread__main__ + 1318
7   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff8d1aca1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8d1abd18 mach_msg + 64
2   com.apple.CoreFoundation        0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3   com.apple.CoreFoundation        0x00007fff87ba7779 __CFRunLoopRun + 1161
4   com.apple.CoreFoundation        0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5   com.apple.DTDeviceKitBase       0x00000001109fb40e -[DTDKRemoteDeviceDataListener listenerThreadImplementation] + 162
6   com.apple.Foundation            0x00007fff87db876b __NSThread__main__ + 1318
7   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 6:: com.apple.CFSocket.private
0   libsystem_kernel.dylib          0x00007fff8d1b09aa __select + 10
1   com.apple.CoreFoundation        0x00007fff87bf3b83 __CFSocketManager + 867
2   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
3   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
4   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 7:: DYMobileDeviceManager
0   libsystem_kernel.dylib          0x00007fff8d1aca1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8d1abd18 mach_msg + 64
2   com.apple.CoreFoundation        0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3   com.apple.CoreFoundation        0x00007fff87ba7779 __CFRunLoopRun + 1161
4   com.apple.CoreFoundation        0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5   com.apple.Foundation            0x00007fff87dbaadc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 253
6   com.apple.Foundation            0x00007fff87ea34aa -[NSRunLoop(NSRunLoop) run] + 74
7   com.apple.GPUToolsMobileFoundation  0x0000000112ab0e0d -[DYMobileDeviceManager _deviceNotificationThread:] + 134
8   com.apple.Foundation            0x00007fff87db876b __NSThread__main__ + 1318
9   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
10  libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
11  libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 8:: CVDisplayLink
0   libsystem_kernel.dylib          0x00007fff8d1b0716 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8ddcdc3b _pthread_cond_wait + 727
2   com.apple.CoreVideo             0x00007fff8d2d1a38 CVDisplayLink::runIOThread() + 656
3   com.apple.CoreVideo             0x00007fff8d2d178f startIOThread(void*) + 147
4   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
5   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
6   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 9:
0   libsystem_kernel.dylib          0x00007fff8d1b0e6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8ddccf08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8ddcffb9 start_wqthread + 13

Thread 10:
0   libsystem_kernel.dylib          0x00007fff8d1b0e6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8ddccf08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8ddcffb9 start_wqthread + 13

Thread 11:
0   libsystem_kernel.dylib          0x00007fff8d1aca1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8d1abd18 mach_msg + 64
2   com.apple.CoreFoundation        0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3   com.apple.CoreFoundation        0x00007fff87ba7779 __CFRunLoopRun + 1161
4   com.apple.CoreFoundation        0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5   com.apple.AppKit                0x00007fff815fa16e _NSEventThread + 144
6   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
7   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
8   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 12:
0   libsystem_kernel.dylib          0x00007fff8d1b0e6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8ddccf08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8ddcffb9 start_wqthread + 13

Thread 13:
0   libsystem_kernel.dylib          0x00007fff8d1b0e6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8ddccf08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8ddcffb9 start_wqthread + 13

Thread 14:
0   libsystem_kernel.dylib          0x00007fff8d1b0716 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8ddcdc3b _pthread_cond_wait + 727
2   com.apple.Xcode.DevToolsCore    0x000000010c476363 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 524
3   com.apple.Foundation            0x00007fff87db876b __NSThread__main__ + 1318
4   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
5   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
6   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 15:
0   libsystem_kernel.dylib          0x00007fff8d1b0716 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8ddcdc3b _pthread_cond_wait + 727
2   com.apple.Xcode.DevToolsCore    0x000000010c476363 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 524
3   com.apple.Foundation            0x00007fff87db876b __NSThread__main__ + 1318
4   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
5   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
6   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 16:
0   libsystem_kernel.dylib          0x00007fff8d1b0716 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8ddcdc3b _pthread_cond_wait + 727
2   com.apple.Xcode.DevToolsCore    0x000000010c476363 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 524
3   com.apple.Foundation            0x00007fff87db876b __NSThread__main__ + 1318
4   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
5   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
6   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 17:: <lldb.comm.debugger.input>
0   libsystem_kernel.dylib          0x00007fff8d1b09aa __select + 10
1   com.apple.LLDB.framework        0x0000000113d965f0 lldb_private::ConnectionFileDescriptor::BytesAvailable(unsigned int, lldb_private::Error*) + 888
2   com.apple.LLDB.framework        0x0000000113d96052 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 170
3   com.apple.LLDB.framework        0x0000000113d94493 lldb_private::Communication::ReadFromConnection(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 97
4   com.apple.LLDB.framework        0x0000000113d940f1 lldb_private::Communication::ReadThread(void*) + 147
5   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
6   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
7   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 18:: <lldb.comm.xcode.lldb.comm>
0   libsystem_kernel.dylib          0x00007fff8d1b09aa __select + 10
1   com.apple.LLDB.framework        0x0000000113d965f0 lldb_private::ConnectionFileDescriptor::BytesAvailable(unsigned int, lldb_private::Error*) + 888
2   com.apple.LLDB.framework        0x0000000113d96052 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 170
3   com.apple.LLDB.framework        0x0000000113d94493 lldb_private::Communication::ReadFromConnection(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 97
4   com.apple.LLDB.framework        0x0000000113d940f1 lldb_private::Communication::ReadThread(void*) + 147
5   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
6   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
7   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 19:
0   libsystem_kernel.dylib          0x00007fff8d1aca1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8d1abd18 mach_msg + 64
2   com.apple.CoreFoundation        0x00007fff87ba8155 __CFRunLoopServiceMachPort + 181
3   com.apple.CoreFoundation        0x00007fff87ba7779 __CFRunLoopRun + 1161
4   com.apple.CoreFoundation        0x00007fff87ba70b5 CFRunLoopRunSpecific + 309
5   com.apple.CoreFoundation        0x00007fff87c5c811 CFRunLoopRun + 97
6   com.apple.DebugSymbols          0x00007fff834007e3 SpotlightQueryThread(void*) + 355
7   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 20:: <lldb.process.gdb-remote.async>
0   libsystem_kernel.dylib          0x00007fff8d1b0716 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8ddcdc3b _pthread_cond_wait + 727
2   com.apple.LLDB.framework        0x0000000113e37697 lldb_private::Condition::Wait(lldb_private::Mutex&, lldb_private::TimeValue const*, bool*) + 109
3   com.apple.LLDB.framework        0x0000000113e81752 lldb_private::Predicate<bool>::WaitForValueEqualTo(bool, lldb_private::TimeValue const*, bool*) + 90
4   com.apple.LLDB.framework        0x0000000113dadcb4 lldb_private::Listener::WaitForEventsInternal(lldb_private::TimeValue const*, lldb_private::Broadcaster*, lldb_private::ConstString const*, unsigned int, unsigned int, std::__1::shared_ptr<lldb_private::Event>&) + 324
5   com.apple.LLDB.framework        0x0000000113daddcb lldb_private::Listener::WaitForEvent(lldb_private::TimeValue const*, std::__1::shared_ptr<lldb_private::Event>&) + 27
6   com.apple.LLDB.framework        0x0000000113e8bb51 ProcessGDBRemote::AsyncThread(void*) + 1213
7   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 21 Crashed:: <lldb.process.internal-state(pid=1804)>
0   com.apple.LLDB.framework        0x0000000113d98990 lldb_private::DataExtractor::GetU32(unsigned long long*) const + 52
1   com.apple.LLDB.framework        0x0000000113e73045 ObjectFileMachO::ParseHeader() + 91
2   com.apple.LLDB.framework        0x0000000113e724fd ObjectFileMachO::CreateInstance(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long) + 661
3   com.apple.LLDB.framework        0x0000000113ee9ac5 lldb_private::ObjectFile::FindPlugin(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::FileSpec const*, unsigned long long, unsigned long long, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long&) + 1705
4   com.apple.LLDB.framework        0x0000000113e6bf43 ObjectContainerUniversalMachO::GetObjectFile(lldb_private::FileSpec const*) + 427
5   com.apple.LLDB.framework        0x0000000113ee9bd7 lldb_private::ObjectFile::FindPlugin(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::FileSpec const*, unsigned long long, unsigned long long, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long&) + 1979
6   com.apple.LLDB.framework        0x0000000113ddafbc lldb_private::Module::GetObjectFile() + 210
7   com.apple.LLDB.framework        0x0000000113dde60f lldb_private::ModuleList::GetSharedModule(lldb_private::ModuleSpec const&, std::__1::shared_ptr<lldb_private::Module>&, lldb_private::FileSpecList const*, std::__1::shared_ptr<lldb_private::Module>*, bool*, bool) + 805
8   com.apple.LLDB.framework        0x0000000113f274d9 lldb_private::Target::GetSharedModule(lldb_private::ModuleSpec const&, lldb_private::Error*) + 543
9   com.apple.LLDB.framework        0x0000000113e64879 DynamicLoaderMacOSXDYLD::FindTargetModuleForDYLDImageInfo(DynamicLoaderMacOSXDYLD::DYLDImageInfo&, bool, bool*) + 391
10  com.apple.LLDB.framework        0x0000000113e6699f DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfos(std::__1::vector<DynamicLoaderMacOSXDYLD::DYLDImageInfo, std::__1::allocator<DynamicLoaderMacOSXDYLD::DYLDImageInfo> >&) + 487
11  com.apple.LLDB.framework        0x0000000113e65d7b DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress(unsigned long long, unsigned int) + 165
12  com.apple.LLDB.framework        0x0000000113e65612 DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() + 154
13  com.apple.LLDB.framework        0x0000000113e65a0c DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long long, unsigned long long) + 44
14  com.apple.LLDB.framework        0x0000000113d45d0f lldb_private::BreakpointOptions::InvokeCallback(lldb_private::StoppointCallbackContext*, unsigned long long, unsigned long long) + 43
15  com.apple.LLDB.framework        0x0000000113d43250 lldb_private::BreakpointLocation::InvokeCallback(lldb_private::StoppointCallbackContext*) + 82
16  com.apple.LLDB.framework        0x0000000113d43889 lldb_private::BreakpointLocation::ShouldStop(lldb_private::StoppointCallbackContext*) + 115
17  com.apple.LLDB.framework        0x0000000113d44386 lldb_private::BreakpointLocationCollection::ShouldStop(lldb_private::StoppointCallbackContext*) + 76
18  com.apple.LLDB.framework        0x0000000113f22748 lldb_private::StopInfoBreakpoint::ShouldStopSynchronous(lldb_private::Event*) + 232
19  com.apple.LLDB.framework        0x0000000113f319cf lldb_private::Thread::ShouldStop(lldb_private::Event*) + 653
20  com.apple.LLDB.framework        0x0000000113f365a3 lldb_private::ThreadList::ShouldStop(lldb_private::Event*) + 339
21  com.apple.LLDB.framework        0x0000000113f12485 lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) + 375
22  com.apple.LLDB.framework        0x0000000113f1048c lldb_private::Process::HandlePrivateEvent(std::__1::shared_ptr<lldb_private::Event>&) + 356
23  com.apple.LLDB.framework        0x0000000113f12ae7 lldb_private::Process::RunPrivateStateThread() + 507
24  com.apple.LLDB.framework        0x0000000113f1262d lldb_private::Process::PrivateStateThread(void*) + 9
25  libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
26  libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
27  libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 22:: DBGLLDBSessionThread
0   libsystem_kernel.dylib          0x00007fff8d1b0716 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8ddcdc3b _pthread_cond_wait + 727
2   com.apple.LLDB.framework        0x0000000113e37697 lldb_private::Condition::Wait(lldb_private::Mutex&, lldb_private::TimeValue const*, bool*) + 109
3   com.apple.LLDB.framework        0x0000000113e81752 lldb_private::Predicate<bool>::WaitForValueEqualTo(bool, lldb_private::TimeValue const*, bool*) + 90
4   com.apple.LLDB.framework        0x0000000113dadcb4 lldb_private::Listener::WaitForEventsInternal(lldb_private::TimeValue const*, lldb_private::Broadcaster*, lldb_private::ConstString const*, unsigned int, unsigned int, std::__1::shared_ptr<lldb_private::Event>&) + 324
5   com.apple.LLDB.framework        0x0000000113daddcb lldb_private::Listener::WaitForEvent(lldb_private::TimeValue const*, std::__1::shared_ptr<lldb_private::Event>&) + 27
6   com.apple.LLDB.framework        0x0000000112c6f995 lldb::SBListener::WaitForEvent(unsigned int, lldb::SBEvent&) + 203
7   com.apple.dt.dbg.DebuggerLLDB   0x000000010981aa22 DBGLLDBSessionThread(void*) + 813
8   libsystem_pthread.dylib         0x00007fff8ddcb899 _pthread_body + 138
9   libsystem_pthread.dylib         0x00007fff8ddcb72a _pthread_start + 137
10  libsystem_pthread.dylib         0x00007fff8ddcffc9 thread_start + 13

Thread 21 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007fe807c15fa0  rcx: 0x00000000000e4850  rdx: 0x00000000000e4850
  rdi: 0x00007fe807c15ff8  rsi: 0x0000000124690310  rbp: 0x0000000124690290  rsp: 0x0000000124690290
   r8: 0x0000000124718000   r9: 0x0000000000000004  r10: 0x0000000001555568  r11: 0x000000002fd20404
  r12: 0x0000000000001000  r13: 0x00007fe807c15fa0  r14: 0x00007fe807c15ff8  r15: 0x00000000000e4850
  rip: 0x0000000113d98990  rfl: 0x0000000000010246  cr2: 0x0000000124718000

Logical CPU:     2
Error Code:      0x00000004
Trap Number:     14

I've tried to repair permissions using the Disk Utility and also disabled Source Control in Xcode. The problem disappears if I simply delete the reference to SDL. For example the following program works initially, but crashes when I link the project to SDL:

// #include <SDL2/SDL.h>
#include <iostream>
int main()
{
    std::cout << "Hello World!" << std::endl;
    return 0;
}

Am I doing something wrong here?

解决方案

It looks like the problem is that SDL2 isn't properly signed. There's a ticket to fix the issue at https://bugzilla.libsdl.org/show_bug.cgi?id=2058.

When you spawn an application from Xcode 5 with lldb, Xcode loads a plugin that will inspect modules your application loads, presumably to give you insight into your program. Xcode is set up to crash if it reads from a page that is backed by an invalid signature. Because SDL2 isn't properly signed, when Xcode 5 attempts to examine the SDL2 library, it will read from an invalid page, and crash. You get a clue that this is happening by the following line in your crash report above:

Exception Type:  EXC_BAD_ACCESS (Code Signature Invalid)

To see for yourself that SDL isn't properly signed, execute the following command from the folder where SDL2 resides:

$ codesign -vvvv SDL2 
SDL2: invalid signature (code or signature have been modified)
In architecture: x86_64 

If you don't want to build your own version of SDL2 (the solution that's mentioned above), you can update the signature to make it correct:

$ codesign -f -s - SDL2 
SDL2: replacing existing signature

And to verify that the new signature is good:

$ codesign -vvvv SDL2
SDL2: valid on disk
SDL2: satisfies its Designated Requirement

Note that doing this as a workaround is risky from a security standpoint, as I'm not sure why the signature is invalid.

这篇关于使用SDL 2运行应用程序时,Xcode 5崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆