Bug 226896 - Some http/tests/ are crashing with ASSERTION FAILED: isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing
Summary: Some http/tests/ are crashing with ASSERTION FAILED: isInRoutingArbitrationFo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-10 13:07 PDT by Truitt Savell
Modified: 2021-06-16 15:22 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.81 KB, patch)
2021-06-15 17:16 PDT, Peng Liu
no flags Details | Formatted Diff | Diff
A follow-up patch (1.60 KB, patch)
2021-06-16 11:32 PDT, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Truitt Savell 2021-06-10 13:07:55 PDT
I have found 2 tests so far crashing with this assert, will add more as I find them:
http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control.html
http/tests/canvas/webgl/origin-clean-conformance.html

History:
https://results.webkit.org/?suite=layout-tests&suite=layout-tests&test=http%2Ftests%2Fmedia%2Fmedia-source%2Fmediasource-play-then-seek-back-with-remote-control.html&test=http%2Ftests%2Fcanvas%2Fwebgl%2Forigin-clean-conformance.html

log:
https://build.webkit.org/results/Apple-BigSur-Debug-WK2-Tests/r278699%20(2294)/http/tests/canvas/webgl/origin-clean-conformance-stderr.txt
Comment 1 Radar WebKit Bug Importer 2021-06-10 13:08:30 PDT
<rdar://problem/79156052>
Comment 2 Ryan Haddad 2021-06-10 13:16:09 PDT
Maybe this started with https://trac.webkit.org/changeset/278374/webkit?
Comment 3 Ryan Haddad 2021-06-10 13:16:42 PDT
ASSERTION FAILED: isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing
./platform/audio/mac/SharedRoutingArbitrator.mm(123) : void WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken(const WebCore::SharedRoutingArbitrator::Token &)
1   0x113791579 WTFCrash
2   0x12d45b1fb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x12f076cb1 WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken(WebCore::SharedRoutingArbitrator::Token const&)
4   0x11d1d329c WebKit::AudioSessionRoutingArbitratorProxy::endRoutingArbitration()
5   0x11bc44234 void IPC::callMemberFunctionImpl<WebKit::AudioSessionRoutingArbitratorProxy, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(), std::__1::tuple<> >(WebKit::AudioSessionRoutingArbitratorProxy*, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(), std::__1::tuple<>&&, std::__1::integer_sequence<unsigned long>)
6   0x11bc43e40 void IPC::callMemberFunction<WebKit::AudioSessionRoutingArbitratorProxy, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(), std::__1::tuple<>, std::__1::integer_sequence<unsigned long> >(std::__1::tuple<>&&, WebKit::AudioSessionRoutingArbitratorProxy*, void (WebKit::AudioSessionRoutingArbitratorProxy::*)())
7   0x11bc3f808 void IPC::handleMessage<Messages::AudioSessionRoutingArbitratorProxy::EndRoutingArbitration, WebKit::AudioSessionRoutingArbitratorProxy, void (WebKit::AudioSessionRoutingArbitratorProxy::*)()>(IPC::Decoder&, WebKit::AudioSessionRoutingArbitratorProxy*, void (WebKit::AudioSessionRoutingArbitratorProxy::*)())
8   0x11bc3f573 WebKit::AudioSessionRoutingArbitratorProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
9   0x11c19f4e5 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
10  0x11d0fafde WebKit::AuxiliaryProcessProxy::dispatchMessage(IPC::Connection&, IPC::Decoder&)
11  0x11d3d6ecf WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
Comment 4 Alexey Proskuryakov 2021-06-11 19:45:34 PDT
Is this different from bug 226787?
Comment 5 Peng Liu 2021-06-15 15:47:02 PDT
(In reply to Alexey Proskuryakov from comment #4)
> Is this different from bug 226787?

I think so.
Comment 6 Peng Liu 2021-06-15 17:16:03 PDT
Created attachment 431502 [details]
Patch
Comment 7 EWS 2021-06-15 22:40:34 PDT
Committed r278922 (238853@main): <https://commits.webkit.org/238853@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431502 [details].
Comment 8 Darin Adler 2021-06-16 09:11:04 PDT
Comment on attachment 431502 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431502&action=review

> Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm:124
> +    if (m_tokens.contains(token))
> +        m_tokens.remove(token);

Why check contains before calling remove? This adds an additional hash table lookup and has no other effect other than making the code run more slowly.

The point of this patch was to remove an incorrect assertion. Why change the code outside the assertion at all?
Comment 9 Peng Liu 2021-06-16 09:57:38 PDT
Comment on attachment 431502 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431502&action=review

>> Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm:124
>> +        m_tokens.remove(token);
> 
> Why check contains before calling remove? This adds an additional hash table lookup and has no other effect other than making the code run more slowly.
> 
> The point of this patch was to remove an incorrect assertion. Why change the code outside the assertion at all?

Oops. I thought the remove() function assumes the item must exist in the hash set. So I added the check. Will remove it.
Comment 10 Peng Liu 2021-06-16 10:41:01 PDT
Reopen this bug to land a follow-up fix.
Comment 11 Peng Liu 2021-06-16 11:32:43 PDT
Created attachment 431573 [details]
A follow-up patch
Comment 12 EWS 2021-06-16 15:22:13 PDT
Committed r278958 (238886@main): <https://commits.webkit.org/238886@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431573 [details].