RxSwift icon indicating copy to clipboard operation
RxSwift copied to clipboard

Application crash sending `text` selector to RxTableViewDelegateProxy or RxCollectionViewDelegateProxy

Open SlashDevSlashGnoll opened this issue 2 years ago • 31 comments

Short description of the issue:

We're seeing a crash among our userbase that is happening with alarming frequency however we have been unable to reproduce it or identify the root cause. A slack discussion was started here among 2 of us that are seeing this problem but we wanted to post here with the hopes that someone else may have an idea about something to look at.

This is the stack trace/crash:

-[RxCocoa.RxTableViewDelegateProxy text]: unrecognized selector sent to instance 0x28378a0d0

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x99288 __exceptionPreprocess
1  libobjc.A.dylib                0x16744 objc_exception_throw
2  CoreFoundation                 0x176fc4 +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x2de98 ___forwarding___
4  CoreFoundation                 0x2cf70 _CF_forwarding_prep_0
5  ContextKitExtraction           0x59ec +[CKContextContentProviderUIScene _bestVisibleStringForView:usingExecutor:]
6  ContextKitExtraction           0x4d7c +[CKContextContentProviderUIScene _donateContentsOfWindow:usingExecutor:withOptions:]
7  ContextKitExtraction           0x48fc __78+[CKContextContentProviderUIScene extractFromScene:usingExecutor:withOptions:]_block_invoke
8  ContextKitExtraction           0x54ac __64-[CKContextExecutor addWorkItemToQueue:withWorkItem:andContext:]_block_invoke
9  libdispatch.dylib              0x1e6c _dispatch_call_block_and_release
10 libdispatch.dylib              0x3a30 _dispatch_client_callout
11 libdispatch.dylib              0x11fa4 _dispatch_main_queue_drain
12 libdispatch.dylib              0x11b98 _dispatch_main_queue_callback_4CF
13 CoreFoundation                 0x51800 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
14 CoreFoundation                 0xb704 __CFRunLoopRun
15 CoreFoundation                 0x1ebc8 CFRunLoopRunSpecific
16 GraphicsServices               0x1374 GSEventRunModal
17 UIKitCore                      0x514648 -[UIApplication _run]
18 UIKitCore                      0x295d90 UIApplicationMain
19 <OurAppName>                   0x2b144c main + 20 (main.swift:20)
20 ???                            0x106badce4 (Missing)

I have scoured our code to see if we were somehow sending a text selector to anything in a weird way, this is not the case. Our app is large and uses tables in many screens but I haven't found any misuse of rx.tems.

Here are the pertinent facts I've been able to collect about the problem:

  1. iOS 15.x.x only. We have users going back all the way to iOS 10.0 and no one experiences the crash other than iOS 15 users. We have a large user base so this shows up enough for us to have a large sample (thousands of crash events)
  2. SDK doesn't matter. I have viewed crashes going back to before we upgraded to Xcode 13 (using Xcode 12). These users had the crash as well (running on iOS 15).
  3. The only API change of note in tables/collection views in iOS15 is the automatic prefetching which doesn't involve code changes necessarily or invoke a text selector anywhere.
  4. The stack makes it clear that whatever the source is, it's going through dynamic dispatch / objc_msgSend and being marshaled to the ui thread or called from the ui thread using dispatch.async as it unwinds the stack out to the runloop to invoke this invalid selector on the proxy.

This crash is alarming because it seems to only occur on iOS15. Users from previous versions of iOS do not exhibit this problem. We haven't been able to determine if this is a bug in iOS, a bug in RxSwift or a bug in our usage of it. The os-specific nature of it makes me wonder if there's an iOS bug or a bug in the RxSwift framework that just hasn't come to light yet.

Any insights would be greatly appreciated.

Expected outcome:

No crashes

What actually happens:

Crash

Self contained code example that reproduces the issue:

I wish I had one or I'd be able to identify the problem :(

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

RxSwift 6.2.0 - https://github.com/ReactiveX/RxSwift/commit/7c17a6ccca06b5c107cfa4284e634562ddaf5951

Platform/Environment

  • [x] iOS
  • [ ] macOS
  • [ ] tvOS
  • [ ] watchOS
  • [ ] playgrounds

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

