Instabug / Instabug-SP

Other
11 stars 11 forks source link

Crash related to UIPageViewController #18

Open valeriy-kolodiy opened 2 years ago

valeriy-kolodiy commented 2 years ago

After updating Instabug iOS SDK from 10.7.3 to 10.10.1 app crashes when calling the setViewControllers method on the UIPageViewController instance.

Crash is not reproducable after setting the Instabug.reproStepsMode = .enabledWithNoScreenshots. That actually fixes the issue for us, but still would be great to have it fixed on the SDK level.

Looks like that's the same crash that was reported before: https://github.com/Instabug/Instabug-iOS/issues/230

Crash does not happen when downgrading back to 10.7.3 version. Looks like the crash was introduced in SDK version 10.8.0

Stack trace:

2021-11-18 16:26:53.618055+0200 [99102:7243090] *** Assertion failure in -[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:], _UIQueuingScrollView.m:395
2021-11-18 16:26:53.621335+0200 [99102:7243090] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: [views count] == 3'
*** First throw call stack:
(0x180ee504c 0x199559f54 0x18279e6cc 0x183c28f58 0x183c2c080 0x183c282c4 0x1835c6cd0 0x1836aefd4 0x1834c85f4 0x184bacd90 0x184bb36dc 0x180e57390 0x180e9a724 0x180e9df30 0x180e57e0c 0x180e6b3b8 0x19c7fb38c 0x18380b6a8 0x18358a7f4 0x1006766a0 0x10162da24)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: [views count] == 3'
CGDataProviderDirectGetBytesAtPositionInternal calling provider created with CFData
terminating with uncaught exception of type NSException

Steps to Reproduce the Problem

Please see the description above

Expected Behavior

The app should not crash

Actual Behavior

App crashes

Instabug integration code

not relevant

SDK Version

10.10.1 (looks like it started crashing from version 10.8.0)

iOS Version

Tried on 14.5, 15.1

Device Model

Not relevant.

HassanElDesouky commented 2 years ago

Hi @valeriy-kolodiy,

Thank you for reporting this. I tried to reproduce the crash by creating a new project that has a UIPageViewController and I also used setViewControllers. However, I wasn't able to reproduce. Here's a link to the repo https://github.com/HassanElDesouky/UIPageViewControllerInstabugCrash

It'll be very helpful if you can create a demo project that reproduces the crash or just point out what I'm missing in mine.