Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

xcode4.3 - Xcode 4.3-4.4 crashes with breakpoints using LLDB, breakpoints useless with GDB

Every time I try to run my target when Breakpoints using the LLDB Debugger, Xcode crashes. My colleague has no trouble using LLDB, and we're both running 4.4 (I've had the problem since 4.3)

Furthermore, since I have to use GDB, there's a problem with that too. Randomly, when I hit some breakpoints in GDB, I'll get a Previous frame inner to this frame (gdb could not unwind past this frame) message, and can't really see anything useful without blindly typing in po iVar like commands.

Overall my debugging is pretty busted, if anyone can help I'd really appreciate it.

NOTE: My project is compiling with Apple LLVM 3.0 and cannot revert back without causing build errors due to the use of the -fobjc-arc compiler flag

Here's the crash report from Xcode

Process:         Xcode [344]
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.4 (1484)
Build Info:      IDEApplication-1484000000000000~4
App Item ID:     497799835
App External ID: 9584584
Code Type:       X86-64 (Native)
Parent Process:  launchd [324]

Date/Time:       2012-08-10 11:45:01.067 -0400
OS Version:      Mac OS X 10.7.4 (11E53)
Report Version:  9

Interval Since Last Report:          83007 sec
Crashes Since Last Report:           1
Per-App Interval Since Last Report:  80976 sec
Per-App Crashes Since Last Report:   1
Anonymous UUID:                      50D9F896-324C-4624-8C00-C460577BD2AE

Crashed Thread:  16  <lldb session listener>

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 000000010bacd000-000000010bad0000 [   12K] r-x/rwx SM=COW  /Applications/Xcode.app/Contents/MacOS/Xcode

Application Specific Information:
ProductBuildVersion: 4F250
objc[344]: garbage collection is ON

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8e2d367a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8e2d2d71 mach_msg + 73
2   com.apple.CoreFoundation        0x00007fff8687950c __CFRunLoopServiceMachPort + 188
3   com.apple.CoreFoundation        0x00007fff86881c74 __CFRunLoopRun + 1204
4   com.apple.CoreFoundation        0x00007fff86881486 CFRunLoopRunSpecific + 230
5   com.apple.HIToolbox             0x00007fff8b8a34d3 RunCurrentEventLoopInMode + 277
6   com.apple.HIToolbox             0x00007fff8b8aa781 ReceiveNextEventCommon + 355
7   com.apple.HIToolbox             0x00007fff8b8aa60e BlockUntilNextEventMatchingListInMode + 62
8   com.apple.AppKit                0x00007fff8d614e31 _DPSNextEvent + 659
9   com.apple.AppKit                0x00007fff8d614735 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135
10  com.apple.AppKit                0x00007fff8d611071 -[NSApplication run] + 470
11  com.apple.AppKit                0x00007fff8d88d244 NSApplicationMain + 867
12  com.apple.dt.Xcode              0x000000010bacedc0 0x10bacd000 + 7616

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff8e2d57e6 kevent + 10
1   libdispatch.dylib               0x00007fff8e2aa78a _dispatch_mgr_invoke + 923
2   libdispatch.dylib               0x00007fff8e2a931a _dispatch_mgr_thread + 54