About 3% of our userbase is experiencing this. This includes users of other versions of iOS however that do not experience the issue at all.

Xcode version:

Xcode 13.2.1(13C100) although as stated it seems Xcode 12.4 was used at the time this first started showing up but before we noticed it.

Installation method:

  • [x] CocoaPods
  • [ ] Carthage
  • [ ] Git submodules

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

  • [ ] yes (which ones)
  • [x] no

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

  • [ ] just starting
  • [ ] I have a small code base
  • [x] I have a significant code base

SlashDevSlashGnoll avatar Jun 14 '22 13:06 SlashDevSlashGnoll

We are seeing a similar issue NSInvalidArgumentException: -[RxCocoa.RxCollectionViewDelegateProxy text]: unrecognized selector sent to instance 0x...

Cannot reproduce but can confirm it is limited to iOS 15.4+ even though we support iOS 13+. Our Xcode Crash Reports highlight the line +[CKContextContentProviderUIScene _bestVisibleStringForView:usingExecutor:] + 1312 (CKContextContentProviderUIScene.m:570) in bold so it makes me think it is something internal.

We tried upgrading from 6.2.0 to 6.5.0 but it did not help.

mwilson-within avatar Jun 16 '22 21:06 mwilson-within

If your crash report system allows it... it might help if you can figure out the type of the instance that is receiving the message. To do it, you would have to output several object's memory locations and compare to the one highlighted in the bug.

danielt1263 avatar Jun 17 '22 00:06 danielt1263

I think the crash says what it is. The text selector is being invoked on RxCollectionViewDelegateProxy or RxTableViewDelegateProxy in my case. The mystery is what's trying to invoke this selector.

SlashDevSlashGnoll avatar Jun 17 '22 01:06 SlashDevSlashGnoll

We have the exact same issue. And we have been unable to reproduce the issue. Upgrading RxSwift and RxCocoa won't help.

AramJulhakyan avatar Jun 17 '22 07:06 AramJulhakyan

Can you share the entire crash log?

freak4pc avatar Jun 17 '22 08:06 freak4pc

It's happening to us and it's currently the most significant crash in our app. Can confirm everything what was outlined here (iOS 15+, both RxSwift 6.2 and 6.5).

mkj-is avatar Jun 17 '22 08:06 mkj-is

It's from Crashlytics there doesn't seem to be a DL button so here's a cleaned up copy/paste of the entire trace:

47.0 (936)
iOS 15.4.1
iPhone 13 Pro
May 31, 2022, 7:56:32 PM
Stack trace
Keys
Logs
Data


Fatal Exception: NSInvalidArgumentException
-[RxCocoa.RxTableViewDelegateProxy text]: unrecognized selector sent to instance 0x2835133a0
Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x99d78 __exceptionPreprocess
1  libobjc.A.dylib                0x16734 objc_exception_throw
2  CoreFoundation                 0x177b88 +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x2e988 ___forwarding___
4  CoreFoundation                 0x2da60 _CF_forwarding_prep_0
5  ContextKitExtraction           0x59ec +[CKContextContentProviderUIScene _bestVisibleStringForView:usingExecutor:]
6  ContextKitExtraction           0x4d7c +[CKContextContentProviderUIScene _donateContentsOfWindow:usingExecutor:withOptions:]
7  ContextKitExtraction           0x48fc __78+[CKContextContentProviderUIScene extractFromScene:usingExecutor:withOptions:]_block_invoke
8  ContextKitExtraction           0x54ac __64-[CKContextExecutor addWorkItemToQueue:withWorkItem:andContext:]_block_invoke
9  libdispatch.dylib              0x1e68 _dispatch_call_block_and_release
10 libdispatch.dylib              0x3a2c _dispatch_client_callout
11 libdispatch.dylib              0x11fa4 _dispatch_main_queue_drain
12 libdispatch.dylib              0x11b98 _dispatch_main_queue_callback_4CF
13 CoreFoundation                 0x522f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
14 CoreFoundation                 0xc1f4 __CFRunLoopRun
15 CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific
16 GraphicsServices               0x1374 GSEventRunModal
17 UIKitCore                      0x513e88 -[UIApplication _run]
18 UIKitCore                      0x2955ec UIApplicationMain
19 <MyAppName>                    0x2b144c main + 20 (main.swift:20)
20 ???                            0x101f1dce4 (Missing)

