opentok / opentok-ios-sdk-samples

Example applications that use the OpenTok iOS SDK
https://tokbox.com/developer/sdks/ios
MIT License
200 stars 117 forks source link

Crash iOS 14 [VGRTCDefaultVideoEncoderFactory supportedCodecs] #278

Closed egarni closed 1 year ago

egarni commented 1 year ago

Describe the bug Hello, we're getting quite a few crash reports on iOS 14, using the OTXCFramework (2.24.1)

Stracktrace:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x129dc0 __exceptionPreprocess
1  libobjc.A.dylib                0x287a8 objc_exception_throw
2  CoreFoundation                 0x19c5a0 -[__NSCFString characterAtIndex:].cold.1
3  CoreFoundation                 0x1a85f8 -[__NSPlaceholderDictionary initWithCapacity:].cold.1
4  CoreFoundation                 0x16b90 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
5  CoreFoundation                 0x94b0 +[NSDictionary dictionaryWithObjects:forKeys:count:]
6  MeetingRoom                    0x251e6c +[VGRTCDefaultVideoEncoderFactory supportedCodecs]
7  MeetingRoom                    0x25224c -[VGRTCDefaultVideoEncoderFactory supportedCodecs]
8  MeetingRoom                    0x739680 webrtc::ObjCVideoEncoderFactory::GetSupportedFormats() const
9  MeetingRoom                    0x3959f4 cricket::WebRtcVideoEngine::send_codecs() const
10 MeetingRoom                    0x1a920c webrtc::PeerConnectionFactory::GetVideoEncoderSupportedCodecs()
11 MeetingRoom                    0x1a9170 webrtc::PeerConnectionFactory::PeerConnectionFactory(rtc::scoped_refptr<webrtc::ConnectionContext>, webrtc::PeerConnectionFactoryDependencies*)
12 MeetingRoom                    0x1ad2f4 rtc::RefCountedObject<webrtc::PeerConnectionFactory>::RefCountedObject<rtc::scoped_refptr<webrtc::ConnectionContext>&, webrtc::PeerConnectionFactoryDependencies*>(rtc::scoped_refptr<webrtc::ConnectionContext>&, webrtc::PeerConnectionFactoryDependencies*&&)
13 MeetingRoom                    0x1a9078 rtc::scoped_refptr<webrtc::PeerConnectionFactory> rtc::make_ref_counted<webrtc::PeerConnectionFactory, rtc::scoped_refptr<webrtc::ConnectionContext>&, webrtc::PeerConnectionFactoryDependencies*, (webrtc::PeerConnectionFactory*)0>(rtc::scoped_refptr<webrtc::ConnectionContext>&, webrtc::PeerConnectionFactoryDependencies*&&)
14 MeetingRoom                    0x1a9000 webrtc::PeerConnectionFactory::Create(webrtc::PeerConnectionFactoryDependencies)
15 MeetingRoom                    0x1a8ee8 webrtc::CreateModularPeerConnectionFactory(webrtc::PeerConnectionFactoryDependencies)
16 MeetingRoom                    0x1aa530 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> rtc::FunctionView<rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> ()>::CallVoidPtr<webrtc::CreateModularPeerConnectionFactory(webrtc::PeerConnectionFactoryDependencies)::$_2>(rtc::FunctionView<rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> ()>::VoidUnion)
17 MeetingRoom                    0x1aa4bc rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> rtc::Thread::Invoke<rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>, void>(rtc::Location const&, rtc::FunctionView<rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> ()>)::'lambda'()::operator()() const
18 MeetingRoom                    0x2880fc webrtc::webrtc_new_closure_impl::ClosureTask<rtc::Thread::Send(rtc::Location const&, rtc::MessageHandler*, unsigned int, rtc::MessageData*)::$_2>::Run()
19 MeetingRoom                    0x2871d0 rtc::Thread::QueuedTaskHandler::OnMessage(rtc::Message*)
20 MeetingRoom                    0x28693c rtc::Thread::Dispatch(rtc::Message*)
21 MeetingRoom                    0x2859c8 rtc::Thread::ProcessMessages(int)
22 MeetingRoom                    0x286dcc rtc::Thread::PreRun(void*)
23 libsystem_pthread.dylib        0x1bfc (Missing UUID 496dc4232dd43031bccf93e889035a34)
24 libsystem_pthread.dylib        0xa758 (Missing UUID 496dc4232dd43031bccf93e889035a34)

Expected behavior Shouldn't crash

Device (please compete the following information):

v-kpheng commented 1 year ago

Thanks, @egarni, for filing this issue. Does the crashing go away with 2.24.2, the latest release?

Also, does this crash impact just certain devices? Lastly, do you have steps to reproduce?

egarni commented 1 year ago

Here is the percentages. All using iOS 14 Screenshot 2023-03-09 at 07 42 25

We downgraded to the version 2.23.1 that we knew was stable. We didn't dare upgrading to 2.24.2 since the release note does not mention any crash fix. Has Vonage fixed any crash on iOS 14 in 2.24.2?

We unfortunately have no way to reproduce, we know that it consistently crashes for some of our users: Screenshot 2023-03-09 at 07 47 24

egarni commented 1 year ago

@v-kpheng Do you know if something was fixed in 2.24.2 regarding this crash?

v-kpheng commented 1 year ago

@v-kpheng Do you know if something was fixed in 2.24.2 regarding this crash?

@egarni, apologies for the belated reply. SDK 2.24.2 has improved camera management. It's been well received by some other users, fwiw. It's tough to know if it'll help with the crashes you're seeing though. Sorry.

Can you give it a try, please? Alternatively, steps to reproduce would help a lot.