iOS app crashes when published, but not in test and not in Apple review

1

Rather a strange one and one that I am at a loss to solve.

My IOS app runs on all my devices from Xcode. I then submitted it for testing by three external people using TestFlight. The app works as expected. I then submitted it for publication on the iTunes store and, after three rounds of rejection (not for the app itself, but the store listing), it was accepted. It was working for the Apple reviewers because they sent me screen shots and the app connected with my server, and they would have rejected it had it not worked.

The app was published but when it is downloaded from iTunes by me, my testers, or any others it immediately crashes. The LaunchScreen holding storyboard is displayed and then the app quits immediately. I have removed all the code I had for setting up a periodic background task in AppDelegate - there is now only a debug line there (which is not printed when the app crashes) and republished but it still crashes.

The app uses the following PODs:

pod 'TPInAppReceipt'
pod 'IQKeyboardManagerSwift'
pod 'GRDB.swift'
pod 'Alamofire', '~> 4.0'
pod 'Gloss'
pod 'DLRadioButton', '~> 1.4'
pod 'Cosmos', '~> 7.0'
pod 'SwiftEventBus',  :tag => '2.2.0', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
pod 'UITextView+Placeholder'

Here is the Console Log:

Jul 23 10:53:30 Camerons-iPhone atc(AirTrafficDevice)[31] <Notice>: <ATLegacyMessageLink: 0x16d88330, wifi=0> ---> [Ping Request. id=90, Session=0, params=(null)]
Jul 23 10:53:30 Camerons-iPhone SpringBoard(Security)[49] <Notice>: could not enable test hierarchy: ApplePinningAllowTestCertsiPhoneApplicationSigning not true
Jul 23 10:53:30 Camerons-iPhone SpringBoard(Security)[49] <Notice>: could not enable test hierarchy: ApplePinningAllowTestCertsiPhoneApplicationSigning not true
Jul 23 10:53:30 Camerons-iPhone SpringBoard[49] <Notice>: Running <SBAppToAppWorkspaceTransaction: 0x9cb1b70> for transition request:
<SBMainWorkspaceTransitionRequest: 0x9be8b90; eventLabel: ActivateApplication = com.cbnewham.keyholderi; display: Main; source: HomeScreen> {
    applicationContext = <SBWorkspaceApplicationTransitionContext: 0x9954c70; background: NO> entities = {
        SBLayoutPrimaryRole = <SBWorkspaceApplication: 0x9895490; ID: com.cbnewham.keyholderi; layoutRole: primary>;
    };
}
Jul 23 10:53:30 Camerons-iPhone assertiond[64] <Notice>: Submitted job with label: UIKitApplication:com.cbnewham.keyholderi[0x54c1][64]
Jul 23 10:53:30 Camerons-iPhone SpringBoard(AssertionServices)[49] <Notice>: [com.cbnewham.keyholderi] Bootstrap complete with label: UIKitApplication:com.cbnewham.keyholderi[0x54c1][64]
Jul 23 10:53:30 Camerons-iPhone SpringBoard[49] <Notice>: Disabling home screen icon rotation for reason: SBAppToAppWorkspaceTransaction
Jul 23 10:53:30 Camerons-iPhone SpringBoard[49] <Notice>: Disabling home screen icon rotation for reason: <SBCrossfadeIconZoomAnimator:0x9b2bb60>
Jul 23 10:53:30 Camerons-iPhone SpringBoard(MobileCoreServices)[49] <Notice>: Looking up unclipped icon for app <private>
Jul 23 10:53:30 Camerons-iPhone SpringBoard[49] <Notice>: Dismissing banner for notification (null)
Jul 23 10:53:30 Camerons-iPhone sharingd[32] <Notice>: SystemUI unknown identifier: 'com.cbnewham.keyholderi'
Jul 23 10:53:30 Camerons-iPhone SpringBoard(CoreMotion)[49] <Notice>: Stopping device motion, mode=0x<private>
Jul 23 10:53:30 Camerons-iPhone CommCenter[23] <Notice>: #I CSIAppInfo.AppObserver: observe_block_invoke: FBSDisplayLayoutUpdateHandler: update start
Jul 23 10:53:30 Camerons-iPhone mediaserverd(CoreMedia)[42] <Notice>: -CMSessionMgr- cmsmHandleApplicationStateChange: CMSession: Client com.cbnewham.keyholderi with pid '249' is now Foreground Running. Background entitlement: NO
Jul 23 10:53:30 Camerons-iPhone CommCenter[23] <Notice>: #I CSIAppInfo.AppObserver: observe_block_invoke: FBSDisplayLayoutUpdateHandler: app <private> (UIApplicationElement 1 hasKeyboardFocus 0)
Jul 23 10:53:30 Camerons-iPhone sharingd[32] <Notice>: SystemUI changed: 0x10 -> 0x0
Jul 23 10:53:30 Camerons-iPhone backboardd[63] <Notice>: Turning on orientation events.
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: fHasSeenACaseLatchCoverOnce, 0
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Starting orientation detection with accelFrequency 10.000000, isIpad, 0, decimationRate, 1
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Waiting for the first orientation to come in
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Notify from, Unexpected -> FaceUp
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Received orientation. (Ambiguous to FaceUp) Timestamp 1311.992493
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Updating client handler: Orientation FaceUp, Callback mode: -1
Jul 23 10:53:30 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Got latest sample: 5 @ 1311.992493
Jul 23 10:53:30 Camerons-iPhone backboardd[63] <Notice>: Effective device orientation changed to: faceUp
Jul 23 10:53:30 Camerons-iPhone itunesstored(iTunesStore)[95] <Error>: Could not load library [21]
Jul 23 10:53:30 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TCP Conn Start [21:0x167317e0]
Jul 23 10:53:30 Camerons-iPhone CommCenter[23] <Notice>: #I CSIAppInfo.AppObserver: observe_block_invoke: 4. app got notification state: pid=249 for <private>
Jul 23 10:53:30 Camerons-iPhone CommCenter[23] <Notice>: #I CSIAppInfo.AppObserver: notifyAboutFrontAppChange: notifyAboutFrontAppChange : app: <private>; pid: 249; net: 0
Jul 23 10:53:30 Camerons-iPhone CommCenter[23] <Notice>: #I CSIAppInfo.AppObserver: observe_block_invoke: 5. app got notification state: new counter=14
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: 249 com.cbnewham.keyholderi: ForegroundRunning (most elevated: ForegroundRunning)
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: Entry, display name com.cbnewham.keyholderi uuid 8FB68BCF-EA10-3E5C-B86C-A3E01F303CF7 pid 249 isFront 1
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: Check for bundle name com.cbnewham.keyholderi returns 0
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: app name com.cbnewham.keyholderi isForeground 1  hasForegroundApps 1, current idea of foreground 0 disp (null)
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: Going to Foreground, new flags 0x0, initial value 0x0, enabled 0
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: Continue with bundle name com.cbnewham.keyholderi, is front 1
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: com.cbnewham.keyholderi: Foreground: true
Jul 23 10:53:30 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: Set appCompactState object 0 for key com.cbnewham.keyholderi
Jul 23 10:53:30 Camerons-iPhone CommCenter[23] <Notice>: #I BundleID: <private> is a foreground app
Jul 23 10:53:31 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: CFSM2 foreground (current/proposed/state) in = (0/1/2)
Jul 23 10:53:31 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: CFSM2 foreground (current/state) out = (1/1)
Jul 23 10:53:31 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: CFSM Current state: idle, changed: systemForeground to 1 for net type 0, eligible for alerted but constraints unsatisfied (1,0,0,0)
Jul 23 10:53:31 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: CFSM Current state: idle, changed: systemForeground to 1 for net type 0, ineligible for committed as nil pred, wifi (0x0) cell (0x0)
Jul 23 10:53:31 Camerons-iPhone symptomsd(SymptomEvaluator)[133] <Notice>: CFSM Relays: cell (active-no/primary-no/knowngood-no/rssithresh-ok/txthresh-ok/arp-ok/dns-ok/tcp-ok/lqm:-2/advisory:0) wifi (active/primary/knowngood/rssithresh-ok/txthresh-ok/arp-ok/dns-ok/tcp-ok/lqm:50/advisory:5)
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: Client com.cbnewham.keyholderi connected
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: getClientEffectiveRegistrationResult, /private/var/containers/Bundle/Application/99081F2A-DB4B-4E69-A354-C4F89BAED901/Keyholder.app/Keyholder, com.cbnewham.keyholderi, , CLClientRegistrationResult, kCLClientRegistrationResultFailedUnavailable, CLCommonLocationServicesEnabled, 1
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: message 'kCLConnectionMessageRegistration' received from client 'com.cbnewham.keyholderi'
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: getClientEffectiveRegistrationResult, /private/var/containers/Bundle/Application/99081F2A-DB4B-4E69-A354-C4F89BAED901/Keyholder.app/Keyholder, com.cbnewham.keyholderi, , CLClientRegistrationResult, kCLClientRegistrationResultFailedUnavailable, CLCommonLocationServicesEnabled, 1
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: getClientEffectiveRegistrationResult, /private/var/containers/Bundle/Application/99081F2A-DB4B-4E69-A354-C4F89BAED901/Keyholder.app/Keyholder, com.cbnewham.keyholderi, , CLClientRegistrationResult, kCLClientRegistrationResultFailedUnavailable, CLCommonLocationServicesEnabled, 1
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: message 'kCLConnectionMessagePausesLocationUpdatesAutomatically' received from client 'com.cbnewham.keyholderi'
Jul 23 10:53:31 Camerons-iPhone geod(CFNetwork)[99] <Notice>: TIC TCP Conn Start [22:0x14e15e80]
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TCP Conn Event [21:0x167317e0]: 1 Err(0)
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TCP Conn Connected [21:0x167317e0]: Err(0)
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC Enabling TLS [21:0x167317e0]
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I New CTServerConnection from pid 249 (conn=0x165047d0)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I  -- connection has entitlements: <private>
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I New CTServerConnection from pid 249 (conn=0x1658c280)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I CTServerConnection from pid 249[<private>] is named '<private>'.
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventRestrictedForegroundResume(171) (now total 1)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventPublicCallStatus(174) as alternate to kCTEventCallStatus(1) (now total 2)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventPublicCallSubType(175) as alternate to kCTEventCallSubType(3) (now total 3)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventPublicAlternateCallStatus(179) as alternate to kCTEventAlternateCallStatus(116) (now total 4)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventPublicCallIdentification(176) as alternate to kCTEventCallIdentification(4) (now total 5)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #E Client 249 (<private>) not permitted to register for event kCTEventCallForwarded(5); ignored registration
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventPublicCallCauseCode(178) as alternate to kCTEventCallCauseCode(7) (now total 6)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I   ==== client 249 (<private>) registered for event kCTEventPublicCallControlError(177) as alternate to kCTEventCallControlError(6) (now total 7)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #E Client 249 (<private>) not permitted to register for event kCTEventCallInputFrequencyLevel(163); ignored registration
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #E Client 249 (<private>) not permitted to register for event kCTEventCallOutputFrequencyLevel(164); ignored registration
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #E Client 249 (<private>) not permitted to register for event kCTEventPullCallIsPossible(165); ignored registration
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I CTServerConnection from pid 249[<private>] is named '<private>'.
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #E Client 249 (<private>) not permitted to register for event kCTEventRegistrationOperatorName(45); ignored registration
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I App state[<private>(249)] is moving from kUnknown to kInForegroundUnknownRestriction
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I App state[<private>(249)] is moving from kInForegroundUnknownRestriction to kInForegroundRestricted
Jul 23 10:53:31 Camerons-iPhone geod(CFNetwork)[99] <Notice>: TIC TCP Conn Event [22:0x14e15e80]: 1 Err(0)
Jul 23 10:53:31 Camerons-iPhone SpringBoard(KeyboardArbiter)[49] <Error>: HW kbd: Failed to set (null) as keyboard focus
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: Client com.cbnewham.keyholderi disconnected
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I CTServerConnection from pid 249 has closed (conn=0x165047d0)
Jul 23 10:53:31 Camerons-iPhone geod(CFNetwork)[99] <Notice>: TIC TCP Conn Connected [22:0x14e15e80]: Err(0)
Jul 23 10:53:31 Camerons-iPhone CommCenter[23] <Notice>: #I CTServerConnection from pid 249 has closed (conn=0x1658c280)
Jul 23 10:53:31 Camerons-iPhone backboardd[63] <Notice>: Turning off orientation events.
Jul 23 10:53:31 Camerons-iPhone backboardd(CoreMotion)[63] <Notice>: Stopping orientation detection.
Jul 23 10:53:31 Camerons-iPhone backboardd[63] <Notice>: Effective device orientation changed to: unknown
Jul 23 10:53:31 Camerons-iPhone geod(CFNetwork)[99] <Notice>: TIC Enabling TLS [22:0x14e15e80]
Jul 23 10:53:31 Camerons-iPhone ReportCrash(CrashReporterSupport)[250] <Notice>: cr_update: <private>
Jul 23 10:53:31 Camerons-iPhone ReportCrash(CrashReporterSupport)[250] <Notice>: cr_update: <private>
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: {"msg":"adapter details", "adaperDescription":"usb host", "batteryChargerType":"kChargerTypeUsb"}
Jul 23 10:53:31 Camerons-iPhone locationd[67] <Notice>: {"msg":"battery capacity info", "batteryStatus":"{"level":96.000000, "charged":false, "connected":true, "chargerType":"kChargerTypeUsb", "wasConnected":false", "":"", "currentCapacity":"1440", "maximumCapacity":"1500", "batteryIsDifferent":"1"}
Jul 23 10:53:31 Camerons-iPhone coreduetd[82] <Notice>: CDDBatteryMonitor:  received batterycallback, currentPercentage:96.000000!
Jul 23 10:53:31 Camerons-iPhone coreduetd[82] <Notice>: CDDBatteryMonitor:  Notifying battery change for BON calculation!
Jul 23 10:53:31 Camerons-iPhone powerd[62] <Notice>: Battery capacity change posted with value 0x2b0060
Jul 23 10:53:31 Camerons-iPhone SpringBoard(BatteryCenter)[49] <Notice>: Power sources changed
Jul 23 10:53:31 Camerons-iPhone SpringBoard(BatteryCenter)[49] <Notice>: Query power sources
Jul 23 10:53:31 Camerons-iPhone powerd[62] <Notice>: Battery time remaining posted. Capacity:0x60
Jul 23 10:53:31 Camerons-iPhone SpringBoard(BatteryCenter)[49] <Notice>: Got a list of 1 sources
Jul 23 10:53:31 Camerons-iPhone SpringBoard(BatteryCenter)[49] <Notice>: Found 1 power sources
Jul 23 10:53:31 Camerons-iPhone SpringBoard(BatteryCenter)[49] <Notice>: Found power source: {
    "Battery Provides Time Remaining" = 1;
    BatteryHealth = Good;
    Current = 1000;
    "Current Capacity" = 96;
    DesignCycleCount = 300;
    "Is Charging" = 1;
    "Is Finishing Charge" = 0;
    "Is Present" = 1;
    "Max Capacity" = 100;
    Name = "InternalBattery-0";
    "Power Source ID" = 4063331;
    "Power Source State" = "AC Power";
    "Raw External Connected" = 1;
    "Show Charging UI" = 1;
    "Time to Empty" = 0;
    "Time to Full Charge" = 0;
    "Transport Type" = Internal;
    Type = InternalBattery;
}
Jul 23 10:53:31 Camerons-iPhone SpringBoard(BatteryCenter)[49] <Notice>: Found device: <BCBatteryDevice: 0x6f51b70; vendor = Apple; productIdentifier = 0; parts = (null); identifier = 4063331; matchIdentifier = (null); baseIdentifier = InternalBattery-0; name = iPhone; groupName =InternalBattery-0; percentCharge = 96; lowBattery = NO; connected = YES; charging = YES; internal = YES; powerSource = YES; poweredSoureState = AC Power; transportType = 1 >
Jul 23 10:53:31 Camerons-iPhone coreduetd[82] <Notice>: BatteryConditionChange: device:0, batteryLevel:96, isConnectedToCharger:1
Jul 23 10:53:31 Camerons-iPhone coreduetd[82] <Notice>: No change in Local BON: 101.
Jul 23 10:53:31 Camerons-iPhone securityd[94] <Notice>: cert[0]: NonEmptySubject =(leaf)[]> 0
Jul 23 10:53:31 Camerons-iPhone securityd[94] <Notice>: cert[0]: AnchorTrusted =(leaf)[force]> 0
Jul 23 10:53:31 Camerons-iPhone securityd[94] <Notice>: cert[0]: NonEmptySubject =(leaf)[]> 0
Jul 23 10:53:31 Camerons-iPhone securityd[94] <Notice>: cert[0]: AnchorTrusted =(leaf)[force]> 0
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TLS Event [21:0x167317e0]: 2, Pending(0)
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TLS Event [21:0x167317e0]: 11, Pending(0)
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TLS Event [21:0x167317e0]: 14, Pending(0)
Jul 23 10:53:31 Camerons-iPhone SpringBoard[49] <Notice>: Destination SBNotificationBannerDestination is now ready to receive notifications
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TLS Trust Result [21:0x167317e0]: 0
Jul 23 10:53:31 Camerons-iPhone ReportCrash[250] <Notice>: Formulating report for corpse[249] <private>
Jul 23 10:53:31 Camerons-iPhone securityd[94] <Notice>: cert[0]: NonEmptySubject =(leaf)[]> 0
Jul 23 10:53:31 Camerons-iPhone securityd[94] <Notice>: cert[0]: AnchorTrusted =(leaf)[force]> 0
Jul 23 10:53:31 Camerons-iPhone ReportCrash(MobileCoreServices)[250] <Notice>: notify_register_check() failed with error 1000000
Jul 23 10:53:31 Camerons-iPhone DuetHeuristic-BM(DuetActivitySchedulerDaemon)[91] <Notice>: Trigger: <private> is now [96]
Jul 23 10:53:31 Camerons-iPhone ReportCrash(CrashReporterSupport)[250] <Notice>: Saved type '109(<private>)' report (6 of max 25) at <private>
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TLS Event [21:0x167317e0]: 20, Pending(0)
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TCP Conn Event [21:0x167317e0]: 8 Err(0)
Jul 23 10:53:31 Camerons-iPhone itunesstored(CFNetwork)[95] <Notice>: TIC TLS Handshake Complete [21:0x167317e0]
Jul 23 10:53:32 Camerons-iPhone SpringBoard(FrontBoard)[49] <Notice>: <FBApplicationProcess: 0x9bdf9e0; Keyholder; pid: 249> crashed.
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Process exited: <FBApplicationProcess: 0x9bdf9e0; Keyholder; pid: -1> -> <FBApplicationProcessExitContext: 0x16e0b540; exitReason: crash; terminationReason: (none)>
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Undimming for source: programmatic
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: returning the workspace lock time (180.000000) from _nextLockTimeDuration
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: returning the workspace dim time (160.000000) from _nextIdleTimeDuration
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Setting next idle duration (source:1) to: 160.000000 lockAfterDim: 20.000000
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Setting _lastBKUserEventTimerMode=2 with duration=160.000000
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Undimming for source: programmatic
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: returning the workspace lock time (180.000000) from _nextLockTimeDuration
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: returning the workspace dim time (160.000000) from _nextIdleTimeDuration
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Setting next idle duration (source:1) to: 160.000000 lockAfterDim: 20.000000
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Setting _lastBKUserEventTimerMode=2 with duration=160.000000
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Undimming for source: programmatic
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: returning the workspace lock time (180.000000) from _nextLockTimeDuration
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: returning the workspace dim time (160.000000) from _nextIdleTimeDuration
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Setting next idle duration (source:1) to: 160.000000 lockAfterDim: 20.000000
Jul 23 10:53:32 Camerons-iPhone SpringBoard[49] <Notice>: Setting _lastBKUserEventTimerMode=2 with duration=160.000000
Jul 23 10:53:32 Camerons-iPhone assertiond[64] <Notice>: Deleted job with label: UIKitApplication:com.cbnewham.keyholderi[0x54c1][64]

