Bug 194340 - Flaky API Test: TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
Summary: Flaky API Test: TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
: 189158 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-02-06 04:19 PST by Aakash Jain
Modified: 2019-07-12 09:53 PDT (History)
12 users (show)

See Also:


Attachments
Crash Log (174.46 KB, text/plain)
2019-02-08 13:55 PST, Aakash Jain
no flags Details
5/2 Crash Log (105.62 KB, text/plain)
2019-05-02 09:39 PDT, Shawn Roberts
no flags Details
Crash log - 2019-06-18-02_57 (172.60 KB, text/plain)
2019-06-18 14:20 PDT, Aakash Jain
no flags Details
Crash log - 2019-06-18-03_17 (188.63 KB, text/plain)
2019-06-18 14:21 PDT, Aakash Jain
no flags Details
Crash log - 2019-06-25-14_56 (184.69 KB, text/plain)
2019-06-26 06:21 PDT, Aakash Jain
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2019-02-06 04:19:14 PST
TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS seems flaky. In https://ews-build.webkit-uat.org/#/builders/20/builds/708, the test crashed in run-api-tests step. However, in the immediately next retry step (re-run-api-tests), it passed.

Crashed
    TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
        2019-02-06 02:12:12.192 TestWebKitAPI[18801:2992020] *** Warning: <AVPlayerViewController: 0x7ffb2304d800> is trying to enter full screen, but is not in its view's window's view controller hierarchy. This results in undefined behavior.
        Child process terminated with signal 11: Segmentation fault