Crashed: com.google.firebase.crashlytics.ios.exception
SIGABRT ABORT 0x00000001c7e0db78
Crashed: com.google.firebase.crashlytics.ios.exception
0  <MyAppName>                    0x90d8b0 FIRCLSProcessRecordAllThreads + 393 (FIRCLSProcess.c:393)
1  <MyAppName>                    0x90dc90 FIRCLSProcessRecordAllThreads + 424 (FIRCLSProcess.c:424)
2  <MyAppName>                    0x904fd4 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  <MyAppName>                    0x8ff740 __FIRCLSExceptionRecord_block_invoke + 215 (FIRCLSException.mm:215)
4  libdispatch.dylib              0x3a2c _dispatch_client_callout + 20
5  libdispatch.dylib              0x12c90 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  <MyAppName>                    0x8feee0 FIRCLSExceptionRecord + 219 (FIRCLSException.mm:219)
7  <MyAppName>                    0x8ff1e8 FIRCLSExceptionRecordNSException + 109 (FIRCLSException.mm:109)
8  <MyAppName>                    0x8feae0 FIRCLSTerminateHandler() + 273 (FIRCLSException.mm:273)
9  libc++abi.dylib                0x10f18 std::__terminate(void (*)()) + 20
10 libc++abi.dylib                0x10eb4 std::terminate() + 64
11 libobjc.A.dylib                0x2d268 objc::DenseMapBase<objc::DenseMap<objc_class*, PendingInitialize*, objc::DenseMapValueInfo<PendingInitialize*>, objc::DenseMapInfo<objc_class*>, objc::detail::DenseMapPair<objc_class*, PendingInitialize*> >, objc_class*, PendingInitialize*, objc::DenseMapValueInfo<PendingInitialize*>, objc::DenseMapInfo<objc_class*>, objc::detail::DenseMapPair<objc_class*, PendingInitialize*> >::FatalCorruptHashTables(objc::detail::DenseMapPair<objc_class*, PendingInitialize*> const*, unsigned int) const + 14
12 libdispatch.dylib              0x3a40 _dispatch_client_callout + 40
13 libdispatch.dylib              0x11fa4 _dispatch_main_queue_drain + 1020
14 libdispatch.dylib              0x11b98 _dispatch_main_queue_callback_4CF + 44
15 CoreFoundation                 0x522f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
16 CoreFoundation                 0xc1f4 __CFRunLoopRun + 2532
17 CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
18 GraphicsServices               0x1374 GSEventRunModal + 164
19 UIKitCore                      0x513e88 -[UIApplication _run] + 1100
20 UIKitCore                      0x2955ec UIApplicationMain + 364
21 <MyAppName>                    0x2b144c main + 20 (main.swift:20)
22 ???                            0x101f1dce4 (Missing)

com.apple.uikit.eventfetch-thread
com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x14e0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b24 mach_msg + 76
2  CoreFoundation                 0x7820 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xbcac __CFRunLoopRun + 1180
4  CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
5  Foundation                     0x18414 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236
6  Foundation                     0x59cac -[NSRunLoop(NSRunLoop) runUntilDate:] + 92
7  UIKitCore                      0x48dfb0 -[UIEventFetcher threadMain] + 524
8  Foundation                     0x6855c __NSThread__start__ + 808
9  libsystem_pthread.dylib        0x19ac _pthread_start + 148
10 libsystem_pthread.dylib        0xe68 thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x14e0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b24 mach_msg + 76
2  <MyAppName>                    0x90782c FIRCLSMachExceptionServer + 192 (FIRCLSMachException.c:192)
3  libsystem_pthread.dylib        0x19ac _pthread_start + 148
4  libsystem_pthread.dylib        0xe68 thread_start + 8

Realm notification listener
Realm notification listener
0  libsystem_kernel.dylib         0x2e58 kevent + 8
1  <MyAppName>                    0xe75f30 realm::_impl::ExternalCommitHelper::listen() + 829816
2  <MyAppName>                    0xe76080 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >(void*) + 830152
3  libsystem_pthread.dylib        0x19ac _pthread_start + 148
4  libsystem_pthread.dylib        0xe68 thread_start + 8

