Azure / Azure/AzureAIVisionFaceUI

EXC_BAD_ACCESS crash on app launch — iOS 26.2, AZFaceAnalyzerCreateOptions +load

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3
Forks
7
Avg merge
15m
Merged PRs (30d)
1

Description

Description

App crashes immediately on launch with EXC_BAD_ACCESS (code=1, address=0x18) in pthread_mutex_lock. The crash occurs in
+[AZFaceAnalyzerCreateOptions load] before main() is called. The SDK's ObjC +load method calls
InitializeFaceAnalyzerRecoEngineAdapter() which dereferences a null pointer (object at address 0x0, mutex field at offset 0x18).

Environment

- Device: iPhone (arm64), iOS 26.2
- Xcode: 26.3 (Build 17C529)
- Swift: 6.2.4
- SDK versions tested: 1.4.7, 1.4.5
- Integration methods tested: Swift Package Manager, CocoaPods

Steps to Reproduce

1. Add AzureAIVisionFaceUI via SPM (https://github.com/Azure/AzureAIVisionFaceUI)
2. Set SWIFT_OBJC_INTEROP_MODE = objcxx in Build Settings
3. Build and run on a device with iOS 26.2
4. App crashes on launch before reaching main()

Crash Log

Thread 1: EXC_BAD_ACCESS (code=1, address=0x18)
Frame: pthread_mutex_lock

Console output:
AZFaceAnalyzerCreateOptions load, call InitializeFaceAnalyzerRecoEngineAdapter

Analysis

- The crash is in +[AZFaceAnalyzerCreateOptions load] → InitializeFaceAnalyzerRecoEngineAdapter()
- pthread_mutex_lock is called with address 0x18 = NULL + 0x18 — a null pointer dereference
- A C++ global object containing a mutex at offset 0x18 has not been initialized when +load runs
- Likely a static initialization order issue between ObjC +load and C++ global constructors introduced by iOS 26 runtime changes

What I've tried

- SDK v1.4.7 via CocoaPods — crash
- SDK v1.4.7 via SPM — crash
- SDK v1.4.5 via SPM — crash
- SWIFT_OBJC_INTEROP_MODE = objcxx — set correctly, still crash
- -force_load linker flag — duplicate symbols (confirms all symbols ARE linked)
- Clean build, DerivedData cleared

Suggested Fix

Replace +load with +initialize or dispatch_once lazy initialization to avoid dependency on C++ static initialization order.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.