Extension remained dirty for too long after trying to exit

I've implemented a VPN app (using Packet Tunnel Provider) for macOS, and one of my users reported a problem -
sometimes his app crashes. It's not always reproduces for him, and it might happen mainly after the Mac awakes from sleep.
I didn't find any problems so I've asked the Console logs, and there I saw some related prints - this is probably the related log:
  • "Extension remained dirty for too long after trying to exit. Killing."

But also a lot of other "weird" prints, like:
  • "com.apple.xpc.launchd[1] (com.apple.mdworker.single.07000000-0300-0000-0000-000000000000[56993]): Service exited due to SIGKILL"

  • "BUG in libdispatch client: vnode, monitored resource vanished before the source cancel handler was invoked { 0x7fe30d92c160[source], ident: 5 / 0x5, handler: 0x10413dbfd }"

  • "com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.user.501): Service "com.apple.xpc.launchd.unmanaged.loginwindow.204" tried to register for endpoint "com.apple.tsm.uiserver" already registered by owner: com.apple.TextInputMenuAgent"

It seems this error is related to the OS, am I correct?
How can I solve this?


It looks like launchd is trying to communicate with your extension via XPC and it is timing out for some reason, and launchd recognizes this and is killing the extension because it's just lingering in a non-reachable state. That's why I am think you are seeing Service exited due to SIGKILL. Checkout the crash logs for this to see if it provides you any more information.

Is there anything that puts the Extension in a stale state that could be handled in your sleep / wake lifecycle?

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Extension remained dirty for too long after trying to exit
 
 
Q