DeviceCheck Framework Crash: DCAnalytics nil Dictionary Insertion in Production

We're experiencing crashes in our production iOS app related to Apple's DeviceCheck framework. The crash occurs in DCAnalytics internal performance tracking, affecting some specific versions of iOS 18 (18.4.1, 18.5.0).

Crash Signature

CoreFoundation: -[__NSDictionaryM setObject:forKeyedSubscript:] + 460
DeviceCheck: -[DCAnalytics sendPerformanceForCategory:eventType:] + 236

Observed Patterns

Scenario 1 - Token Generation: Crashed: com.appQueue EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010

DeviceCheck: -[DCDevice generateTokenWithCompletionHandler:]

Thread: Background dispatch queue

Scenario 2 - Support Check: Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000008

DeviceCheck: -[DCDevice _isSupportedReturningError:]
DeviceCheck: -[DCDevice isSupported]

Thread: Main thread


Root Cause Analysis

The DCAnalytics component within DeviceCheck attempts to insert a nil value into an NSMutableDictionary when recording performance metrics, indicating missing nil validation before dictionary operations.

Reproduction Context

Crashes occur during standard DeviceCheck API usage:

  1. Calling DCDevice.isSupported property
  2. Calling DCDevice.generateToken(completionHandler:) (triggered by Firebase App Check SDK)

Both operations invoke internal analytics that fail with nil insertion attempts.

Concurrency Considerations

We've implemented sequential access guards around DeviceCheck token generation to prevent race conditions, yet crashes persist. This suggests the issue likely originates within the DeviceCheck framework's internal implementation rather than concurrent access from our application code.

Note: Scenario 2 occurs through Firebase SDK's App Check integration, which internally uses DeviceCheck for attestation.


Request

Can Apple engineering confirm if this is a known issue with DeviceCheck's analytics subsystem? Is there a recommended workaround to disable DCAnalytics or ensure thread-safe DeviceCheck API usage?

Any guidance on preventing these crashes would be appreciated.

DeviceCheck Framework Crash: DCAnalytics nil Dictionary Insertion in Production
 
 
Q