74

I am getting a message in my debugger:

The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.

enter image description here

mfaani
  • 33,269
  • 19
  • 164
  • 293
Kumar Utsav
  • 2,761
  • 4
  • 24
  • 38
  • What is your Xcode version? (This is a known bug in Xcode 8 beta) – shallowThought Apr 26 '17 at 13:36
  • Version 8.2.1 (8C1002) – Kumar Utsav Apr 26 '17 at 13:55
  • 1
    Same issue happens with 8.3.2 version of XCode. Apple sucks! – Borzh May 24 '17 at 19:17
  • Xcode 8 in all versions suddenly shows this issue on any of my machines. – Sebastian Jun 09 '17 at 12:20
  • issue is still present. How to fix this? – Led Jun 28 '17 at 06:36
  • 1
    I followed the steps from this answer https://stackoverflow.com/a/33812614/618994, except the first step and it worked for me. I believe Step 4 & 5 would be suffice. – Vignesh Jun 28 '17 at 11:43
  • In my case, Xcode was stuck in a Running and the last log of debugserver was "Attach succeeded, ready to debug.". After killing "lldb-rpc-server" the program continues to run. I noticed that I have added [Voltron](https://github.com/snare/voltron#quick-start) to my `~/.lldbinit`. After removing `command script import` line in `~/.lldbinit`, LLDB RPC Server continues to work properly. – Hamid Rouhani Jul 06 '17 at 12:57
  • @Vignesh there are three different sets of 4 and 5. Which are you referring to? I'm running into this issue and am just running a playground. The crash seems to happen a lot when I'm just typing some code and it tries to debug it before I'm finished. Also, there is no log at the location where the message says the log was created. – Victor Engel Mar 23 '19 at 15:22
  • Never mind. I can find the crash log if I look for it in finder. I just can't find it using the file selector in the bug reporter website. Not sure why they would be hidden there. – Victor Engel Mar 23 '19 at 15:42

15 Answers15

62

In my case the LLDB RPC server consistently crashed every time I ran my app, even after cleaning the build folder and removing and reinstalling Xcode (Version 8.3.3 (8E3004b)) completely.

It turned out that apparently LLDB took objection to a breakpoint I had set, just moving this breakpoint by a line resolved the issue.

Stefan
  • 1,347
  • 2
  • 16
  • 38
  • 3
    I had the exact same issue. I was receiving `The LLDB RPC server has crashed`. Not sure which breakpoint was causing this error, but I just turned every break point off. – klmitchell2 Jul 06 '18 at 01:03
  • 1
    Actually, moving the breakpoint affect nothing on the crash. It still crashing. – Mohammed Hasan Sep 06 '18 at 07:22
  • 3
    Though removing the breakpoint removed the crash for me, I'd still like to know why. I needed that breakpoint; removing it really just got me back to square one. Moving it a line didn't seem to work either. – Brian Sachetta Apr 26 '19 at 16:42
  • I don't have any breakpoint. Still I'm facing the issue. Can anybody help me to fix this problem? – Mukesh Lokare Jul 03 '19 at 10:16
  • I recently updated to xcode 11.0 and started getting the same behaviour of crashes on breakpoints... – Rodrigo Fava Oct 04 '19 at 21:05
  • 1
    Yeah me too. I was getting the same issue in XCode 11.0. I did clean build removed derived data but nothing worked. Then I just removed few of the breakpoints and it worked. It's really strange – Shivam Pokhriyal Oct 17 '19 at 13:27
  • but then what if you need to debug through your break points? – Hemang Jan 14 '20 at 07:24
  • Obviously it's not ideal, but if you put them a line or two earlier and step through the code from there, it shouldn't be much of a problem... – Stefan Jan 14 '20 at 10:18
  • My breakpoint was set on a line with no executable instruction (a var declaration). As soon as I moved it to a executable instruction (next line), it no longer crashed. – Reinhard Männer Aug 01 '22 at 15:46
9

In my case: I update to Xcode Version 9.3 (9E145) recently and Xcode execute to the line with breakpoint then I type "po XXX" commend it will show the same message. I try to delete following files

~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Caches/com.apple.dt.Xcode

and it solved. not knowing exactly why but worth to try.

remember to backup those files in order to recovered in case any unexpected situation occur.

Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
andrew54068
  • 1,326
  • 14
  • 29
8

Make sure you are not running the app in release mode, if it is in release mode then change it to debug.

Alex Zavatone
  • 4,106
  • 36
  • 54
iHulk
  • 4,869
  • 2
  • 30
  • 39
7

I had the same problem and fixed it after I deleted some of the breakpoints. Not sure why this happen at all, but at least you can remove breakpoints and use some NSLog() or print() if you are in Swift and debug with the help of those. Good luck!

Boris Nikolic
  • 746
  • 14
  • 24
4

Clearly a lot of different causes for this, but for me I was using a DispatchGroup to keep track of multiple async tasks.

I had forgotten to call dispatchGroup.enter() before one of the async tasks (but still calling dispatchGroup.leave() when it finished).

Adding this in fixed the crash for me.

James
  • 81
  • 3
1

If workspace has lots of breakpoint then it will happen, So try to remove all the break point and see the magic.

Nagar
  • 73
  • 1
  • 7
1

For me just restarting the simulator worked.

0

I found the solution to this issue. I don't know is this correct or not, but this solution is work for me. what I did is Actually I connected two devices to my mac mini, in one device I run the app and get the above error in my console. Then I removed one device and tried, this time I didn't get any error in my console its worked fine. I think you guys won't believe this, I tried Almost 3 time with two devices and one device its only work for one device

suresh
  • 55
  • 3
0

This error occurs for different reasons and the main one is when you add a watch app later to your project where Xcode adds an extra build target to scheme. click on scheme section in right side of "run/stop buttons" then hit on edit scheme, hit on Build section which is the first one, There you see 2 targets one has 2 sub targets which includes watch app and watch extension in it and the other one has no sub targets and it is a watch app target.

Solution is simple delete the watch app target which has no sub targets and run the app again.

Developersian
  • 151
  • 2
  • 7
0

For me, I had an expression in my watch list that it was barfing on. When looking at the crash logs in Console, there was something like this on the reported crashed thread which gave it away:

lldb_private::EvaluateExpressionOptions const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, lldb_private::ValueObject*) + 619
17  com.apple.LLDB.framework        0x0000000102855f18 lldb::SBFrame::**EvaluateExpression**(char const*, lldb::SBExpressionOptions const&) + 696
18  lldb-rpc-server                 0x00000001025e72e9 rpc_server::_ZN4lldb7SBFrame18EvaluateExpressionEPKcRKNS_19SBExpressionOptionsE::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 169
19  lldb-rpc-server                 0x00000001025f8ce1 rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 1553
20  lldb-rpc-server                 0x00000001025fc36d Packets::ProcessPackets() + 1005
21  lldb-rpc-server                 0x00000001025fbe96 Packets::ReadThread() + 214
22  lldb-rpc-server                 0x00000001025fbdb9 Packets::RunReadThread(void*) + 9
23  libsystem_pthread.dylib         0x00007fff6a586109 _pthread_start + 148
24  libsystem_pthread.dylib         0x00007fff6a581b8b thread_start + 15
David Buck
  • 3,752
  • 35
  • 31
  • 35