com.sendbird.SocketRocket.NetworkThread
com.sendbird.SocketRocket.NetworkThread
0  libsystem_kernel.dylib         0x14e0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b24 mach_msg + 76
2  CoreFoundation                 0x7820 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xbcac __CFRunLoopRun + 1180
4  CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
5  Foundation                     0x18414 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236
6  SendBirdSDK                    0x668c4 -[SendBird_SRRunLoopThread main] + 70 (SendBird_SRRunLoopThread.m:70)
7  Foundation                     0x6855c __NSThread__start__ + 808
8  libsystem_pthread.dylib        0x19ac _pthread_start + 148
9  libsystem_pthread.dylib        0xe68 thread_start + 8

com.apple.NSURLConnectionLoader
com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x14e0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b24 mach_msg + 76
2  CoreFoundation                 0x7820 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xbcac __CFRunLoopRun + 1180
4  CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
5  CFNetwork                      0x2774d8 _CFURLStorageSessionDisableCache + 59988
6  Foundation                     0x6855c __NSThread__start__ + 808
7  libsystem_pthread.dylib        0x19ac _pthread_start + 148
8  libsystem_pthread.dylib        0xe68 thread_start + 8

com.apple.CFSocket.private
com.apple.CFSocket.private
0  libsystem_kernel.dylib         0x21a4 __select + 8
1  libsystem_kernel.dylib         0x21a4 select$DARWIN_EXTSN + 8
2  CoreFoundation                 0xab658 __CFSocketManager + 644
3  libsystem_pthread.dylib        0x19ac _pthread_start + 148
4  libsystem_pthread.dylib        0xe68 thread_start + 8

com.apple.root.utility-qos
com.apple.root.utility-qos
0  libsystem_kernel.dylib         0x2178 __ulock_wait + 8
1  libdispatch.dylib              0x441c _dlock_wait + 56
2  libdispatch.dylib              0x4118 _dispatch_wait_on_address + 140
3  libdispatch.dylib              0x47c0 _dispatch_group_wait_slow + 56
4  ContextKitExtraction           0x3f2c -[CKContextExecutor _awaitCompletion] + 52
5  libdispatch.dylib              0x1e68 _dispatch_call_block_and_release + 32
6  libdispatch.dylib              0x3a2c _dispatch_client_callout + 20
7  libdispatch.dylib              0x15280 _dispatch_root_queue_drain + 680
8  libdispatch.dylib              0x1596c _dispatch_worker_thread2 + 164
9  libsystem_pthread.dylib        0x1080 _pthread_wqthread + 228
10 libsystem_pthread.dylib        0xe5c start_wqthread + 8

com.apple.root.user-initiated-qos
com.apple.root.user-initiated-qos
0  libsystem_kernel.dylib         0x14e0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b24 mach_msg + 76
2  CoreFoundation                 0x7820 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xbcac __CFRunLoopRun + 1180
4  CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
5  Foundation                     0x18414 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236
6  Foundation                     0x18bd0 -[NSRunLoop(NSRunLoop) run] + 92
7  <MyAppName>                    0xf02e4 __35-[XYZEventManager initializeSocket]_block_invoke + 1294 (XYZEventManager.m:1294)
8  libdispatch.dylib              0x1e68 _dispatch_call_block_and_release + 32
9  libdispatch.dylib              0x3a2c _dispatch_client_callout + 20
10 libdispatch.dylib              0x15280 _dispatch_root_queue_drain + 680
11 libdispatch.dylib              0x1596c _dispatch_worker_thread2 + 164
12 libsystem_pthread.dylib        0x1080 _pthread_wqthread + 228
13 libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread #1
Thread
0  libsystem_kernel.dylib         0x1ab4 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread #2
Thread
0  libsystem_kernel.dylib         0x1ab4 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread #3
Thread
0  libsystem_kernel.dylib         0x1ab4 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread #4
Thread
0  libsystem_kernel.dylib         0x1ab4 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