and here is the Stack Trace (abbreviated):

Incident Identifier: 099C3705-E9A0-4047-9154-2F8D500D4912
CrashReporter Key:   5b93dcebf8479950368ad4075619881fc9ebac50
Hardware Model:      iPhone5,4
Process:             Keyholder [249]
Path:                /private/var/containers/Bundle/Application/99081F2A-DB4B-4E69-A354-C4F89BAED901/Keyholder.app/Keyholder
Identifier:          com.cbnewham.keyholderi
Version:             9 (1.1.1)
Code Type:           ARM (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.cbnewham.keyholderi [407]


Date/Time:           2017-07-23 10:53:31.3838 +0100
Launch Time:         2017-07-23 10:53:30.0000 +0100
OS Version:          iPhone OS 10.3.1 (14E304)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000018
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib              0x009995ce 0x74c000 + 2414030
1   Keyholder                       0x000953c8 0x20000 + 480200
2   Keyholder                       0x000927e8 0x20000 + 468968
3   Keyholder                       0x00092cb8 0x20000 + 470200
4   UIKit                           0x2083d4fc -[UIViewController _setViewAppearState:isAnimating:] + 392
5   UIKit                           0x2083d34e -[UIViewController __viewWillAppear:] + 140
6   UIKit                           0x2089f4ee -[UIViewController viewWillMoveToWindow:] + 452
7   UIKit                           0x2082de24 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 560
8   UIKit                           0x2082d1fc -[UIView(Internal) _addSubview:positioned:relativeTo:] + 406
9   UIKit                           0x2082d052 -[UIView(Hierarchy) addSubview:] + 730
10  UIKit                           0x2082c660 -[UIWindow addRootViewControllerViewIfPossible] + 510
11  UIKit                           0x20829a0a -[UIWindow _setHidden:forced:] + 286
12  UIKit                           0x20899560 -[UIWindow makeKeyAndVisible] + 42
13  UIKit                           0x20a96f52 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3906
14  UIKit                           0x20a9c05c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1640
15  UIKit                           0x20aaec8c __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3153 + 40
16  UIKit                           0x20a9979a -[UIApplication workspaceDidEndTransaction:] + 142
17  FrontBoardServices              0x1ced8c12 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 18
18  FrontBoardServices              0x1ced8acc -[FBSSerialQueue _performNext] + 220
19  FrontBoardServices              0x1ced8db6 -[FBSSerialQueue _performNextFromRunLoopSource] + 44
20  CoreFoundation                  0x1b5b3fdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
21  CoreFoundation                  0x1b5b3b04 __CFRunLoopDoSources0 + 424
22  CoreFoundation                  0x1b5b1f50 __CFRunLoopRun + 1160
23  CoreFoundation                  0x1b5050ee CFRunLoopRunSpecific + 470
24  CoreFoundation                  0x1b504f10 CFRunLoopRunInMode + 104
25  UIKit                           0x2088f254 -[UIApplication _run] + 660
26  UIKit                           0x20889e82 UIApplicationMain + 150
27  Keyholder                       0x000284a8 0x20000 + 33960
28  libdyld.dylib                   0x1acf24ea start + 2

Thread 1:
0   libsystem_pthread.dylib         0x1ae7a4c4 start_wqthread + 0

Thread 2 name:  Dispatch queue: GRDB.SerializedDatabase
Thread 2:
0   libsystem_kernel.dylib          0x1adb16e4 pread + 20
1   libsqlite3.dylib                0x1bac34c2 0x1ba4d000 + 484546
2   libsqlite3.dylib                0x1ba54b38 0x1ba4d000 + 31544
3   libsqlite3.dylib                0x1ba6df76 0x1ba4d000 + 135030
4   libsqlite3.dylib                0x1bab954e 0x1ba4d000 + 443726
5   libsqlite3.dylib                0x1bacead4 0x1ba4d000 + 531156
6   libsqlite3.dylib                0x1ba93a6c 0x1ba4d000 + 289388
7   libsqlite3.dylib                0x1bace6b2 0x1ba4d000 + 530098
8   libsqlite3.dylib                0x1ba85a7e 0x1ba4d000 + 232062
9   libsqlite3.dylib                0x1ba7e59a sqlite3_step + 442
10  GRDB                            0x004cb05c 0x3dc000 + 979036
11  GRDB                            0x004cb310 0x3dc000 + 979728
12  GRDB                            0x003e5890 0x3dc000 + 39056
13  GRDB                            0x003e5990 0x3dc000 + 39312
14  GRDB                            0x003e3528 0x3dc000 + 29992
15  GRDB                            0x0048a070 0x3dc000 + 712816
16  GRDB                            0x0048199c 0x3dc000 + 678300
17  GRDB                            0x004818c0 0x3dc000 + 678080
18  Keyholder                       0x0005307c 0x20000 + 209020
19  Keyholder                       0x00054e0c 0x20000 + 216588
20  Keyholder                       0x00055714 0x20000 + 218900
21  Keyholder                       0x00054ed4 0x20000 + 216788
22  GRDB                            0x004163c4 0x3dc000 + 238532

Thread 3:
0   libsystem_pthread.dylib         0x1ae7a4c4 start_wqthread + 0

Thread 4 name:  Dispatch queue: com.apple.CoreLocation.ConnectionClient.0x15592ad0.events
Thread 4:
0   libsystem_kernel.dylib          0x1adb0968 semaphore_timedwait_trap + 8
1   libdispatch.dylib               0x1acd69de _os_semaphore_timedwait + 70
2   libdispatch.dylib               0x1acd607e _dispatch_semaphore_wait_slow + 56
3   CoreLocation                    0x2269a388 0x22697000 + 13192
4   CoreLocation                    0x226a0b9e 0x22697000 + 39838
5   CoreLocation                    0x226a08ce 0x22697000 + 39118
6   CoreLocation                    0x226ef272 0x22697000 + 361074
7   CoreLocation                    0x226eb68c 0x22697000 + 345740
8   CoreLocation                    0x226eb55a 0x22697000 + 345434
9   CoreLocation                    0x226ece90 0x22697000 + 351888
10  libxpc.dylib                    0x1aea3914 _xpc_connection_call_event_handler + 40
11  libxpc.dylib                    0x1aea1dcc 

Thread 5 name:  com.apple.uikit.eventfetch-thread
Thread 5:
0   libsystem_kernel.dylib          0x1adb0900 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x1adb06e0 mach_msg + 44
2   CoreFoundation                  0x1b5b3be2 __CFRunLoopServiceMachPort + 144

So it's getting a segmentation fault. I'm none the wiser as this works everywhere except when published! Do Apple change the binary when it is uploaded to the store? Or is there some difference when the binary is executed from iTunes as the source as opposed to from anywhere else.

ios
exc-bad-access
asked on Stack Overflow Jul 23, 2017 by cbn • edited Jul 23, 2017 by rmaddy

1 Answer

1

In case anyone is wondering what happened with this, I have now solved it (it took quite a long time because I had to await approval to be published on the app store on every single time I changed the code).

The reason for the crash was an attempt to access an array with no items. The reason it only occurred when published on Apple's Store is because the section of code with the illegal access was only executed for testing whether the user had a subscription. This was never executed when the app was run by me, beta testers (using TestFlight) and, most damning of all, the Apple Reviewers themselves - it seems their own test devices are not running in the same environment a real public device has. The code only executes on a non-test device (i.e.: when the code is published and is downloaded by a device outside Apple's test environment with a real Apple account).

All of the trouble I had could have been avoided if a) Minor code changes don't require 2 to 3 day turn-arounds (occasionally rejected by Apple reviewers for no real reason), b) Stack traces that actually give proper information (illegal array access rather than just saying it's a "bad access", which could be anything), and c) only one way to print to the console rather than three different ways, only one of which will actually provide debug output on a published app.

I hope the above will be of use to anyone that runs into this issue in the future.

answered on Stack Overflow Oct 23, 2017 by cbn

User contributions licensed under CC BY-SA 3.0