Skip to content

iOS Crash in DocumentCaptureViewController During Auto-Capture Timeout (Onfido iOS SDK 32.8.0) #57161

Description

@raj21kadam-cd

Description

Environment:
Onfido React Native SDK: 15.5.0
Onfido iOS SDK: 32.8.0
React Native Application
iOS devices (exact device/OS versions can be provided if needed)
Issue Summary:
We are experiencing a native iOS crash within the Onfido SDK during document capture. The crash appears to occur when the document auto-capture flow times out.
Crash Details:
The main thread crashes in:
DocumentCaptureViewController.autoCaptureTimedOut()
Top of stack:
0 Onfido
DocumentCaptureViewController.autoCaptureTimedOut()
1 Onfido
closure invocation
2 libdispatch.dylib
_dispatch_call_block_and_release
Relevant Background Thread:
com.onfido.queue.image.processing
CoreGraphics
CGDataProviderRetainBytePtr
CGDataProviderDirectGetBytesAtPositionInternal
CGContextDrawImage
Onfido
UIImage.buffer()
CoreMLProcessor.process()
BoundingBoxMLProcessor.process()
DocumentFrameProcessor.process()
Observed Behavior:
Crash occurs during document capture.
The crash appears around the auto-capture timeout path.
Stack trace shows image processing running on com.onfido.queue.image.processing while the timeout callback is executing on the main thread.
Crash is occurring entirely inside the native Onfido SDK; no application code is present in the crashing call stack.
Expected Behavior:
The SDK should safely handle auto-capture timeout and image-processing cleanup without causing an application crash.
Questions:
Is this a known issue in Onfido iOS SDK 32.8.0?
Has this been fixed in a newer iOS SDK release?
Are there any recommended mitigations or configuration changes to avoid this crash?
Can you confirm whether this may be related to document auto-capture timeout interacting with image-processing threads?

Steps to reproduce

open Onfido

React Native Version

15.1.0

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.6.1
  CPU: (12) arm64 Apple M4 Pro
  Memory: 144.73 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.19.0
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.3
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/raj.kadam/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2513.14007798
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.3.2
    path: /Users/raj.kadam/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.3
    wanted: ^20.0.2
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.5
    wanted: 0.81.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

Crashed: com.apple.main-thread
0  Onfido                         0x12bda4 $s6Onfido29DocumentCaptureViewControllerC04autoC8TimedOutyyFyyScMYccfU_ + 436
1  Onfido                         0x237f0 $sIegh_IeyBh_TR + 28
2  libdispatch.dylib              0x19a8 _dispatch_call_block_and_release + 32
3  libdispatch.dylib              0x1b1e4 _dispatch_client_callout + 16
4  libdispatch.dylib              0x38e10 _dispatch_main_queue_drain.cold.6 + 832
5  libdispatch.dylib              0x10964 _dispatch_main_queue_drain + 176
6  libdispatch.dylib              0x108a4 _dispatch_main_queue_callback_4CF + 44
7  CoreFoundation                 0xa2030 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
8  CoreFoundation                 0x2f604 __CFRunLoopRun + 1944
9  CoreFoundation                 0x2e54c _CFRunLoopRunSpecificWithOptions + 532
10 GraphicsServices               0x1498 GSEventRunModal + 120
11 UIKitCore                      0x121244 -[UIApplication _run] + 796
12 UIKitCore                      0x8c158 UIApplicationMain + 332
13 TorFX                          0x538c main + 7 (AppDelegate.swift:7)
14 ???                            0x182e61c1c (Missing)

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0xcd4 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x430c mach_msg2_internal + 76
2  libsystem_kernel.dylib         0x422c mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4078 mach_msg + 24
4  CoreFoundation                 0x65344 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x2f310 __CFRunLoopRun + 1188
6  CoreFoundation                 0x2e54c _CFRunLoopRunSpecificWithOptions + 532
7  Foundation                     0xacf0 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0xabd8 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  UIKitCore                      0xe6a7c -[UIEventFetcher threadMain] + 420
10 Foundation                     0x8e824 __NSThread__start__ + 732
11 libsystem_pthread.dylib        0x4438 _pthread_start + 136
12 libsystem_pthread.dylib        0x8cc thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
0  TorFX                          0x3d0774 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1  TorFX                          0x3d0b80 FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2  TorFX                          0x3c8870 FIRCLSHandler + 39 (FIRCLSHandler.m:39)
3  TorFX                          0x3cb3b0 FIRCLSMachExceptionServer + 525 (FIRCLSMachException.c:525)
4  libsystem_pthread.dylib        0x4438 _pthread_start + 136
5  libsystem_pthread.dylib        0x8cc thread_start + 8

