I'm having a really strange and annoying problem with Xcode and an app that I'm trying to debug.
I can start a new debug session from Xcode and it works properly. However, in one view I have a button that does a segue to a new view. When I press that button, the app freezes, but only when debugging. If I unplug the device from the computer, the app resumes normally. However, in Xcode, I cannot stop the session, I cannot quit Xcode (because it waits for the debug session to stop, which it fails to do) and I cannot halt the execution. My only way out is to force-quit Xcode (which will also resume the app). However, Xcode is otherwise fully functional - I can edit code, change files, etc.
I can segue back from the view without problem, but I cannot segue to any new view (show segues). I've tried replacing the storyboard segue with performSegueWithIdentifier:
, but same effect. The only indication I get from Xcode is this:
[Common] _BSMachError: port 9b2f; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
[Common] _BSMachError: port 9b2f; (os/kern) invalid name (0xf) "Unable to deallocate send right"
I've googled these error messages and tried some possible fixes (e.g. 1 and 2). I'm using CoreBluetooth and CoreData, most of the application is written in Objective-C, with some third-party libraries in Swift.
I've tried cleaning and rebuilding, but that doesn't help. I can quit the app on the iPad, but Xcode still thinks its debugging. I can unplug the iPad, but Xcode still thinks its debugging. I have restarted both the iPad and the Mac, with no effect.
I set a breakpoint at both viewWillDisappear
for the old view and at viewWillAppear
in the new view, but none of these are hit. (Or the debugger just doesn't work, I don't know)
Appreciate any ideas before I throw everything out the window.
Xcode Version 9.2 (9C40b)
iOS 10.3.2
iPad A1822 (5th gen)
Edit: Oh, and if I try to open it in the simulator, the simulator freezes at app launch.