Thread 2:: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x00007fff8e2d367a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8e2d2d71 mach_msg + 73
2   com.apple.CoreFoundation        0x00007fff8687950c __CFRunLoopServiceMachPort + 188
3   com.apple.CoreFoundation        0x00007fff86881c74 __CFRunLoopRun + 1204
4   com.apple.CoreFoundation        0x00007fff86881486 CFRunLoopRunSpecific + 230
5   com.apple.Foundation            0x00007fff82510fd7 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 335
6   com.apple.Foundation            0x00007fff8250572a -[NSThread main] + 68
7   com.apple.Foundation            0x00007fff825056a2 __NSThread__main__ + 1575
8   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
9   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff8e2d367a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8e2d2d71 mach_msg + 73
2   com.apple.CoreFoundation        0x00007fff8687950c __CFRunLoopServiceMachPort + 188
3   com.apple.CoreFoundation        0x00007fff86881c74 __CFRunLoopRun + 1204
4   com.apple.CoreFoundation        0x00007fff86881486 CFRunLoopRunSpecific + 230
5   com.apple.DTDeviceKit           0x00000001118c9eaf -[DTDKRemoteDeviceDataListener listenerThreadImplementation] + 298
6   com.apple.Foundation            0x00007fff8250572a -[NSThread main] + 68
7   com.apple.Foundation            0x00007fff825056a2 __NSThread__main__ + 1575
8   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
9   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 4:: com.apple.CFSocket.private
0   libsystem_kernel.dylib          0x00007fff8e2d4df2 __select + 10
1   com.apple.CoreFoundation        0x00007fff868cac8b __CFSocketManager + 1355
2   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
3   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 5:: DYMobileDeviceManager
0   libsystem_kernel.dylib          0x00007fff8e2d367a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8e2d2d71 mach_msg + 73
2   com.apple.CoreFoundation        0x00007fff8687950c __CFRunLoopServiceMachPort + 188
3   com.apple.CoreFoundation        0x00007fff86881c74 __CFRunLoopRun + 1204
4   com.apple.CoreFoundation        0x00007fff86881486 CFRunLoopRunSpecific + 230
5   com.apple.Foundation            0x00007fff824b6f7b -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 267
6   com.apple.Foundation            0x00007fff824b6e67 -[NSRunLoop(NSRunLoop) run] + 62
7   com.apple.Foundation            0x00007fff8250572a -[NSThread main] + 68
8   com.apple.Foundation            0x00007fff825056a2 __NSThread__main__ + 1575
9   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
10  libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 6:
0   libsystem_kernel.dylib          0x00007fff8e2d4bca __psynch_cvwait + 10
1   libsystem_c.dylib               0x00007fff83a6f274 _pthread_cond_wait + 840
2   com.apple.Xcode.DevToolsCore    0x000000010f3b3d35 -[XCInvocationQueue _processInvocationsInThreadSlotNumber:] + 353
3   com.apple.Foundation            0x00007fff8250572a -[NSThread main] + 68
4   com.apple.Foundation            0x00007fff825056a2 __NSThread__main__ + 1575
5   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
6   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 7:: CVDisplayLink
0   libsystem_kernel.dylib          0x00007fff8e2d4bca __psynch_cvwait + 10
1   libsystem_c.dylib               0x00007fff83a6f274 _pthread_cond_wait + 840
2   com.apple.CoreVideo             0x00007fff8e7906c8 CVDisplayLink::runIOThread() + 710
3   com.apple.CoreVideo             0x00007fff8e7903e9 _ZL13startIOThreadPv + 148
4   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
5   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 8:
0   libsystem_kernel.dylib          0x00007fff8e2d5192 __workq_kernreturn + 10
1   libsystem_c.dylib               0x00007fff83a6d594 _pthread_wqthread + 758
2   libsystem_c.dylib               0x00007fff83a6eb85 start_wqthread + 13

Thread 9:: Dispatch queue: com.apple.root.low-priority
0   libsystem_kernel.dylib          0x00007fff8e2d4e42 __semwait_signal + 10
1   libsystem_c.dylib               0x00007fff83a2197e pthread_join + 795
2   libclang.dylib                  0x000000010d41c4ea 0x10cedf000 + 5493994
3   libclang.dylib                  0x000000010d41201a 0x10cedf000 + 5451802
4   libclang.dylib                  0x000000010cee93f7 0x10cedf000 + 41975
5   libclang.dylib                  0x000000010cf1f913 clang_indexSourceFile + 163
6   com.apple.dt.IDEFoundation      0x000000010c3152ff -[IDEIndexClangTranslationUnit indexUsingDataSource:] + 295
7   com.apple.dt.IDEFoundation      0x000000010c3146b2 -[IDEIndexClangDataSource generateDataForJob:] + 2182
8   com.apple.dt.IDEFoundation      0x000000010c313db7 -[IDEIndexDataSource processJob:] + 243
9   com.apple.dt.IDEFoundation      0x000000010c3139e9 +[IDEIndexingEngine runFileJob:] + 414
10  com.apple.dt.IDEFoundation      0x000000010c31345e -[IDEIndexingJob run] + 99
11  com.apple.dt.IDEFoundation      0x000000010c43434d __40-[IDEIndexingJobScheduler _scheduleJobs]_block_invoke_0 + 31
12  com.apple.dt.DVTFoundation      0x000000010bb7c260 __DVTDispatchAsync_block_invoke_0 + 16
13  libdispatch.dylib               0x00007fff8e2a8a86 _dispatch_call_block_and_release + 18
14  libdispatch.dylib               0x00007fff8e2a9965 _dispatch_worker_thread2 + 255
15  libsystem_c.dylib               0x00007fff83a6d3da _pthread_wqthread + 316
16  libsystem_c.dylib               0x00007fff83a6eb85 start_wqthread + 13