com.facebook.react.runtime.JavaScript
0  libsystem_kernel.dylib         0xcd4 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x430c mach_msg2_internal + 76
2  libsystem_kernel.dylib         0x422c mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4078 mach_msg + 24
4  CoreFoundation                 0x65344 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x2f310 __CFRunLoopRun + 1188
6  CoreFoundation                 0x2e54c _CFRunLoopRunSpecificWithOptions + 532
7  React                          0x2a0f14 +[RCTJSThreadManager runRunLoop] + 252
8  Foundation                     0x8e824 __NSThread__start__ + 732
9  libsystem_pthread.dylib        0x4438 _pthread_start + 136
10 libsystem_pthread.dylib        0x8cc thread_start + 8

hades
0  libsystem_kernel.dylib         0x65e8 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x2b48 _pthread_cond_wait + 980
2  libc++.1.dylib                 0xcbcc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 32
3  hermes                         0xcf9c4 hermes::vm::HadesGC::Executor::worker() + 116
4  hermes                         0xcf92c void* std::__1::__thread_proxy[abi:nn180100]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, hermes::vm::HadesGC::Executor::Executor()::'lambda'()>>(void*) + 44
5  libsystem_pthread.dylib        0x4438 _pthread_start + 136
6  libsystem_pthread.dylib        0x8cc thread_start + 8

Log work queue
0  libsystem_kernel.dylib         0xc50 semaphore_wait_trap + 8
1  WebKit                         0x127c804 <redacted> + 48
2  JavaScriptCore                 0xef9b4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 356
3  JavaScriptCore                 0xf316c WTF::wtfThreadEntryPoint(void*) + 16
4  libsystem_pthread.dylib        0x4438 _pthread_start + 136
5  libsystem_pthread.dylib        0x8cc thread_start + 8

hades
0  libsystem_kernel.dylib         0x65e8 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x2b48 _pthread_cond_wait + 980
2  libc++.1.dylib                 0xcbcc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 32
3  hermes                         0xcf9c4 hermes::vm::HadesGC::Executor::worker() + 116
4  hermes                         0xcf92c void* std::__1::__thread_proxy[abi:nn180100]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, hermes::vm::HadesGC::Executor::Executor()::'lambda'()>>(void*) + 44
5  libsystem_pthread.dylib        0x4438 _pthread_start + 136
6  libsystem_pthread.dylib        0x8cc thread_start + 8

Thread
0  libsystem_kernel.dylib         0x65e8 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x2b74 _pthread_cond_wait + 1024
2  Foundation                     0x13c0b0 -[NSCondition waitUntilDate:] + 132
3  TorFX                          0x124f60 BatchWorker.main() + 108 (BatchSpanProcessor.swift:108)
4  TorFX                          0x124f90 @objc BatchWorker.main() + 1020956 (<compiler-generated>:1020956)
5  Foundation                     0x8e824 __NSThread__start__ + 732
6  libsystem_pthread.dylib        0x4438 _pthread_start + 136
7  libsystem_pthread.dylib        0x8cc thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0xcd4 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x430c mach_msg2_internal + 76
2  libsystem_kernel.dylib         0x422c mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4078 mach_msg + 24
4  CoreFoundation                 0x65344 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x2f310 __CFRunLoopRun + 1188
6  CoreFoundation                 0x2e54c _CFRunLoopRunSpecificWithOptions + 532
7  CFNetwork                      0x91b54 +[__CFN_CoreSchedulingSetRunnable _run:] + 416
8  Foundation                     0x8e824 __NSThread__start__ + 732
9  libsystem_pthread.dylib        0x4438 _pthread_start + 136
10 libsystem_pthread.dylib        0x8cc thread_start + 8

caulk::deferred_logger
0  libsystem_kernel.dylib         0xc50 semaphore_wait_trap + 8
1  caulk                          0x3c6c caulk::semaphore::timed_wait(double) + 224
2  caulk                          0x3cb8 caulk::concurrent::details::worker_thread::run() + 32
3  caulk                          0x7f54 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 96
4  libsystem_pthread.dylib        0x4438 _pthread_start + 136
5  libsystem_pthread.dylib        0x8cc thread_start + 8

caulk.messenger.shared:high
0  libsystem_kernel.dylib         0xc50 semaphore_wait_trap + 8
1  caulk                          0x3c6c caulk::semaphore::timed_wait(double) + 224
2  caulk                          0x3cb8 caulk::concurrent::details::worker_thread::run() + 32
3  caulk                          0x7f54 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 96
4  libsystem_pthread.dylib        0x4438 _pthread_start + 136
5  libsystem_pthread.dylib        0x8cc thread_start + 8

ANEServicesThread
0  libsystem_kernel.dylib         0xcd4 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x430c mach_msg2_internal + 76
2  libsystem_kernel.dylib         0x422c mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4078 mach_msg + 24
4  CoreFoundation                 0x65344 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x2f310 __CFRunLoopRun + 1188
6  CoreFoundation                 0x2e54c _CFRunLoopRunSpecificWithOptions + 532
7  CoreFoundation                 0xded64 CFRunLoopRun + 64
8  ANEServices                    0x238f0 ANE::ANEServicesThreadStart(ANE::ANEServicesThreadParams*) + 152
9  libsystem_pthread.dylib        0x4438 _pthread_start + 136
10 libsystem_pthread.dylib        0x8cc thread_start + 8

Thread
0  libsystem_pthread.dylib        0x8b8 start_wqthread + 8141244598

ANEServicesThread
0  libsystem_kernel.dylib         0xcd4 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x430c mach_msg2_internal + 76
2  libsystem_kernel.dylib         0x422c mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4078 mach_msg + 24
4  CoreFoundation                 0x65344 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x2f310 __CFRunLoopRun + 1188
6  CoreFoundation                 0x2e54c _CFRunLoopRunSpecificWithOptions + 532
7  CoreFoundation                 0xded64 CFRunLoopRun + 64
8  ANEServices                    0x238f0 ANE::ANEServicesThreadStart(ANE::ANEServicesThreadParams*) + 152
9  libsystem_pthread.dylib        0x4438 _pthread_start + 136
10 libsystem_pthread.dylib        0x8cc thread_start + 8

Thread
0  libsystem_kernel.dylib         0xa80 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x13fc _pthread_wqthread + 368
2  libsystem_pthread.dylib        0x8c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0xa80 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x13fc _pthread_wqthread + 368
2  libsystem_pthread.dylib        0x8c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0xa80 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x13fc _pthread_wqthread + 368
2  libsystem_pthread.dylib        0x8c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0xa80 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x13fc _pthread_wqthread + 368
2  libsystem_pthread.dylib        0x8c0 start_wqthread + 8

JavaScriptCore libpas scavenger
0  libsystem_kernel.dylib         0x65e8 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x2b48 _pthread_cond_wait + 980
2  JavaScriptCore                 0x18cfc10 scavenger_thread_main + 1632
3  libsystem_pthread.dylib        0x4438 _pthread_start + 136
4  libsystem_pthread.dylib        0x8cc thread_start + 8

