ios-branch-deep-linking-attribution icon indicating copy to clipboard operation
ios-branch-deep-linking-attribution copied to clipboard

Crash at launch with iOS 14 + Xcode 12b6

Open michaello opened this issue 5 years ago • 16 comments

image

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFData count]: unrecognized selector sent to instance 0x600002425630'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff2043a11e __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff20177f78 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff20448c6f +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   CoreFoundation                      0x00007fff2043e65e ___forwarding___ + 1489
	4   CoreFoundation                      0x00007fff20440698 _CF_forwarding_prep_0 + 120
	5   WebKit                              0x00007fff28534b2b _ZN3WTF10makeVectorINS_6StringEEENS_6VectorIT_Lm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEP7NSArray + 72
	6   WebKit                              0x00007fff2883258b _ZNK6WebKit15WebProcessProxy25platformOverrideLanguagesEv + 109
	7   WebKit                              0x00007fff2889b1d9 _ZN6WebKit15WebProcessProxy16getLaunchOptionsERNS_15ProcessLauncher13LaunchOptionsE + 215
	8   WebKit                              0x00007fff287f1045 _ZN6WebKit21AuxiliaryProcessProxy7connectEv + 53
	9   WebKit                              0x00007fff2889362c _ZN6WebKit14WebProcessPool19createNewWebProcessEPNS_16WebsiteDataStoreENS_15WebProcessProxy11IsPrewarmedE + 104
	10  WebKit                              0x00007fff2885f153 _ZN6WebKit14WebProcessPool27processForRegistrableDomainERNS_16WebsiteDataStoreEPNS_12WebPageProxyERKN7WebCore17RegistrableDomainE + 1831
	11  WebKit                              0x00007fff28894885 _ZN6WebKit14WebProcessPool13createWebPageERNS_10PageClientEON3WTF3RefIN3API17PageConfigurationENS3_13DumbPtrTraitsIS6_EEEE + 335
	12  WebKit                              0x00007fff28bc0f10 -[WKContentView _commonInitializationWithProcessPool:configuration:] + 49
	13  WebKit                              0x00007fff28bc192b -[WKContentView initWithFrame:processPool:configuration:webView:] + 195
	14  WebKit                              0x00007fff287732d3 -[WKWebView _initializeWithConfiguration:] + 1271
	15  WebKit                              0x00007fff2877473a -[WKWebView initWithFrame:configuration:] + 98
	16  WebKit                              0x00007fff28772d79 -[WKWebView initWithFrame:] + 83
	17  ParseTest DEV                       0x000000010bbfa9a4 __56-[BNCUserAgentCollector collectUserAgentWithCompletion:]_block_invoke + 122
	18  libdispatch.dylib                   0x00007fff2010535b _dispatch_call_block_and_release + 12
	19  libdispatch.dylib                   0x00007fff20106534 _dispatch_client_callout + 8
	20  libdispatch.dylib                   0x00007fff20113011 _dispatch_main_queue_callback_4CF + 1045
	21  CoreFoundation                      0x00007fff203a8276 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	22  CoreFoundation                      0x00007fff203a2b06 __CFRunLoopRun + 2685
	23  CoreFoundation                      0x00007fff203a1b9e CFRunLoopRunSpecific + 567
	24  XCTest                              0x000000010de14eaf -[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 823
	25  XCTest                              0x000000010ddaacef -[XCTFuture _waitForFulfillment] + 724
	26  XCTest                              0x000000010ddabd57 -[XCTFuture value] + 32
	27  XCTest                              0x000000010dd9b230 -[XCTestDriver _prepareTestConfigurationAndIDESession] + 803
	28  XCTest                              0x000000010dd9aedd -[XCTestDriver run] + 23
	29  XCTest                              0x000000010de28c28 _XCTestMain + 108
	30  libXCTestBundleInject.dylib         0x000000010dbed992 __copy_helper_block_e8_32s + 0
	31  CoreFoundation                      0x00007fff203a85db __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	32  CoreFoundation                      0x00007fff203a79ef __CFRunLoopDoBlocks + 434
	33  CoreFoundation                      0x00007fff203a240c __CFRunLoopRun + 899
	34  CoreFoundation                      0x00007fff203a1b9e CFRunLoopRunSpecific + 567
	35  GraphicsServices                    0x00007fff2b76edb3 GSEventRunModal + 139
	36  UIKitCore                           0x00007fff24660c73 -[UIApplication _run] + 912
	37  UIKitCore                           0x00007fff24665b84 UIApplicationMain + 101

michaello avatar Sep 01 '20 13:09 michaello

Thanks for the bug report. Can you provide any details on what triggers it or how frequent it is? We haven't seen this in testing with iOS 14 and Xcode 12 beta 6 yet, though I'm going to take a look once I get that build. How are you integrating the SDK? CocoaPods? SPM? Carthage? Other? Any detail on environment or steps to reproduce is helpful. Thanks.

jdee avatar Sep 01 '20 17:09 jdee

Also: Which version of the Branch SDK is this?

jdee avatar Sep 01 '20 20:09 jdee

Hey @jdee , thanks for the reply! I'll provide more info very soon, can't access this step for now.

michaello avatar Sep 02 '20 08:09 michaello

@michaello is this still an issue you are having ?

mmdock avatar Sep 11 '20 18:09 mmdock

I'm also having a branch crash on startup with latest branch SDK 0.35.0. I'm on iOS 13 (though 14 crashes too). Seems related to webkit (wkwebview) init thread race condition. Sorry I can't post my backtrace at this time.

edit: nevermind. seems unrelated. downgrade to 0.34.0 still crashing (likely somewhere else)

mlfarrell avatar Sep 15 '20 18:09 mlfarrell

@mmdock sorry, haven't had an occasion to test it properly! Gonna try it again tomorrow.

michaello avatar Sep 15 '20 19:09 michaello

Hi @jdee, I believe I'm seeing this crash as well. I've tested on both Branch SDK v0.35.0 and v0.36.0 running on the iOS simulator. I've been using the SDK fine for the past 6-9 months without any issue before and do not know what configuration changes I've made to cause this crash to start to occur. I've also performed the standard clean / delete derived data folder but still see the crash.

Environment: MacOS Big Sur 11.1 Xcode 12.3 (12C33) Branch SDK v0.36.0 (also occurs on 0.35.0) Cocoapods 1.10.0 iOS Simulator 13.2

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x0000000126a21947 JavaScriptCore`bmalloc::Heap::Heap(bmalloc::HeapKind, std::__1::lock_guard<bmalloc::Mutex>&) + 2039
    frame #1: 0x0000000126a1dcf5 JavaScriptCore`bmalloc::PerProcess<bmalloc::PerHeapKind<bmalloc::Heap> >::getSlowCase() + 181
    frame #2: 0x0000000126a1e505 JavaScriptCore`bmalloc::PerHeapKindBase<bmalloc::Cache>::PerHeapKindBase<>() + 37
    frame #3: 0x0000000126a1df26 JavaScriptCore`bmalloc::PerThread<bmalloc::PerHeapKind<bmalloc::Cache> >::getSlowCase() + 102
    frame #4: 0x0000000126a1dfe4 JavaScriptCore`bmalloc::Cache::allocateSlowCaseNullCache(bmalloc::HeapKind, unsigned long) + 132
    frame #5: 0x0000000126f8672e JavaScriptCore`JSC::ExecutableAllocator::initialize() + 14
    frame #6: 0x000000012722f8e6 JavaScriptCore`void std::__1::__call_once_proxy<std::__1::tuple<JSC::initializeThreading()::$_0&&> >(void*) + 22
    frame #7: 0x00000001135f0f3c libc++.1.dylib`std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) + 139
    frame #8: 0x00000001272231dc JavaScriptCore`JSC::initializeThreading() + 60
    frame #9: 0x0000000115d1015c WebKit`WebKit::runInitializationCode(void*) + 19
    frame #10: 0x00000001135f0f3c libc++.1.dylib`std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) + 139
    frame #11: 0x0000000115d0da4c WebKit`WebKit::InitializeWebKit2() + 58
    frame #12: 0x0000000115d70e58 WebKit`-[WKWebViewConfiguration init] + 67
    frame #13: 0x0000000115d59ae4 WebKit`-[WKWebView initWithFrame:] + 26
  * frame #14: 0x0000000113b549a5 Branch`__56-[BNCUserAgentCollector collectUserAgentWithCompletion:]_block_invoke(.block_descriptor=0x0000600002075020) at BNCUserAgentCollector.m:91:28
    frame #15: 0x000000011c17edd4 libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #16: 0x000000011c17fd48 libdispatch.dylib`_dispatch_client_callout + 8
    frame #17: 0x000000011c18dde6 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1500
    frame #18: 0x000000011920bdf9 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #19: 0x0000000119206a59 CoreFoundation`__CFRunLoopRun + 2329
    frame #20: 0x0000000119205e16 CoreFoundation`CFRunLoopRunSpecific + 438
    frame #21: 0x0000000123c36bb0 GraphicsServices`GSEventRunModal + 65
    frame #22: 0x000000011d387b48 UIKitCore`UIApplicationMain + 1621
    frame #23: 0x0000000105081f8b main at AppDelegate.swift:20:7
    frame #24: 0x000000011c207c25 libdyld.dylib`start + 1
    frame #25: 0x000000011c207c25 libdyld.dylib`start + 1

joeypatino avatar Jan 12 '21 13:01 joeypatino

also getting the crash

sethmills21 avatar Jan 22 '21 17:01 sethmills21

Me too On simulator with iOS 13 On iOS 14 all fine

I have a Mac with M1 chip if that help

rusik avatar Jan 28 '21 11:01 rusik

@Rusik Thanks for that bit of information. I'll try it out with an ARM mac.

echo-branch avatar Jan 29 '21 00:01 echo-branch

Branch framework crashes on initialization startup in my case.

Dev environment:

  • Xcode: Version 12.4 (12D4e)
  • WebKit.framework linked as REQUIRED based on your official integration guide: https://help.branch.io/developers-hub/docs/ios-basic-integration`
  • Branch iOS SDK 1.39.1: https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/tag/1.39.1

Crash report:

  • iOS 13 simulator: CRASHED
  • iOS 14 simulator: OK (no crash)
  • iOS 14 real devices: OK (no crash)
Screenshot 2021-03-26 at 11 07 34 Screenshot 2021-03-26 at 11 40 51

smuravev avatar Mar 26 '21 05:03 smuravev

@smuravev Are you able to provide the device model that's crashing? Both the dev environment and device/simulator running?

We've been unsuccessful in reproducing this issue, but suspect it may be related to certain M1 macs.

echo-branch avatar Mar 26 '21 16:03 echo-branch

@smuravev Are you able to provide the device model that's crashing? Both the dev environment and device/simulator running?

We've been unsuccessful in reproducing this issue, but suspect it may be related to certain M1 macs.

Dev computer:

  • MacBook Pro, M1
  • OS: MacOS BigSur v11.2.3
  • Xcode: Version 12.4 (12D4e)

Simulator (iPhone 8 Plus, iOS 14.4) - running on my M1, BigSur: PASSED (no crash) Real iPhone 8 Plus, iOS 14.4.1 - PASSED (no crash) Simulator (iPhone 8 Plus, iOS 13.5) - running on my M1, BigSur: FAILED (crashed :( )

smuravev avatar Mar 27 '21 02:03 smuravev

I have this issue too.

  • MacBook Air (M1, 2020)
  • macOS BigSur v11.2.1 (20D74)
  • Xcode Version 12.4 (12D4e)

Works fine on iOS 14, device and simulator (both iPhone 12 mini).

Crashes on iOS 13.7 simulator (iPhone SE 2nd gen).

dmoreh avatar Apr 26 '21 22:04 dmoreh

Branch framework crashes on initialization startup in my case.

Dev environment:

Crash report:

  • iOS 13 simulator: CRASHED
  • iOS 14 simulator: OK (no crash)
  • iOS 14 real devices: OK (no crash)
Screenshot 2021-03-26 at 11 07 34 Screenshot 2021-03-26 at 11 40 51

Same here:

MackBook Pro (M1, 2020) OS: macOS Big Sur 11.2.3 Xcode 12.4 iPhone 11, iOS 13.6 but to be clear any symulator below iOS 14 crashes

mdziubich avatar May 13 '21 17:05 mdziubich

image

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFData count]: unrecognized selector sent to instance 0x600002425630'

*** First throw call stack:

(

	0   CoreFoundation                      0x00007fff2043a11e __exceptionPreprocess + 242

	1   libobjc.A.dylib                     0x00007fff20177f78 objc_exception_throw + 48

	2   CoreFoundation                      0x00007fff20448c6f +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0

	3   CoreFoundation                      0x00007fff2043e65e ___forwarding___ + 1489

	4   CoreFoundation                      0x00007fff20440698 _CF_forwarding_prep_0 + 120

	5   WebKit                              0x00007fff28534b2b _ZN3WTF10makeVectorINS_6StringEEENS_6VectorIT_Lm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEP7NSArray + 72

	6   WebKit                              0x00007fff2883258b _ZNK6WebKit15WebProcessProxy25platformOverrideLanguagesEv + 109

	7   WebKit                              0x00007fff2889b1d9 _ZN6WebKit15WebProcessProxy16getLaunchOptionsERNS_15ProcessLauncher13LaunchOptionsE + 215

	8   WebKit                              0x00007fff287f1045 _ZN6WebKit21AuxiliaryProcessProxy7connectEv + 53

	9   WebKit                              0x00007fff2889362c _ZN6WebKit14WebProcessPool19createNewWebProcessEPNS_16WebsiteDataStoreENS_15WebProcessProxy11IsPrewarmedE + 104

	10  WebKit                              0x00007fff2885f153 _ZN6WebKit14WebProcessPool27processForRegistrableDomainERNS_16WebsiteDataStoreEPNS_12WebPageProxyERKN7WebCore17RegistrableDomainE + 1831

	11  WebKit                              0x00007fff28894885 _ZN6WebKit14WebProcessPool13createWebPageERNS_10PageClientEON3WTF3RefIN3API17PageConfigurationENS3_13DumbPtrTraitsIS6_EEEE + 335

	12  WebKit                              0x00007fff28bc0f10 -[WKContentView _commonInitializationWithProcessPool:configuration:] + 49

	13  WebKit                              0x00007fff28bc192b -[WKContentView initWithFrame:processPool:configuration:webView:] + 195

	14  WebKit                              0x00007fff287732d3 -[WKWebView _initializeWithConfiguration:] + 1271

	15  WebKit                              0x00007fff2877473a -[WKWebView initWithFrame:configuration:] + 98

	16  WebKit                              0x00007fff28772d79 -[WKWebView initWithFrame:] + 83

	17  ParseTest DEV                       0x000000010bbfa9a4 __56-[BNCUserAgentCollector collectUserAgentWithCompletion:]_block_invoke + 122

	18  libdispatch.dylib                   0x00007fff2010535b _dispatch_call_block_and_release + 12

	19  libdispatch.dylib                   0x00007fff20106534 _dispatch_client_callout + 8

	20  libdispatch.dylib                   0x00007fff20113011 _dispatch_main_queue_callback_4CF + 1045

	21  CoreFoundation                      0x00007fff203a8276 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9

	22  CoreFoundation                      0x00007fff203a2b06 __CFRunLoopRun + 2685

	23  CoreFoundation                      0x00007fff203a1b9e CFRunLoopRunSpecific + 567

	24  XCTest                              0x000000010de14eaf -[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 823

	25  XCTest                              0x000000010ddaacef -[XCTFuture _waitForFulfillment] + 724

	26  XCTest                              0x000000010ddabd57 -[XCTFuture value] + 32

	27  XCTest                              0x000000010dd9b230 -[XCTestDriver _prepareTestConfigurationAndIDESession] + 803

	28  XCTest                              0x000000010dd9aedd -[XCTestDriver run] + 23

	29  XCTest                              0x000000010de28c28 _XCTestMain + 108

	30  libXCTestBundleInject.dylib         0x000000010dbed992 __copy_helper_block_e8_32s + 0

	31  CoreFoundation                      0x00007fff203a85db __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12

	32  CoreFoundation                      0x00007fff203a79ef __CFRunLoopDoBlocks + 434

	33  CoreFoundation                      0x00007fff203a240c __CFRunLoopRun + 899

	34  CoreFoundation                      0x00007fff203a1b9e CFRunLoopRunSpecific + 567

	35  GraphicsServices                    0x00007fff2b76edb3 GSEventRunModal + 139

	36  UIKitCore                           0x00007fff24660c73 -[UIApplication _run] + 912

	37  UIKitCore                           0x00007fff24665b84 UIApplicationMain + 101

  • [ ]

Deloww avatar May 14 '22 23:05 Deloww