Program exited with code 0

Running a workout-processing application.


Continually hit with Program ended with exit code 0.


Application listens for data from phone once per second and updates the views as necessary. With workout-processing flag, I understand, we are allowed to update the UI (on GUI thread of course) while users wrist is down or watch screen not on. Application also queries the health store for heart rate data.


Device Logs have this SandboxViolation that seems to coordinate with the crash, other than that, no breakpoint exception, no crash log in the Device Organizer. A bit stumped.


kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftCore.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftCoreGraphics.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftCoreLocation.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftDarwin.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftDispatch.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftFoundation.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftHomeKit.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftMapKit.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftObjectiveC.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftSceneKit.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftSwiftOnoneSupport.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftUIKit.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftWatchKit.dylib

kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/73F98FD5-9F5C-4B3A-9473-8C32DC9A1DEF/watch.app/Frameworks/libswiftsimd.dylib


Thanks for the help!

Answered by josh527 in 194593022

Ok, this is resolved.


Watched this WWDC video and saw another post somewhere that mentioned the artificial memory limit for apps. The ceiling is set at 30mb.

https://developer.apple.com/videos/play/wwdc2016/227/


Set up instruments and watched my application and saw the app crashing as it hit the 30mb limit.. my issue was a memory leak. Hope this helps anyone else if they fail to see that they are hitting a memory limit with the lack of information output when the system claims your process. (Program exited with code 0)

One additional note is.. i have seen maybe once or twice the error 0x8badf00d:

The exception code

0x8badf00d
indicates that an application has been terminated by iOS because a watchdog timeout occurred. The application took too long to launch, terminate, or respond to system events. One common cause of this is doing synchronous networking on the main thread. Whatever operation is on
Thread 0
needs to be moved to a background thread, or processed differently, so that it does not block the main thread.

But this error comes up in the device logs inconsistently and not always when i experience the exit code 0. The app also is not doing much on the main thread. updating a couple labels and some images on maybe 2 or 3 pages whilst backgrounded.

Accepted Answer

Ok, this is resolved.


Watched this WWDC video and saw another post somewhere that mentioned the artificial memory limit for apps. The ceiling is set at 30mb.

https://developer.apple.com/videos/play/wwdc2016/227/


Set up instruments and watched my application and saw the app crashing as it hit the 30mb limit.. my issue was a memory leak. Hope this helps anyone else if they fail to see that they are hitting a memory limit with the lack of information output when the system claims your process. (Program exited with code 0)

Program exited with code 0
 
 
Q