com.onfido.queue.image.processing
0  libsystem_pthread.dylib        0xf30 _pthread_mutex_unlock_init_slow + 20
1  CoreGraphics                   0x5838 CGDataProviderRetainBytePtr + 104
2  CoreGraphics                   0x302e8 CGDataProviderDirectGetBytesAtPositionInternal + 76
3  CoreGraphics                   0x3236c provider_for_destination_get_bytes_at_position_inner + 488
4  CoreGraphics                   0x303ec CGDataProviderDirectGetBytesAtPositionInternal + 336
5  CoreGraphics                   0x301d8 get_chunks_direct + 220
6  CoreGraphics                   0x32f38 img_raw_read + 1088
7  CoreGraphics                   0xaa9c0 img_interpolate_read + 600
8  CoreGraphics                   0x2ee9c img_data_lock + 7964
9  CoreGraphics                   0x2887c CGSImageDataLock + 1168
10 CoreGraphics                   0x28024 ripc_AcquireRIPImageData + 840
11 CoreGraphics                   0x27450 ripc_DrawImage + 756
12 CoreGraphics                   0x25c7c CGContextDrawImageWithOptions + 1092
13 CoreGraphics                   0x25778 CGContextDrawImage + 556
14 UIKitCore                      0x3eecf4 -[UIImage _drawInContext:rect:layout:scale:applyContentsTransform:] + 724
15 UIKitCore                      0x3ee964 -[UIImage drawInRect:blendMode:alpha:] + 480
16 Onfido                         0x3a3508 $sSo7UIImageC13Onfido_CommonE6bufferSo11CVBufferRefaSgyF + 804
17 Onfido                         0x3b01ac $s22Onfido_DocumentCapture15CoreMLProcessorC7processyAC6OutputVSo7UIImageCKF + 236
18 Onfido                         0x3a9db0 $s22Onfido_DocumentCapture22BoundingBoxMLProcessorC7processyAA0dE6OutputVAA5Frame_pKF + 288
19 Onfido                         0x3aa4b0 $s22Onfido_DocumentCapture22BoundingBoxMLProcessorCAA9ProcessorA2aDP7processy6OutputQz5InputQzKFTW + 20
20 Onfido                         0x3b7170 $s22Onfido_DocumentCapture0B14FrameValidatorC7process33_4A643866920CB9355E50D79EF8A723C1LLyAA11Validatable_pAA0D0_p_SStF + 356
21 Onfido                         0x3b6a4c $s22Onfido_DocumentCapture0B14FrameValidatorC8validateys6ResultOySDySSAA11Validatable_pG7outputs_SDySSAA010ValidationG0OG7resultstAA0bdJ5ErrorOGAA0D0_pF + 836
22 Onfido                         0x3b7604 $s22Onfido_DocumentCapture0B14FrameValidatorCAA0bD10ValidatingA2aDP8validateys6ResultOySDySSAA11Validatable_pG7outputs_SDySSAA010ValidationH0OG7resultstAA0bdK5ErrorOGAA0D0_pFTW + 20
23 Onfido                         0x1363b0 $s6Onfido22DocumentFrameProcessorC7processyyAA0C0VF + 148
24 Onfido                         0x128bec $s6Onfido29DocumentCaptureViewControllerC13didReceiveNew5frameyAA5FrameV_tF + 48
25 Onfido                         0x8c840 $s6Onfido27CameraCaptureViewControllerC09loadPhotocD0yyFyAA5FrameVcfU_ + 140
26 Onfido                         0x9c170 $s6Onfido15CameraLayerViewC13captureOutput_03didF04fromySo09AVCaptureF0C_So17CMSampleBufferRefaSo0I10ConnectionCtFTf4nndn_n + 312
27 Onfido                         0x986f0 $s6Onfido15CameraLayerViewC13captureOutput_03didF04fromySo09AVCaptureF0C_So17CMSampleBufferRefaSo0I10ConnectionCtFTo + 92
28 AVFCapture                     0x89528 -[AVCaptureVideoDataOutput _processSampleBuffer:] + 300
29 AVFCapture                     0x8925c __47-[AVCaptureVideoDataOutput _updateRemoteQueue:]_block_invoke + 88
30 CMCapture                      0x185c08 __FigRemoteOperationReceiverCreateMessageReceiver_block_invoke + 104
31 CMCapture                      0x53b6a0 __rqReceiverSetSource_block_invoke + 260
32 libdispatch.dylib              0x1b1e4 _dispatch_client_callout + 16
33 libdispatch.dylib              0x6148 _dispatch_continuation_pop + 596
34 libdispatch.dylib              0x18ee4 _dispatch_source_latch_and_call + 392
35 libdispatch.dylib              0x17bb8 _dispatch_source_invoke + 844
36 libdispatch.dylib              0x9e18 _dispatch_lane_serial_drain + 332
37 libdispatch.dylib              0xaaac _dispatch_lane_invoke + 392
38 libdispatch.dylib              0x14dac _dispatch_root_queue_drain_deferred_wlh + 284
39 libdispatch.dylib              0x146ac _dispatch_workloop_worker_thread + 720
40 libsystem_pthread.dylib        0x13b0 _pthread_wqthread + 292
41 libsystem_pthread.dylib        0x8c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0xa80 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x13fc _pthread_wqthread + 368
2  libsystem_pthread.dylib        0x8c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0xa80 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x13fc _pthread_wqthread + 368
2  libsystem_pthread.dylib        0x8c0 start_wqthread + 8

com.apple.coremedia.sharedRootQueue.47
0  libsystem_kernel.dylib         0xc68 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x367d8 _dispatch_sema4_timedwait + 64
2  libdispatch.dylib              0x3a68 _dispatch_semaphore_wait_slow + 76
3  libdispatch.dylib              0x136fc _dispatch_worker_thread + 324
4  libsystem_pthread.dylib        0x4438 _pthread_start + 136
5  libsystem_pthread.dylib        0x8cc thread_start + 8

MANDATORY Reproducer

https://github.com/react-native-community/reproducer-react-native/tree/main/ReproducerApp

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions