RESOLVED FIXED 175164
ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
https://bugs.webkit.org/show_bug.cgi?id=175164
Summary ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebC...
Matt Lewis
Reported 2017-08-03 16:37:49 PDT
The test webrtc/audio-peer-connection-webaudio.html has become a flaky crash on Sierra, El Capitan, and iOS simulator Debug tests according to the dashboard. https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=webrtc%2Faudio-peer-connection-webaudio.html https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK2%20(Tests)/builds/2330 https://build.webkit.org/results/Apple%20Sierra%20Debug%20WK2%20(Tests)/r220178%20(2330)/results.html The change that caused the failure is most likely: https://trac.webkit.org/changeset/219377/webkit ASSERTION FAILED: writtenAudioDuration >= readAudioDuration /Volumes/Data/slave/sierra-debug/build/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp(124) : bool WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() 1 0x109fd736d WTFCrash 2 0x1133be0fe WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() 3 0x1133be47c WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long) 4 0x1133bea39 WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable(WebCore::MediaStreamTrackPrivate&, WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long) 5 0x1133becac non-virtual thunk to WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable(WebCore::MediaStreamTrackPrivate&, WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long) 6 0x11314cebe WebCore::MediaStreamTrackPrivate::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long) 7 0x1133aace7 WebCore::RealtimeMediaSource::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long) 8 0x1131d7bf9 WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers(unsigned int) 9 0x1131d897b WebCore::MockRealtimeAudioSourceMac::render(double) 10 0x1131d69b9 WebCore::MockRealtimeAudioSource::tick() 11 0x1131d74c5 WTF::RunLoop::Timer<WebCore::MockRealtimeAudioSource>::fired() 12 0x10a027921 WTF::RunLoop::TimerBase::timerFired(__CFRunLoopTimer*, void*) 13 0x7fffafbf4e04 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ 14 0x7fffafbf4a93 __CFRunLoopDoTimer 15 0x7fffafbf45ea __CFRunLoopDoTimers 16 0x7fffafbebfc1 __CFRunLoopRun 17 0x7fffafbeb544 CFRunLoopRunSpecific 18 0x7fffaf14bebc RunCurrentEventLoopInMode 19 0x7fffaf14bcf1 ReceiveNextEventCommon 20 0x7fffaf14bb26 _BlockUntilNextEventMatchingListInModeWithFilter 21 0x7fffad6e4a54 _DPSNextEvent 22 0x7fffade607ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 23 0x7fffad6d93db -[NSApplication run] 24 0x7fffad6a3e0e NSApplicationMain 25 0x7fffc5b7c8c7 _xpc_objc_main 26 0x7fffc5b7b2e4 xpc_main 27 0x103613105 main 28 0x7fffc5923235 start 29 0x1 LEAK: 4 WebPageProxy
Attachments
Crash log (125.42 KB, text/plain)
2017-08-17 17:48 PDT, Ryan Haddad
no flags
Patch (2.39 KB, patch)
2017-09-15 09:24 PDT, youenn fablet
no flags
Patch (3.51 KB, patch)
2017-09-15 11:55 PDT, youenn fablet
no flags
Patch (3.51 KB, patch)
2017-09-15 12:00 PDT, youenn fablet
no flags
Radar WebKit Bug Importer
Comment 1 2017-08-03 16:38:14 PDT
Ryan Haddad
Comment 2 2017-08-17 17:48:47 PDT
Created attachment 318449 [details] Crash log Just saw this crash with webrtc/peer-connection-remote-audio-mute.html https://build.webkit.org/results/Apple%20El%20Capitan%20Debug%20WK2%20(Tests)/r220876%20(2609)/results.html
youenn fablet
Comment 3 2017-09-15 09:24:40 PDT
youenn fablet
Comment 4 2017-09-15 09:39:54 PDT
This is a tentative fix, I was only able to reproduce the crash once.
Eric Carlson
Comment 5 2017-09-15 09:48:20 PDT
Comment on attachment 320909 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320909&action=review > Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:124 > + ASSERT(writtenAudioDuration + 0.0000001 >= readAudioDuration); The magic number isn't good, can you use WTF::areEssentiallyEqual() instead? > Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:133 > + ASSERT(writtenAudioDuration + 0.0000001 >= readAudioDuration); Ditto.
youenn fablet
Comment 6 2017-09-15 11:55:00 PDT
youenn fablet
Comment 7 2017-09-15 11:58:48 PDT
I was able to reproduce the patch once. It seems that sometimes at the very beginning we are reading more than what is available. I wonder whether the sample converter is filling with zeros. Previous patch was not covering this case. New patch adds a check to ensure that we do not call pullData if available pushed data is not at least 10ms. That should fix the crash and improves a bit on efficiency probably.
youenn fablet
Comment 8 2017-09-15 12:00:15 PDT
youenn fablet
Comment 9 2017-09-15 12:01:02 PDT
> pushed data is not at least 10ms. buffered data greater or equal to 10ms.
WebKit Commit Bot
Comment 10 2017-09-15 13:39:45 PDT
Comment on attachment 320940 [details] Patch Clearing flags on attachment: 320940 Committed r222109: <http://trac.webkit.org/changeset/222109>
WebKit Commit Bot
Comment 11 2017-09-15 13:39:49 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.