问题
I'm using JavaScript IceLink library (http://www.frozenmountain.com/products/icelink) to implement webrtc video chat. Application crashes sometimes after video chat. Chrome logs shows the next problem: [240:1520:0819/141151:VERBOSE1:webrtcsession.cc(1016)] SetAudioPlayoutVolume: No audio channel exists.
void WebRtcSession::SetAudioPlayoutVolume(uint32 ssrc, double volume) {
ASSERT(signaling_thread()->IsCurrent());
ASSERT(volume >= 0 && volume <= 10);
if (!voice_channel_) {
LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists.";
return;
}
if (!voice_channel_->SetOutputScaling(ssrc, volume, volume))
ASSERT(false);
}
(https://code.google.com/p/webrtc/source/browse/trunk/talk/app/webrtc/webrtcsession.cc?r=6855#990)
Looks like - crash - is an expected behavior for Chrome browser, but it is a bad user experience for my application. Can I handle this situation somehow? I need to get rid of this crash.
回答1:
Whether a crash is "expected behavior" is an interesting question.
Semantically, an assert(condition)
kind of statement means
Unless
condition
is true, something is very, very wrong
Apparently, Chrome developers subscribe to the Crash Early philosophy - if you cannot meaningfully recover from a failure state, you are expected to terminate as soon as possible. In that regard, it is "expected" behavior.
Then again, if an assert is tripped, this means an error in the program. If this was an expected state, there would not be a crash, but meaningful reaction. Therefore, you're hitting a bug in Chrome, not "expected" behavior. A user should not be able to trigger a crash, even if there is a fault in the library you're using.
You should test your app with the latest Chrome version (dev/Canary builds). If the error is still there - it's a clear bug you should report. If the error does not reproduce in Canary, it was a bug that's fixed and all you can do is wait for the next Chrome version that has it fixed.
来源:https://stackoverflow.com/questions/25383579/chrome-packaged-app-crashes-after-webrtc-video-chat