0

I ran across this same error with zero idea of what to do next. I tried the accepted answer and my project didn't have any breakpoints at all.

Turns out I had an observer that I didn't remove and every few times I would push off/on the vc that contained it it would eventually crash with the op's error. I had to enable zombies to figure out which vc was causing the error. I had to manually go through the code line by line to realize I didn't remove the observer. Once I removed it everything worked fine.

// not removing this caused the error
playerItem?.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status),
                                options: [.old, .new],
                                context: &playerItemContext)
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
0

I have found a solution for this, this may not be the perfect but kind a fix my problem.

  1. Go to target Build Settings -> Other Swift Flags -> check Debug Values added Remove everything except $(inherited) and -DDEBUG

  2. Remove Derived Data

  3. Clean and Run

Rakitha
  • 894
  • 1
  • 12
  • 25
0

I am having this issue in Xcode 12.1.1 (12A7605b) in January 2021 on macOS Catalina with a Swift project.

I tried Clean, delete Derived data, restarting mac, running on different simulators and real devices - no luck.

Others suggest removing the breakpoint, but for me this breakpoint is needed for debugging (I guess I can figure out how to debug in a different way, with a differently placed breakpoint or with print statements, but that's frustrating).

I filed a bug report with Apple as the error message suggest - I urge others to do the same to increase the chance of a fix by Apple.

In the meanwhile I use this workaround - wrap the code where you want the breakpoint in a DispatchQueue.main.async:

DispatchQueue.main.async { [self] in   
    print("Put the breakpoint on this line")
}

(Note we use [self] here because it's just debug code, but in most cases these async calls need [weak self] to avoid retain cycles and memory leaks)

Nikolay Suvandzhiev
  • 8,465
  • 6
  • 41
  • 47
-1

The problem I encountered was that the main project was objC, the Swift library introduced by Cococapods, and then crashed during breakpoint debugging of the Swift library The solution

  1. Add a swift class to the main project, name it at will, and do not need to add the bridge header file
  2. Switch to project Settings, not Target Settings, and find build_setting SWIFT_ACTIVE_COMPILATION_CONDITIONS adds a DEBUG as follows:

SWIFT_ACTIVE_COMPILATION_CONDITIONS

  • Debug Debug
  • Release
zhtut
  • 1
  • 1
  • tuguang zhou, please write your answer in English, as Stack Overflow is an [English-only site](//meta.stackoverflow.com/a/297680). – Yunnosch Jul 12 '22 at 08:35
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 16 '22 at 14:33
-3

In my case. I'm also using SQLite.swift to create database. The crashing happened when I tried to change a column data type of an existing table in code(which was not in the right way to do it), then inserted a tuple with new data type, then tried to print all the tuple out.

Solution: Delete the .sqlite3 database file you have or delete the table with conflict data type and recreate them all.

uoop
  • 9
  • 3