Comment 1 Alexey Proskuryakov 2019-02-08 13:40:22 PST
Is there a crash log on the bot?
Comment 2 Aakash Jain 2019-02-08 13:55:47 PST
Created attachment 361532 [details]
Crash Log
Comment 3 Aakash Jain 2019-02-08 13:56:30 PST
> Is there a crash log on the bot?
Yes, added as attachment.
Comment 4 Eric Carlson 2019-02-08 15:58:13 PST
(In reply to Aakash Jain from comment #3)
> > Is there a crash log on the bot?
> Yes, added as attachment.

This isn't the same cash:

Thread 0 Crashed:: Dispatch queue: com.apple.avplayeritem.figplaybackitem
0   com.apple.CoreFoundation      	0x0000000113517d1d CFDictionaryGetValue + 29
1   com.apple.Foundation          	0x0000000112533a6a _NSSetBoolValueAndNotify + 66
2   com.apple.avfoundation        	0x000000012eb16bcf -[AVPlayerItem _updateVideoSuppressionOnFigPlaybackItem:basedOnOutputs:] + 57
3   com.apple.avfoundation        	0x000000012eb1b051 __58-[AVPlayerItem(AVPlayerItemOutputs) _evaluateVideoOutputs]_block_invoke + 117
4   libdispatch.dylib             	0x0000000113d9c51d _dispatch_call_block_and_release + 12
Comment 5 Shawn Roberts 2019-05-02 09:39:06 PDT
Created attachment 368777 [details]
5/2 Crash Log
Comment 6 Shawn Roberts 2019-05-02 09:40:07 PDT
Test is still a flaky crash

Most recent crash:

https://build.webkit.org/builders/Apple%20iOS%2012%20Simulator%20Debug%20WK2%20%28Tests%29/builds/3539

No logs on bot, but was able to get it to fail locally after 15 tries with:

run-api-tests TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS --ios-simulator --debug

attached local crash log as 5/2 Crash Log
Comment 7 Radar WebKit Bug Importer 2019-05-06 11:58:52 PDT
<rdar://problem/50507254>
Comment 8 Jer Noble 2019-05-06 14:30:27 PDT
Crash is an ASSERT in WebURLSchemeHandler::startTask(), both of which were added by Brady back in 2017; I can't tell from a brief look at that code why those assertions may be getting hit. Brady?
Comment 9 Chris Dumez 2019-05-06 14:32:23 PDT
(In reply to Jer Noble from comment #8)
> Crash is an ASSERT in WebURLSchemeHandler::startTask(), both of which were
> added by Brady back in 2017; I can't tell from a brief look at that code why
> those assertions may be getting hit. Brady?

This is what I see from Shawn's link:
ASSERTION FAILED: !m_deletionHasBegun
    /Volumes/Data/slave/ios-simulator-12-debug/build/WebKitBuild/Debug-iphonesimulator/usr/local/include/wtf/RefCounted.h(93) : bool WTF::RefCountedBase::derefBase() const
    1   0x10309f649 WTFCrash
    2   0x10309f669 WTFCrashWithSecurityImplication
    3   0x110a6bd52 WTF::RefCountedBase::derefBase() const
    4   0x110c694df WTF::RefCounted<WebCore::MediaPlayer>::deref() const
    5   0x110c69485 void WTF::derefIfNotNull<WebCore::MediaPlayer>(WebCore::MediaPlayer*)
    6   0x110c69449 WTF::RefPtr<WebCore::MediaPlayer, WTF::DumbPtrTraits<WebCore::MediaPlayer> >::~RefPtr()
    7   0x110c66075 WTF::RefPtr<WebCore::MediaPlayer, WTF::DumbPtrTraits<WebCore::MediaPlayer> >::~RefPtr()
    8   0x11334101a WebCore::HTMLVideoElement::hasVideo() const
    9   0x1132893d3 WebCore::HTMLMediaElement::mediaType() const
    10  0x113bb90f9 WebCore::PlatformMediaSession::mediaType() const
    11  0x11329b8a5 WTF::TypeCastTraits<WebCore::MediaElementSession const, WebCore::PlatformMediaSession const, false>::isType(WebCore::PlatformMediaSession const&)
    12  0x11329b885 WTF::TypeCastTraits<WebCore::MediaElementSession const, WebCore::PlatformMediaSession const, false>::isOfType(WebCore::PlatformMediaSession const&)
    13  0x11329b865 bool WTF::is<WebCore::MediaElementSession, WebCore::PlatformMediaSession const>(WebCore::PlatformMediaSession const&)
    14  0x11329b829 WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager(WebCore::MediaElementSession::PlaybackControlsPurpose)::$_14::operator()(WebCore::PlatformMediaSession const&) const
    15  0x11329b791 WTF::Function<bool (WebCore::PlatformMediaSession const&)>::CallableWrapper<WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager(WebCore::MediaElementSession::PlaybackControlsPurpose)::$_14>::call(WebCore::PlatformMediaSession const&)
    16  0x113bd1b07 WTF::Function<bool (WebCore::PlatformMediaSession const&)>::operator()(WebCore::PlatformMediaSession const&) const
    17  0x113bd1a38 WebCore::PlatformMediaSessionManager::currentSessionsMatching(WTF::Function<bool (WebCore::PlatformMediaSession const&)> const&)::$_30::operator()(WebCore::PlatformMediaSession&, unsigned long) const
    18  0x113bd19e6 WTF::Function<void (WebCore::PlatformMediaSession&, unsigned long)>::CallableWrapper<WebCore::PlatformMediaSessionManager::currentSessionsMatching(WTF::Function<bool (WebCore::PlatformMediaSession const&)> const&)::$_30>::call(WebCore::PlatformMediaSession&, unsigned long)
    19  0x113bbc427 WTF::Function<void (WebCore::PlatformMediaSession&, unsigned long)>::operator()(WebCore::PlatformMediaSession&, unsigned long) const
    20  0x113bb9d43 WebCore::PlatformMediaSessionManager::forEachSession(WTF::Function<void (WebCore::PlatformMediaSession&, unsigned long)> const&) const
    21  0x113bbb746 WebCore::PlatformMediaSessionManager::currentSessionsMatching(WTF::Function<bool (WebCore::PlatformMediaSession const&)> const&)
    22  0x11326746c WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager(WebCore::MediaElementSession::PlaybackControlsPurpose)
    23  0x11399a4b2 WebCore::Page::playbackControlsManagerUpdateTimerFired()
    24  0x1139c0121 decltype(*(std::__1::forward<WebCore::Page*&>(fp0)).*fp()) std::__1::__invoke<void (WebCore::Page::*&)(), WebCore::Page*&, void>(void (WebCore::Page::*&&&)(), WebCore::Page*&&&)
    25  0x1139c0080 std::__1::__bind_return<void (WebCore::Page::*)(), std::__1::tuple<WebCore::Page*>, std::__1::tuple<>, __is_valid_bind_return<void (WebCore::Page::*)(), std::__1::tuple<WebCore::Page*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (WebCore::Page::*)(), std::__1::tuple<WebCore::Page*>, 0ul, std::__1::tuple<> >(void (WebCore::Page::*&)(), std::__1::tuple<WebCore::Page*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&)
    26  0x1139c002c std::__1::__bind_return<void (WebCore::Page::*)(), std::__1::tuple<WebCore::Page*>, std::__1::tuple<>, __is_valid_bind_return<void (WebCore::Page::*)(), std::__1::tuple<WebCore::Page*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (WebCore::Page::*&)(), WebCore::Page*>::operator()<>()
    27  0x1139bffc9 WTF::Function<void ()>::CallableWrapper<std::__1::__bind<void (WebCore::Page::*&)(), WebCore::Page*> >::call()
    28  0x110a6b73a WTF::Function<void ()>::operator()() const
    29  0x110b14fc9 WebCore::Timer::fired()
    30  0x113b87aea WebCore::ThreadTimers::sharedTimerFiredInternal()
    31  0x113b911e1 WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0::operator()() const
    Child process terminated with signal 11: Segmentation fault
TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS Crashed
Comment 10 Chris Dumez 2019-05-06 14:33:35 PDT
(In reply to Chris Dumez from comment #9)
> (In reply to Jer Noble from comment #8)
> > Crash is an ASSERT in WebURLSchemeHandler::startTask(), both of which were
> > added by Brady back in 2017; I can't tell from a brief look at that code why
> > those assertions may be getting hit. Brady?
> 
> This is what I see from Shawn's link:
> ASSERTION FAILED: !m_deletionHasBegun
>    
> /Volumes/Data/slave/ios-simulator-12-debug/build/WebKitBuild/Debug-
> iphonesimulator/usr/local/include/wtf/RefCounted.h(93) : bool
> WTF::RefCountedBase::derefBase() const
>     1   0x10309f649 WTFCrash
>     2   0x10309f669 WTFCrashWithSecurityImplication
>     3   0x110a6bd52 WTF::RefCountedBase::derefBase() const
>     4   0x110c694df WTF::RefCounted<WebCore::MediaPlayer>::deref() const
>     5   0x110c69485 void
> WTF::derefIfNotNull<WebCore::MediaPlayer>(WebCore::MediaPlayer*)
>     6   0x110c69449 WTF::RefPtr<WebCore::MediaPlayer,
> WTF::DumbPtrTraits<WebCore::MediaPlayer> >::~RefPtr()
>     7   0x110c66075 WTF::RefPtr<WebCore::MediaPlayer,
> WTF::DumbPtrTraits<WebCore::MediaPlayer> >::~RefPtr()
>     8   0x11334101a WebCore::HTMLVideoElement::hasVideo() const
>     9   0x1132893d3 WebCore::HTMLMediaElement::mediaType() const
>     10  0x113bb90f9 WebCore::PlatformMediaSession::mediaType() const
>     11  0x11329b8a5 WTF::TypeCastTraits<WebCore::MediaElementSession const,
> WebCore::PlatformMediaSession const,
> false>::isType(WebCore::PlatformMediaSession const&)
>     12  0x11329b885 WTF::TypeCastTraits<WebCore::MediaElementSession const,
> WebCore::PlatformMediaSession const,
> false>::isOfType(WebCore::PlatformMediaSession const&)
>     13  0x11329b865 bool WTF::is<WebCore::MediaElementSession,
> WebCore::PlatformMediaSession const>(WebCore::PlatformMediaSession const&)
>     14  0x11329b829
> WebCore::HTMLMediaElement::
> bestMediaElementForShowingPlaybackControlsManager(WebCore::
> MediaElementSession::PlaybackControlsPurpose)::$_14::operator()(WebCore::
> PlatformMediaSession const&) const
>     15  0x11329b791 WTF::Function<bool (WebCore::PlatformMediaSession
> const&)>::CallableWrapper<WebCore::HTMLMediaElement::
> bestMediaElementForShowingPlaybackControlsManager(WebCore::
> MediaElementSession::PlaybackControlsPurpose)::$_14>::call(WebCore::
> PlatformMediaSession const&)
>     16  0x113bd1b07 WTF::Function<bool (WebCore::PlatformMediaSession
> const&)>::operator()(WebCore::PlatformMediaSession const&) const
>     17  0x113bd1a38
> WebCore::PlatformMediaSessionManager::currentSessionsMatching(WTF::
> Function<bool (WebCore::PlatformMediaSession const&)>
> const&)::$_30::operator()(WebCore::PlatformMediaSession&, unsigned long)
> const
>     18  0x113bd19e6 WTF::Function<void (WebCore::PlatformMediaSession&,
> unsigned
> long)>::CallableWrapper<WebCore::PlatformMediaSessionManager::
> currentSessionsMatching(WTF::Function<bool (WebCore::PlatformMediaSession
> const&)> const&)::$_30>::call(WebCore::PlatformMediaSession&, unsigned long)
>     19  0x113bbc427 WTF::Function<void (WebCore::PlatformMediaSession&,
> unsigned long)>::operator()(WebCore::PlatformMediaSession&, unsigned long)
> const
>     20  0x113bb9d43
> WebCore::PlatformMediaSessionManager::forEachSession(WTF::Function<void
> (WebCore::PlatformMediaSession&, unsigned long)> const&) const
>     21  0x113bbb746
> WebCore::PlatformMediaSessionManager::currentSessionsMatching(WTF::
> Function<bool (WebCore::PlatformMediaSession const&)> const&)
>     22  0x11326746c
> WebCore::HTMLMediaElement::
> bestMediaElementForShowingPlaybackControlsManager(WebCore::
> MediaElementSession::PlaybackControlsPurpose)
>     23  0x11399a4b2 WebCore::Page::playbackControlsManagerUpdateTimerFired()
>     24  0x1139c0121
> decltype(*(std::__1::forward<WebCore::Page*&>(fp0)).*fp())
> std::__1::__invoke<void (WebCore::Page::*&)(), WebCore::Page*&, void>(void
> (WebCore::Page::*&&&)(), WebCore::Page*&&&)
>     25  0x1139c0080 std::__1::__bind_return<void (WebCore::Page::*)(),
> std::__1::tuple<WebCore::Page*>, std::__1::tuple<>,
> __is_valid_bind_return<void (WebCore::Page::*)(),
> std::__1::tuple<WebCore::Page*>, std::__1::tuple<> >::value>::type
> std::__1::__apply_functor<void (WebCore::Page::*)(),
> std::__1::tuple<WebCore::Page*>, 0ul, std::__1::tuple<> >(void
> (WebCore::Page::*&)(), std::__1::tuple<WebCore::Page*>&,
> std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&)
>     26  0x1139c002c std::__1::__bind_return<void (WebCore::Page::*)(),
> std::__1::tuple<WebCore::Page*>, std::__1::tuple<>,
> __is_valid_bind_return<void (WebCore::Page::*)(),
> std::__1::tuple<WebCore::Page*>, std::__1::tuple<> >::value>::type
> std::__1::__bind<void (WebCore::Page::*&)(), WebCore::Page*>::operator()<>()
>     27  0x1139bffc9 WTF::Function<void
> ()>::CallableWrapper<std::__1::__bind<void (WebCore::Page::*&)(),
> WebCore::Page*> >::call()
>     28  0x110a6b73a WTF::Function<void ()>::operator()() const
>     29  0x110b14fc9 WebCore::Timer::fired()
>     30  0x113b87aea WebCore::ThreadTimers::sharedTimerFiredInternal()
>     31  0x113b911e1
> WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0::
> operator()() const
>     Child process terminated with signal 11: Segmentation fault
> TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS Crashed

Definitely points to a bad bug in media code.
Comment 11 Chris Dumez 2019-05-06 14:35:11 PDT
TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS is WebKit1 so I do not think the crash trace in attachment is related to this test. I would focus on the crash showed by:
https://build.webkit.org/builders/Apple%20iOS%2012%20Simulator%20Debug%20WK2%20%28Tests%29/builds/3539
Comment 12 Aakash Jain 2019-06-18 14:20:50 PDT
Created attachment 372382 [details]
Crash log - 2019-06-18-02_57
Comment 13 Aakash Jain 2019-06-18 14:21:35 PDT
Created attachment 372383 [details]
Crash log - 2019-06-18-03_17
Comment 14 Aakash Jain 2019-06-18 14:22:58 PDT
This test crashed again today in https://ews-build.webkit.org/#/builders/9/builds/3293

Passed on retry in https://ews-build.webkit.org/#/builders/9/builds/3294 

Crash logs attached.
Comment 15 Aakash Jain 2019-06-26 06:21:27 PDT
Created attachment 372920 [details]
Crash log - 2019-06-25-14_56
Comment 16 Aakash Jain 2019-06-26 06:23:21 PDT
This test was also flaky in https://ews-build.webkit.org/#/builders/9/builds/3631 
Crash log attached.

It would be nice if this can be fixed soon.

I am going to disable this test if I notice it flaky few more times.
Comment 17 Jer Noble 2019-06-26 10:45:50 PDT
Crashes are in a platform framework (AVFoundation). Please file a Radar.
Comment 18 Aakash Jain 2019-07-12 09:51:33 PDT
*** Bug 189158 has been marked as a duplicate of this bug. ***
Comment 19 Aakash Jain 2019-07-12 09:53:33 PDT
(In reply to Jer Noble from comment #17)
> Crashes are in a platform framework (AVFoundation). Please file a Radar.
Filed <rdar://problem/53008982>.