0
以下程序在調試模式和釋放時從OS X 10.10.5(Yosemite)上的Xcode 6.3.2運行時調用main
之前崩潰模式。C++程序在從Xcode運行時崩潰(但從命令行運行正常)
#include <boost/network/uri.hpp>
int main()
{
boost::network::uri::uri url;
url << boost::network::uri::scheme("http");
return 0;
}
該應用程序使用cpp-netlib v0.11.2。 cpp-netlib v0.11.0不會發生崩潰。
Xcode顯示一個窗口,顯示'Xcode意外退出',有3個選項 - '忽略','報告'和'重新打開'。如果我選擇「報告」,則會打開另一個窗口,其中包含更多信息。我在下面包含了一個片段。
請注意,如果從命令行運行應用程序,則不會發生崩潰。
我如何找出確切原因是什麼?
Process: Xcode [10190]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.3.2 (7718)
Build Info: IDEFrameworks-7718000000000000~2
App Item ID: 497799835
App External ID: 812404257
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [10190]
User ID: 501
Date/Time: 2015-11-03 10:47:56.517 +0000
OS Version: Mac OS X 10.10.5 (14F27)
Report Version: 11
Anonymous UUID: FC1A7EB1-54F4-E985-58AC-A097ABAD05B9
Sleep/Wake UUID: E1BB13F1-08A2-47C5-BF97-CF63B595B260
Time Awake Since Boot: 1200000 seconds
Time Since Wake: 1100 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 6D2105
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8fa364de mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8fa3564f mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff93e43eb4 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff93e4337b __CFRunLoopRun + 1371
4 com.apple.CoreFoundation 0x00007fff93e42bd8 CFRunLoopRunSpecific + 296
5 com.apple.HIToolbox 0x00007fff9829256f RunCurrentEventLoopInMode + 235
6 com.apple.HIToolbox 0x00007fff982922ea ReceiveNextEventCommon + 431
7 com.apple.HIToolbox 0x00007fff9829212b _BlockUntilNextEventMatchingListInModeWithFilter + 71
8 com.apple.AppKit 0x00007fff95e678ab _DPSNextEvent + 978
9 com.apple.AppKit 0x00007fff95e66e58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
10 com.apple.dt.DVTKit 0x000000010ce67aaa -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 237
11 com.apple.AppKit 0x00007fff95e5caf3 -[NSApplication run] + 594
12 com.apple.AppKit 0x00007fff95dd9244 NSApplicationMain + 1832
13 libdyld.dylib 0x00007fff8fac15c9 start + 1
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff8fa3c232 kevent64 + 10
1 libdispatch.dylib 0x00007fff8e89ca6a _dispatch_mgr_thread + 52
Thread 2:
0 libsystem_kernel.dylib 0x00007fff8fa3651a semaphore_wait_trap + 10
1 libdispatch.dylib 0x00007fff8e8a3b9c _dispatch_group_wait_slow + 218
2 com.apple.CFNetwork 0x00007fff942347be -[NSHost resolveCurrentHostWithHandler:] + 707
3 com.apple.CFNetwork 0x00007fff9423440c __18-[NSHost resolve:]_block_invoke + 298
4 libdispatch.dylib 0x00007fff8e89e323 _dispatch_call_block_and_release + 12
5 libdispatch.dylib 0x00007fff8e899c13 _dispatch_client_callout + 8
6 libdispatch.dylib 0x00007fff8e89d365 _dispatch_queue_drain + 1100
7 libdispatch.dylib 0x00007fff8e89eecc _dispatch_queue_invoke + 202
8 libdispatch.dylib 0x00007fff8e89c6b7 _dispatch_root_queue_drain + 463
9 libdispatch.dylib 0x00007fff8e8aafe4 _dispatch_worker_thread3 + 91
10 libsystem_pthread.dylib 0x00007fff8fdada9d _pthread_wqthread + 729
11 libsystem_pthread.dylib 0x00007fff8fdab3dd start_wqthread + 13
我不明白如何runloop在那裏,因爲這不是一個可可應用程序。堆棧跟蹤根本不匹配代碼。 – trojanfoe
我不明白任何這個崩潰報告。 – ksl
那麼你可以看到有'NSApplicationMain'參與;在一個Cocoa應用程序中,通常是'main()'中唯一的調用。我會說這個項目完全錯誤配置(即斷開),應該扔掉。 – trojanfoe