Instabug / Instabug-iOS

In-app feedback and bug reporting tool for apps.
https://instabug.com/
Other
290 stars 67 forks source link

Crash at IBGChatCollectionView #503

Open AnderGoig opened 1 week ago

AnderGoig commented 1 week ago

Steps to Reproduce the Problem

Some of our users are reporting crashes in the app when Instabug chats are opened.

Expected Behavior

The app does not crash when existing chat is opened.

Actual Behavior

The app crashes when an existing chat is opened.

See Stacktrace ``` OS Version: iOS 18.1 (22B5054e) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Crashed Thread: 0 Application Specific Information: Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Dequeued view: >; Collection view: ; backgroundColor = UIExtendedSRGBColorSpace 1 1 1 1; layer = ; contentOffset: {0, 0}; contentSize: {402, 570.9609375}; adjustedContentInset: {0, 0, 0, 0}; layout: ; dataSource: > Thread 0 Crashed: 0 CoreFoundation 0x318fb07cc __exceptionPreprocess 1 libobjc.A.dylib 0x31359f2e0 objc_exception_throw 2 Foundation 0x316fb39a8 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 3 UIKitCore 0x31e8fde0c __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke.499 4 UIKitCore 0x31f03d20c -[_UICollectionViewSubviewManager removeAllDequeuedViewsWithEnumerator:] 5 UIKitCore 0x31e0b5a44 -[UICollectionView _updateVisibleCellsNow:] 6 UIKitCore 0x31e20ddd4 -[UICollectionView layoutSubviews] 7 UIKitCore 0x31df157c0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 8 QuartzCore 0x31c51e0e0 CA::Layer::layout_if_needed 9 QuartzCore 0x31c51dc6c CA::Layer::layout_and_display_if_needed 10 QuartzCore 0x31c574db4 CA::Context::commit_transaction 11 QuartzCore 0x31c4f3bdc CA::Transaction::commit 12 QuartzCore 0x31c536ec4 CA::Transaction::flush_as_runloop_observer 13 UIKitCore 0x31dfabb84 _UIApplicationFlushCATransaction 14 UIKitCore 0x31dfa9180 __setupUpdateSequence_block_invoke_2 15 UIKitCore 0x31dfa8ff4 _UIUpdateSequenceRun 16 UIKitCore 0x31dfa8c44 schedulerStepScheduledMainSection 17 UIKitCore 0x31dfa9bb8 runloopSourceCallback 18 CoreFoundation 0x318f84324 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 19 CoreFoundation 0x318f842b8 __CFRunLoopDoSource0 20 CoreFoundation 0x318f81dbc __CFRunLoopDoSources0 21 CoreFoundation 0x318f80fb8 __CFRunLoopRun 22 CoreFoundation 0x318f8082c CFRunLoopRunSpecific 23 GraphicsServices 0x3b16011c0 GSEventRunModal 24 UIKitCore 0x31e2db9a0 -[UIApplication _run] 25 UIKitCore 0x31e38a164 UIApplicationMain 26 Meld 0x20016a8ec main (AppDelegate.swift:34) 27 0x1bbed9ec8 Thread 0 Crashed: 0 CoreFoundation 0x318fb07cc __exceptionPreprocess 1 libobjc.A.dylib 0x31359f2e0 objc_exception_throw 2 Foundation 0x316fb39a8 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 3 UIKitCore 0x31e8fde0c __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke.499 4 UIKitCore 0x31f03d20c -[_UICollectionViewSubviewManager removeAllDequeuedViewsWithEnumerator:] 5 UIKitCore 0x31e0b5a44 -[UICollectionView _updateVisibleCellsNow:] 6 UIKitCore 0x31e20ddd4 -[UICollectionView layoutSubviews] 7 UIKitCore 0x31df157c0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 8 QuartzCore 0x31c51e0e0 CA::Layer::layout_if_needed 9 QuartzCore 0x31c51dc6c CA::Layer::layout_and_display_if_needed 10 QuartzCore 0x31c574db4 CA::Context::commit_transaction 11 QuartzCore 0x31c4f3bdc CA::Transaction::commit 12 QuartzCore 0x31c536ec4 CA::Transaction::flush_as_runloop_observer 13 UIKitCore 0x31dfabb84 _UIApplicationFlushCATransaction 14 UIKitCore 0x31dfa9180 __setupUpdateSequence_block_invoke_2 15 UIKitCore 0x31dfa8ff4 _UIUpdateSequenceRun 16 UIKitCore 0x31dfa8c44 schedulerStepScheduledMainSection 17 UIKitCore 0x31dfa9bb8 runloopSourceCallback 18 CoreFoundation 0x318f84324 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 19 CoreFoundation 0x318f842b8 __CFRunLoopDoSource0 20 CoreFoundation 0x318f81dbc __CFRunLoopDoSources0 21 CoreFoundation 0x318f80fb8 __CFRunLoopRun 22 CoreFoundation 0x318f8082c CFRunLoopRunSpecific 23 GraphicsServices 0x3b16011c0 GSEventRunModal 24 UIKitCore 0x31e2db9a0 -[UIApplication _run] 25 UIKitCore 0x31e38a164 UIApplicationMain 26 Meld 0x20016a8ec main (AppDelegate.swift:34) 27 0x1bbed9ec8 Thread 1 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 2 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 3 name: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x3b9d6b688 mach_msg2_trap 1 libsystem_kernel.dylib 0x3b9d6ed94 mach_msg2_internal 2 libsystem_kernel.dylib 0x3b9d6ecac mach_msg_overwrite 3 libsystem_kernel.dylib 0x3b9d6eaf8 mach_msg 4 CoreFoundation 0x318f81a80 __CFRunLoopServiceMachPort 5 CoreFoundation 0x318f8112c __CFRunLoopRun 6 CoreFoundation 0x318f8082c CFRunLoopRunSpecific 7 Foundation 0x31684897c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 8 Foundation 0x3168487cc -[NSRunLoop(NSRunLoop) runUntilDate:] 9 UIKitCore 0x31e2eedf8 -[UIEventFetcher threadMain] 10 Foundation 0x316859ad4 __NSThread__start__ 11 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 4 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 5 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 6 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 7 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 8 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 9 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 10 0 libsystem_kernel.dylib 0x3b9d711b0 __semwait_signal 1 libsystem_c.dylib 0x328a5da74 nanosleep 2 libsystem_c.dylib 0x328abb54c sleep 3 Meld 0x200e3b8d4 monitorCachedData 4 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 11 name: SentryCrash Exception Handler (Secondary) 0 libsystem_kernel.dylib 0x3b9d6b688 mach_msg2_trap 1 libsystem_kernel.dylib 0x3b9d6ed94 mach_msg2_internal 2 libsystem_kernel.dylib 0x3b9d6cbf8 thread_suspend 3 Meld 0x200e21d10 handleExceptions 4 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 12 name: SentryCrash Exception Handler (Primary) 0 libsystem_kernel.dylib 0x3b9d6b688 mach_msg2_trap 1 libsystem_kernel.dylib 0x3b9d6ed94 mach_msg2_internal 2 libsystem_kernel.dylib 0x3b9d6ecac mach_msg_overwrite 3 libsystem_kernel.dylib 0x3b9d6eaf8 mach_msg 4 Meld 0x200e21d3c handleExceptions 5 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 13 name: io.sentry.app-hang-tracker 0 libsystem_kernel.dylib 0x3b9d711b0 __semwait_signal 1 libsystem_c.dylib 0x328a5da74 nanosleep 2 Foundation 0x3169610a4 +[NSThread sleepForTimeInterval:] 3 Meld 0x200e02704 -[SentryANRTracker detectANRs] 4 Foundation 0x316859ad4 __NSThread__start__ 5 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 14 name: com.apple.NSURLConnectionLoader 0 libsystem_kernel.dylib 0x3b9d6b688 mach_msg2_trap 1 libsystem_kernel.dylib 0x3b9d6ed94 mach_msg2_internal 2 libsystem_kernel.dylib 0x3b9d6ecac mach_msg_overwrite 3 libsystem_kernel.dylib 0x3b9d6eaf8 mach_msg 4 CoreFoundation 0x318f81a80 __CFRunLoopServiceMachPort 5 CoreFoundation 0x318f8112c __CFRunLoopRun 6 CoreFoundation 0x318f8082c CFRunLoopRunSpecific 7 CFNetwork 0x31b9dbedc +[__CFN_CoreSchedulingSetRunnable _run:] 8 Foundation 0x316859ad4 __NSThread__start__ 9 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 15 0 libsystem_kernel.dylib 0x3b9d6b688 mach_msg2_trap 1 libsystem_kernel.dylib 0x3b9d6ed94 mach_msg2_internal 2 libsystem_kernel.dylib 0x3b9d6ecac mach_msg_overwrite 3 libsystem_kernel.dylib 0x3b9d6eaf8 mach_msg 4 CoreFoundation 0x318f81a80 __CFRunLoopServiceMachPort 5 CoreFoundation 0x318f8112c __CFRunLoopRun 6 CoreFoundation 0x318f8082c CFRunLoopRunSpecific 7 Foundation 0x31684897c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 8 Foundation 0x316848850 -[NSRunLoop(NSRunLoop) run] 9 SwiftUI 0x322591c54 DisplayLink.asyncThread 10 SwiftUI 0x322590fb8 DisplayLink.asyncThread 11 Foundation 0x316859ad4 __NSThread__start__ 12 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 16 0 libsystem_kernel.dylib 0x3b9d6b688 mach_msg2_trap 1 libsystem_kernel.dylib 0x3b9d6ed94 mach_msg2_internal 2 libsystem_kernel.dylib 0x3b9d6ecac mach_msg_overwrite 3 libsystem_kernel.dylib 0x3b9d6eaf8 mach_msg 4 CoreFoundation 0x318f81a80 __CFRunLoopServiceMachPort 5 CoreFoundation 0x318f8112c __CFRunLoopRun 6 CoreFoundation 0x318f8082c CFRunLoopRunSpecific 7 CoreFoundation 0x318febce8 CFRunLoopRun 8 CoreMotion 0x3338ac0dc 9 libsystem_pthread.dylib 0x429ae4378 _pthread_start Thread 17 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 18 0 libsystem_kernel.dylib 0x3b9d6b410 __workq_kernreturn 1 libsystem_pthread.dylib 0x429ae2cc4 _pthread_wqthread Thread 19 0 libsystem_kernel.dylib 0x3b9d6b61c semaphore_timedwait_trap 1 libdispatch.dylib 0x3289be6e4 _dispatch_sema4_timedwait 2 libdispatch.dylib 0x3289bece4 _dispatch_semaphore_wait_slow 3 libdispatch.dylib 0x3289cfb5c _dispatch_worker_thread 4 libsystem_pthread.dylib 0x429ae4378 _pthread_start EOF ```

Instabug integration code

CrashReporting.enabled = false

Instabug.start(withToken: Constants.Instabug.token, invocationEvents: .none)
Instabug.coreDataInstrumentationEnabled = false
Instabug.welcomeMessageMode = .disabled
Instabug.setColorTheme(.light)
Instabug.setLocale(.english)
Instabug.setValue(StringKey.askQuestion.localized(), forStringWithKey: kIBGAskAQuestionStringName)

let theme = Theme()
theme.primaryColor = UIColor(.Factory.Main.red)
Instabug.theme = theme

BugReporting.promptOptionsEnabledReportTypes = [.bug, .feedback]
Replies.inAppNotificationsEnabled = false

APM.uiHangsEnabled = false
APM.screenLoadingEnabled = false
APM.coldAppLaunchEnabled = false
APM.hotAppLaunchEnabled = false
APM.enabled = false
NetworkLogger.enabled = false

SDK Version

13.4.2

iOS Version

iOS 18.0

Device Model

iPhone 14 Pro, iPhone 16, iPad (8th gen), iPhone 14

stale[bot] commented 6 hours ago

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.