-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
Describe the bug
Random crashes occurring in the Bugsnag iOS SDK when app returns to foreground on iOS 18, inside session upload code path.
Steps to reproduce
- Launch app on iOS 18+ (simulator or real device).
- Background → foreground (or just observe over time).
- Crash happens, no specific user flow triggers it reliably.
Environment
- Bugsnag version: 6.34.0
- CocoaPods / Carthage version: 1.16.2 (CocoaPods)
- iOS version: iOS 18+
- Device: Physical Device
- Xcode version: Xcode 16.4
- Swift version: 5.9
Stack trace / crash report
EXC_BREAKPOINT: BUG IN CLIENT OF LIBMALLOC: memory corruption of free block
0 libsystem_malloc.dylib __xzm_xzone_malloc_tiny_outlined
1 CoreFoundation ___CFStringAppendFormatCore
2 CoreFoundation __CFStringCreateWithFormatAndArgumentsReturningMetadata
3 CoreFoundation __CFStringCreateWithFormatAndArgumentsAux2
4 Foundation +[NSString stringWithFormat:]
5 <APP_NAME> BSGIntegrityHeaderValue
6 <APP_NAME> BSGPostJSONData
7 <APP_NAME> -[BSGSessionUploader sendSession:completionHandler:]
8 <APP_NAME> -[BSGSessionUploader uploadSession:]
9 <APP_NAME> -[BugsnagSessionTracker startNewSession]
10 <APP_NAME> -[BugsnagSessionTracker startNewSessionIfAutoCaptureEnabled]
11 <APP_NAME> -[BugsnagSessionTracker handleAppForegroundEvent]
12 CoreFoundation ___CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
13 CoreFoundation ____CFXRegistrationPost_block_invoke
14 CoreFoundation __CFXRegistrationPost
15 CoreFoundation __CFXNotificationPost
16 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:]
17 UIKitCore -[UIApplication _sendWillEnterForegroundCallbacks]
18 UIKitCore ___101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:...]_block_invoke_2
19 UIKitCore __UIScenePerformActionsWithLifecycleActionMask
20 UIKitCore ___101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:...]_block_invoke
21 UIKitCore -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:]
22 UIKitCore -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]
23 UIKitCore -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:]
24 UIKitCore ___186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction ...]_block_invoke
25 UIKitCore +[BSAnimationSettings tryAnimatingWithSettings:fromCurrentState:actions:completion:]
26 UIKitCore __UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion
27 UIKitCore -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:...]
28 UIKitCore ___64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.229
29 UIKitCore -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:]
30 UIKitCore -[UIScene scene:didUpdateWithDiff:transitionContext:completion:]
31 UIKitCore -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:]
32 FrontBoardServices ___76-[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.146
33 FrontBoardServices -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:]
34 FrontBoardServices -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:]
35 FrontBoardServices ___94-[FBSWorkspaceScenesClient _queue_updateScene:...]_block_invoke_2
36 FrontBoardServices -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
37 FrontBoardServices ___94-[FBSWorkspaceScenesClient _queue_updateScene:...]_block_invoke.cold.1
38 FrontBoardServices ___94-[FBSWorkspaceScenesClient _queue_updateScene:...]_block_invoke
39 libdispatch.dylib __dispatch_client_callout
40 libdispatch.dylib __dispatch_block_invoke_direct
41 FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
42 FrontBoardServices -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible]
43 FrontBoardServices -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource]
44 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
45 CoreFoundation ___CFRunLoopDoSource0
46 CoreFoundation ___CFRunLoopDoSources0
47 CoreFoundation ___CFRunLoopRun
48 CoreFoundation _CFRunLoopRunSpecific
49 GraphicsServices _GSEventRunModal
50 UIKitCore -[UIApplication _run]
51 UIKitCore _UIApplicationMain
52 <APP_NAME> main (AppDelegate.swift:70)
53 dyld start
Additional context
- Crash appears to be random, no reproducible steps beyond returning to foreground on iOS 18.
- Similar problems have been reported in other iOS crash-reporting SDKs.
- SQ - MessageBus Crash L:97 DataDog/dd-sdk-ios#2134
- Crashed: com.apple.main-thread getsentry/sentry-cocoa#4926
Metadata
Metadata
Assignees
Labels
No labels