-
-
Notifications
You must be signed in to change notification settings - Fork 5
iOS Release crash: Swift 6.1 async let teardown bug in FirebaseFunctions/FirebaseStorage #76
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
iOS Release/Profile builds crash with SIGABRT (_swift_task_dealloc_specific / freed pointer was not the last allocation) on cooperative queue threads whenever code calls FirebaseFunctions.httpsCallable.call() or FirebaseStorage.ref.putData(). Debug builds are unaffected.
Root Cause
Swift 6.1 compiler bug - the optimizer generates incorrect LIFO teardown ordering for async let task allocations.
Exposed by flutterfire#18054 (feat(ios): migrate iOS to UIScene lifecycle), which shipped new Swift async code in:
cloud_functions6.0.7 → 6.1.0firebase_storage13.1.0 → 13.2.0
Upstream Tracking
| Issue | Status |
|---|---|
| swiftlang/swift#81771 | Swift compiler bug report |
| swiftlang/swift#87571 | Fix PR (not yet merged) |
| flutterfire#18153 | FlutterFire tracking issue |
| Swift Forums discussion | Community discussion |
Current Workaround
Version pinning in pubspec.yaml to pre-UIScene migration versions:
firebase_storage: 13.1.0 # 13.2.0 triggers Swift 6.1 SIGABRT
cloud_functions: 6.0.7 # 6.1.0 triggers Swift 6.1 SIGABRTThis avoids the problematic native Swift async code entirely - no Podfile hacks, no -Onone overrides, no performance penalty.
Previously attempted workarounds (not recommended)
- Podfile
-Onone: Fragile, disables Swift optimization for entire pods, hard to know which pods to cover. - Pure Dart HTTP REST bypass: Works but loses native SDK benefits (retries, App Check, offline queueing).
Resolution Criteria
Unpin to ^ versions once any of:
- Swift compiler fix (swiftlang/swift#87571) ships in an Xcode update
- FlutterFire releases patched
cloud_functions/firebase_storageversions - Firebase iOS SDK adds its own workaround
Affected Versions
- Build 139 (1.24.0+139)
- Xcode 26.4, Swift 6.1, iOS 26.4
- Physical devices only (simulator uses macOS Swift runtime)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working