Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on OTAudioDevice protocol with the func estimatedRenderDelay() #263

Open
YoavGro opened this issue Aug 14, 2022 · 6 comments
Open
Labels

Comments

@YoavGro
Copy link

YoavGro commented Aug 14, 2022

Hi, we are experiencing some crashes with OTAudioDevice.

The call stack is the following:

Crashed: WebRTCWorkerThread

  • 0 Riverside 0xe4ff4 @objc RVSAudioDeviceManager.estimatedRenderDelay() + 4377530356
  • 1 Riverside 0x38b20c otc_audio_proxy_playout_delay + 4380307980
  • 2 Riverside 0x3f98ec callback_playout_delay(otk_audio_device*) + 4380760300
  • 3 Riverside 0x3f92ac webrtc::OTAudioDevice::PlayoutDelay(unsigned short&) const + 4380758700
  • 4 Riverside 0x39637c webrtc::OTAudioDeviceModule::PlayoutDelay(unsigned short*) const + 4380353404
  • 5 Riverside 0x420ea4 webrtc::voe::(anonymous namespace)::ChannelReceive::UpdatePlayoutTimestamp(bool, long long) + 4380921508
  • 6 Riverside 0x41fd08 webrtc::voe::(anonymous namespace)::ChannelReceive::OnRtpPacket(webrtc::RtpPacketReceived const&) + 4380917000
  • 7 Riverside 0x697ab4 webrtc::RtpDemuxer::OnRtpPacket(webrtc::RtpPacketReceived const&) + 4383505076
  • 8 Riverside 0x699488 webrtc::RtpStreamReceiverController::OnRtpPacket(webrtc::RtpPacketReceived const&) + 4383511688
  • 9 Riverside 0x4279dc webrtc::internal::Call::DeliverRtp(webrtc::MediaType, rtc::CopyOnWriteBuffer, long long) + 4380948956
  • 10 Riverside 0x427d9c webrtc::internal::Call::DeliverPacket(webrtc::MediaType, rtc::CopyOnWriteBuffer, long long) + 4380949916
  • 11 Riverside 0x65cd34 cricket::WebRtcVoiceMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer, long long) + 4383264052
  • 12 Riverside 0x4dacc4 rtc::FireAndForgetAsyncClosure<cricket::BaseChannel::OnRtpPacket(webrtc::RtpPacketReceived const&)::$_6>::Execute() + 4381682884
  • 13 Riverside 0x4faeec rtc::AsyncInvoker::OnMessage(rtc::Message*) + 4381814508
  • 14 Riverside 0x512fa0 rtc::Thread::Dispatch(rtc::Message*) + 4381912992
  • 15 Riverside 0x512014 rtc::Thread::ProcessMessages(int) + 4381909012
  • 16 Riverside 0x5133a4 rtc::Thread::PreRun(void*) + 4381914020
  • 17 libsystem_pthread.dylib 0x19ac _pthread_start + 148
  • 18 libsystem_pthread.dylib 0xe68 thread_start + 8

We are using pod 'OpenTok', '~> 2.22.3'

@ronenmv
Copy link

ronenmv commented Aug 15, 2022

following Yoav's question, the crash is happening cause of UInt32 to UInt16 casting,
a possible solution is :

public func estimatedRenderDelay() -> UInt16 {
let value = min(self.playoutDelay, UInt32(UInt16.max))
return UInt16(value)
}

this would avoid the crash I guess, but it might cause unexpected result,
please advice

@v-kpheng
Copy link
Contributor

Thanks, @YoavGro, for letting us know about this issue. We've been investigating this, actually: https://jira.vonage.com/browse/OPENTOK-48681.

We haven't had any success with reproducing the issue, though. That said, we added some resiliency to one of our sample applications. Can you please see if https://github.com/opentok/opentok-ios-sdk-samples-swift/pull/177/files helps you?

Thanks! 🙏

@v-kpheng
Copy link
Contributor

v-kpheng commented Nov 9, 2022

@goncalocostamendes, does https://github.com/opentok/opentok-ios-sdk-samples-swift/pull/177/files need to be ported to this repo as well?

Please advise. Thanks!

@goncalocostamendes
Copy link
Contributor

The final version is opentok/opentok-ios-sdk-samples-swift#178! We should debated if we port it to this sample as well, yes!

Regarding this issue raised in particular, in objc casting UInt32 to UInt16 should not raise a crash, but an overflow of the variable.

@YoavGro are you using our objc or swift samples (https://github.com/opentok/opentok-ios-sdk-samples or https://github.com/opentok/opentok-ios-sdk-samples-swift)?

@v-kpheng
Copy link
Contributor

@goncalocostamendes, yeah, let's port that to this as well, please. Thanks!

@v-kpheng v-kpheng added to do and removed needs test labels Nov 17, 2022
@v-kpheng v-kpheng removed the to do label Feb 8, 2023
@v-kpheng
Copy link
Contributor

v-kpheng commented Mar 8, 2023

Tracked internally as https://jira.vonage.com/browse/OPENTOK-51225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants