2

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.

T'n'E
  • 598
  • 5
  • 17
  • Use activity monitor to see what are the services running, if you need to close select and close them, it will bit help to you – Gourav Joshi Feb 22 '18 at 10:23
  • Thanks, but I cannot find any particular process to quit. Now since I tried to open it in the simulator, it has decided that it will not move past the first view either, when running on hardware. (No warning in Xcode either) – T'n'E Feb 22 '18 at 10:41
  • I am also facing this issue, I saw same behaviour with Xcode 8.3. I feels this is bug in macOS 10.13 & above. Need expertise opinion. – Nasir Mar 02 '18 at 04:23

1 Answers1

0

It appears that the following resolved the issue (although still don't know why it happened or what actually happened).

  1. Create a new application with two views and a segue between them (no code).
  2. Launch a debug session and move between the views.
  3. Stop the debug session.
  4. Start a new debug session with your faulting app.
  5. Before running into the offending scenario, hit the Stop button.
  6. Debugging should work properly now.

I'm not sure whether it was steps 1-3 that did the trick, or step 5, or a combination.

T'n'E
  • 598
  • 5
  • 17