com.sendbird.sdk.core.runloop.thread
com.sendbird.sdk.core.runloop.thread
0  libsystem_kernel.dylib         0x14e0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b24 mach_msg + 76
2  CoreFoundation                 0x7820 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xbcac __CFRunLoopRun + 1180
4  CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
5  Foundation                     0x18414 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236
6  SendBirdSDK                    0x93c64 -[SBDRunLoopThread main] + 63 (SBDRunLoopThread.m:63)
7  Foundation                     0x6855c __NSThread__start__ + 808
8  libsystem_pthread.dylib        0x19ac _pthread_start + 148
9  libsystem_pthread.dylib        0xe68 thread_start + 8

Thread #5
Thread
0  libsystem_kernel.dylib         0x1ab4 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread #6
Thread
0  libsystem_kernel.dylib         0x1ab4 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

SlashDevSlashGnoll avatar Jun 17 '22 11:06 SlashDevSlashGnoll

As @mkj-is said about this crash in our application, I would like to add my ideas: I think it could be related to UILabel.text selection and corruption memory in the application. We don't use RxSwift so widely, but it looks like some memory leak / memory corruption problem. And RxSwift/Cocoa classes are appeared to be in memory at locations of corrupted memory. Maybe it has something like 0x0 address that are used for other cases. My conclusion is, that when memory is corrupted and some UILabels are bkoren, application tries to access UILabel.text selector in part of memory where RxCocoa classes are defined

yan-zaitsev-hs avatar Jun 17 '22 11:06 yan-zaitsev-hs