Thread 10:
0   libsystem_kernel.dylib          0x00007fff8e2d5192 __workq_kernreturn + 10
1   libsystem_c.dylib               0x00007fff83a6d594 _pthread_wqthread + 758
2   libsystem_c.dylib               0x00007fff83a6eb85 start_wqthread + 13

Thread 11:
0   libsystem_kernel.dylib          0x00007fff8e2d5192 __workq_kernreturn + 10
1   libsystem_c.dylib               0x00007fff83a6d594 _pthread_wqthread + 758
2   libsystem_c.dylib               0x00007fff83a6eb85 start_wqthread + 13

Thread 12:: <lldb.comm.debugger.input>
0   libsystem_kernel.dylib          0x00007fff8e2d4df2 __select + 10
1   com.apple.LLDB.framework        0x0000000121d3e5d6 lldb_private::ConnectionFileDescriptor::BytesAvailable(unsigned int, lldb_private::Error*) + 362
2   com.apple.LLDB.framework        0x0000000121d3e151 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 141
3   com.apple.LLDB.framework        0x0000000121d3c9ac lldb_private::Communication::ReadFromConnection(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 50
4   com.apple.LLDB.framework        0x0000000121d3c653 lldb_private::Communication::ReadThread(void*) + 225
5   com.apple.LLDB.framework        0x0000000121dafb38 _ZL22ThreadCreateTrampolinePv + 91
6   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
7   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 13:: <lldb.comm.xcode.lldb.comm>
0   libsystem_kernel.dylib          0x00007fff8e2d4df2 __select + 10
1   com.apple.LLDB.framework        0x0000000121d3e5d6 lldb_private::ConnectionFileDescriptor::BytesAvailable(unsigned int, lldb_private::Error*) + 362
2   com.apple.LLDB.framework        0x0000000121d3e151 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 141
3   com.apple.LLDB.framework        0x0000000121d3c9ac lldb_private::Communication::ReadFromConnection(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 50
4   com.apple.LLDB.framework        0x0000000121d3c653 lldb_private::Communication::ReadThread(void*) + 225
5   com.apple.LLDB.framework        0x0000000121dafb38 _ZL22ThreadCreateTrampolinePv + 91
6   libsystem_c.dylib               0x00007fff83a6b8bf _pthread_start + 335
7   libsystem_c.dylib               0x00007fff83a6eb75 thread_start + 13

Thread 14:: <lldb.process.gdb-remote.async>
0   libsystem_kernel.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

We recently fixed some name demangling issues. The name demangler is built into the OS in libc++abi.dylib. You can build this yourself and install it to possibly fix your issues:

% sudo cp /usr/lib/libc++abi.dylib /usr/lib/libc++abi.dylib.orig
% svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi
% cd libcxxabi/lib
% TRIPLE=x86_64-apple-macosx ./buildit
% sudo cp libc++abi.dylib /usr/lib/libc++abi.dylib

You can also just "try it out" without installing the "libc++abi.dylib" to make sure it fixes things first. The steps for that are:

Quit Xcode first, and then:

% svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi
% cd libcxxabi/lib
% TRIPLE=x86_64-apple-macosx ./buildit
% DYLD_LIBRARY_PATH=`pwd` /Applications/Xcode.app/Contents/MacOS/Xcode

This will run Xcode and allow it to use the local copy of "libc++abi.dylib" that you just built.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...