Bug 238687

Summary: [iOS] Several tests in media/modern-media-controls crash in -[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: MediaAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, hi, jer.noble, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Wenson Hsieh 2022-04-01 16:19:55 PDT
These are the ones I reproduced locally (basically the ones that present the media controls context menu):

media/modern-media-controls/overflow-support/button-state.html
media/modern-media-controls/overflow-support/chapters.html
media/modern-media-controls/overflow-support/playback-speed.html
media/modern-media-controls/tracks-support/audio-multiple-tracks.html
media/modern-media-controls/tracks-support/audio-single-track.html
media/modern-media-controls/tracks-support/auto-text-track.html
media/modern-media-controls/tracks-support/click-track-in-contextmenu.html
media/modern-media-controls/tracks-support/hidden-tracks.html
media/modern-media-controls/tracks-support/off-text-track.html

```
Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   WebKit                        	       0x151e56c8c WTF::RefPtr<WTF::StringImpl, WTF::RawPtrTraits<WTF::StringImpl>, WTF::DefaultRefDerefTraits<WTF::StringImpl> >::operator!() const + 12
1   WebKit                        	       0x151ea3689 WTF::String::isEmpty() const + 25
2   WebKit                        	       0x15357f693 -[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4::operator()(WebCore::MediaControlsContextMenuItem&) const + 51
3   WebKit                        	       0x15357f64d decltype(static_cast<-[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4>(fp)(static_cast<WebCore::MediaControlsContextMenuItem&>(fp0))) std::__1::__invoke<-[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4, WebCore::MediaControlsContextMenuItem&>(-[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4&&, WebCore::MediaControlsContextMenuItem&) + 29
4   WebKit                        	       0x15357f5c2 std::__1::invoke_result<-[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4, WebCore::MediaControlsContextMenuItem&>::type std::__1::invoke<-[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4, WebCore::MediaControlsContextMenuItem&>(-[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4&&, WebCore::MediaControlsContextMenuItem&) + 50
5   WebKit                        	       0x1535717be WTF::RetainPtr<NSMutableArray> WTF::createNSArray<WTF::Vector<WebCore::MediaControlsContextMenuItem, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, -[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4>(WTF::Vector<WebCore::MediaControlsContextMenuItem, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, -[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:]::$_4&&) + 238
6   WebKit                        	       0x153571681 -[WKActionSheetAssistant _uiMenuElementsForMediaControlContextMenuItems:] + 49
7   WebKit                        	       0x153571b89 -[WKActionSheetAssistant showMediaControlsContextMenu:items:completionHandler:] + 809
8   WebKit                        	       0x1549d4d15 -[WKContentView(WKInteraction) _showMediaControlsContextMenu:items:completionHandler:] + 117
```
Comment 1 Wenson Hsieh 2022-04-01 16:20:58 PDT Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2022-04-01 18:49:43 PDT
Created attachment 456424 [details]
Patch
Comment 3 Tim Horton 2022-04-01 18:51:07 PDT
Comment on attachment 456424 [details]
Patch

Oof
Comment 4 Wenson Hsieh 2022-04-01 22:44:38 PDT
Comment on attachment 456424 [details]
Patch

Thanks for the review!

(In reply to Tim Horton from comment #3)
> Comment on attachment 456424 [details]
> Patch
> 
> Oof

...indeed :P
Comment 5 EWS 2022-04-01 23:28:57 PDT
Committed r292260 (249158@main): <https://commits.webkit.org/249158@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456424 [details].
Comment 6 Radar WebKit Bug Importer 2022-04-01 23:29:17 PDT
<rdar://problem/91196038>