It looks like react native is also having a problem with CKContextContentProviderUIScene _bestVisibleStringForView:usingExecutor. (https://github.com/facebook/react-native/issues/33084)

danielt1263 avatar Jun 17 '22 12:06 danielt1263

I went back and looked and can confirm what @mwilson-within said, the OS version for this crash are not just any flavor of iOS15 but specifically iOS15.4 and later if that helps.

SlashDevSlashGnoll avatar Jun 17 '22 12:06 SlashDevSlashGnoll

It looks like react native is also having a problem with CKContextContentProviderUIScene _bestVisibleStringForView:usingExecutor. (facebook/react-native#33084)

There is a good point, this could be some internal change in accessibility. It looks like the system is traversing the view hierarchy and when it encounters the RxCocoa.RxTableViewDelegateProxy it crashes. But it's just a presumption, I couldn't find any relevant info about the CKContextKit framework. I suppose I'll also send feedback to Apple.

mkj-is avatar Jun 17 '22 15:06 mkj-is

We're having the exact same crash within our app, iOS version 15+, been tracking it for weeks trying to find solutions. We've tried upgrading to the latest Rx release but it doesn't seem to solve the issue.

stivmac avatar Jun 20 '22 07:06 stivmac

We've just found this issue and also has been happening since iOS 15.4+ Do you guys have any clue or solution?

Rakchon-n avatar Jun 24 '22 12:06 Rakchon-n

Hey all, Thanks for the reports.

To seriously look into this I need a non-Firebase crash report. Meaning an entire non-obfuscated crash report or xccrashpoint file that I can look into would be immensely helpful.

Looking at some of the traces here this doesn't seem like something we could necessarily work around but more like a regression in iOS itself, but I'm happy to try and look into this if I get detailed enough crash details.

Thanks!

freak4pc avatar Jun 26 '22 20:06 freak4pc

Looking over the implementation of "DelegateProxy.swift" and "_RXDelegateProxy.m", I'm not sure the logic is correct. In "DelegateProxy.swift", "responds(to..." is checking super:

super.responds(to: aSelector)

But in "_RXDelegateProxy.m", "forwardInvocation" is ignoring super.

The problem is that if the base class object also chooses to use object proxying, then the first check will return true (because the base class DOES respond to the selector) but the forwardInvocation call will fail with "selector not found"(since the message was never forward to "super", which would have responded).

HabMcRuger avatar Jun 27 '22 20:06 HabMcRuger

Hey all, Thanks for the reports.

To seriously look into this I need a non-Firebase crash report. Meaning an entire non-obfuscated crash report or xccrashpoint file that I can look into would be immensely helpful.

Looking at some of the traces here this doesn't seem like something we could necessarily work around but more like a regression in iOS itself, but I'm happy to try and look into this if I get detailed enough crash details.

Thanks!

2022-06-07_23-03-54.9047_+0400-601c39d876053890e09ae677c7fd948089429656.crash.log

yan-zaitsev-hs avatar Jun 28 '22 06:06 yan-zaitsev-hs

We are seeing a similar issue NSInvalidArgumentException -[RxCocoa.RxCollectionViewDelegateProxy text]: unrecognized selector sent to instance 0x284862450 image

lilong-git avatar Jul 05 '22 06:07 lilong-git

Any updates?

iMatkovic avatar Jul 19 '22 12:07 iMatkovic

I've got nothing but over the last 90 days we have almost 25k crashes on this over 10.5k users. It accounts for 60% of all of our crashes over that time and the next biggest one accounts for 5%. It's a doozy and I can't reproduce it myself 😭

SlashDevSlashGnoll avatar Jul 19 '22 14:07 SlashDevSlashGnoll

We are experimenting with this patch. We don't have conclusive results yet. I will update you when we do. But the root cause is still unknown.

@objc
extension RxCollectionViewDelegateProxy {
    var text: String {
        return String()
    }
}

mkj-is avatar Jul 19 '22 15:07 mkj-is

We are experimenting with this patch. We don't have conclusive results yet. I will update you when we do. But the root cause is still unknown.

@objc
extension RxCollectionViewDelegateProxy {
    var text: String {
        return String()
    }
}

@mkj-is we only have 3 days of it being live, but so far no crashes on the version with this patch in place in our app. I'll update with any changes if more crashes happen with this patch in place.

Arlindo-g avatar Jul 28 '22 15:07 Arlindo-g

We'll give this a try as well. It's a workaround as it doesn't solve why something thinks the proxy should have a text method, but maybe just stop the crashing.

SlashDevSlashGnoll avatar Aug 02 '22 16:08 SlashDevSlashGnoll

We are experimenting with this patch. We don't have conclusive results yet. I will update you when we do. But the root cause is still unknown.

@objc
extension RxCollectionViewDelegateProxy {
    var text: String {
        return String()
    }
}

This fix is working good. Moreover, we added non-fatal logging

Screen Shot 2022-08-05 at 19 42 38 with results: Screen Shot 2022-08-05 at 19 42 48 It means,

that DelegateProxy.swift class returns true for this lines of code. Screen Shot 2022-08-05 at 19 45 02

Question is why _RXDelegateProxy was not invoked. This class has handled this case and it should work. Screen Shot 2022-08-05 at 19 44 35

yan-zaitsev-hs avatar Aug 05 '22 17:08 yan-zaitsev-hs

I'm OK with taking a PR for this "workaround" if anyone has some time to make one. As for the reason, this obviously seems like some regression on Apple's side as this underlying piece of code hasn't changed for ~6 years.

freak4pc avatar Aug 05 '22 18:08 freak4pc

-deleted-

yan-zaitsev-hs avatar Aug 05 '22 18:08 yan-zaitsev-hs

Hello @mkj-is , We're having the exact same crash within our app, and today we were able to reproduce it. It seems like the crash is happening when the App is open and we try to use Siri

rajaraph avatar Aug 31 '22 14:08 rajaraph

@rajaraph Any more details? What did you do with Siri to cause it? Simply trying to use Siri with our app open did not cause the problem.

The bright side I can confirm that the extension fix above to "eat" the errant method calls works for us as well, no new crashes since we sent a build out with this fix.

I'd still like to get to the bottom of this though because until the repo itself is corrected in some way, basically every app that uses RxSwift is guaranteed to have tons of crashes on later OSes.

SlashDevSlashGnoll avatar Aug 31 '22 17:08 SlashDevSlashGnoll

@SlashDevSlashGnoll Yes we just try to use Siri and it crashes immediately

rajaraph avatar Aug 31 '22 18:08 rajaraph

Hey @SlashDevSlashGnoll @yan-zaitsev-hs - As I mentioned, I'd appreciate a quick PR with this "workaround". For the time being it's safe as far as I'm concerned.

freak4pc avatar Aug 31 '22 19:08 freak4pc

PR opened! https://github.com/ReactiveX/RxSwift/pull/2445

SlashDevSlashGnoll avatar Sep 09 '22 12:09 SlashDevSlashGnoll