App being debugged doesn't close when execution halted

I'm running XCode 7 beta 5 but this also happend to me on beta 4.

When I'm debugging an OSX application and execution stops sometimes the application gets stuck as not responding and won't close. I haven't been able to notice a consistent pattern of when it happens or not.


The stuck app doesn't show up in activity monitor at all. Also, it won't force quit but shows up in the force quit dialog and on the dock.


After this happens, when I test the app again in XCode it creats a new instance of it. After a few hours of coding I can have 3 - 6 of these stuck "zombies" on my dock.


The only way I can get rid of them is

1) Sometimes quitting XCode clears them

2) Sometimes quitting XCode doesn't clear them they clear when I restart XCode

3) If they don't clear from restarting XCode restarting my computer clears them out


Things I've tried:

At first I thought this was a memory management issue in my app (and maybe it still is) but I'm programming in Swift so I'm not handling any of that directly. I then thought maybe it was the result of some closures keeping things around so I made sure to use weak self in those. I've also theorized that some notifications were keeping things around but I've unregistered those notifications in deint.


Is this a bug in XCode 7 (it only started happening when I upgraded to XCode 7 on this app) or something my app's user's could face?

Has anyone else seen this?

Probably a bug. It's for sure not a memory management issue. When an app terminates for any reason, its entire memory address space is wiped. Any leaks or strong-reference cycles are wiped up and meaningless after that point. I've never observed your issue. Have you filed a bug at bugreport.apple.com?


Oh, and about the not showing up in Activity Monitor: are you using the hierarchial process view? The app is actually being run as a child process of debugserver, which itself it a child process of Xcode.

Thanks, yeah I'm thinking it's a bug.


No it doesn't show when I'm using the heirrarchial process view.

In fact when the app terminates, debugserver terminates too but it's almost as if El Capitan's dock doesn't get the message that the app has terminated.


I haven't filed a report yet, guess I'll have to.

Accepted Answer

Next time it happens, try restarting the Dock using either Activity Monitor or this command in Terminal: killall Dock


That should help you figure out if the Dock is not updating properly.

Yep, that fixed it. Maybe it's an El Capitan problem then, not XCode.

Thanks. I forgot I could restart the Dock by killing it.

Regardless of whether or not it's a problem with El Capitan or Xcode, definitely file a bug. Here's the link: bugreport.apple.com


Good luck with your app! 🙂

App being debugged doesn't close when execution halted
 
 
Q