RESOLVED FIXED226612
fast/dom/Window/property-access-on-cached-window-after-frame-removed.html (layout-test) may crash
https://bugs.webkit.org/show_bug.cgi?id=226612
Summary fast/dom/Window/property-access-on-cached-window-after-frame-removed.html (la...
Jean-Yves Avenard [:jya]
Reported 2021-06-03 17:40:23 PDT
fast/dom/Window/property-access-on-cached-window-after-frame-removed.html may crash if the MediaSession is constructed when we have no page. This is an intermittent failure. Reason being: we only construct the MediaSessionCoordinator when a Page exists, and MediaSession::coordinator() returns a reference which would attempt to dereference a null pointer.
Attachments
Patch (8.41 KB, patch)
2021-06-03 18:58 PDT, Jean-Yves Avenard [:jya]
no flags
Patch (8.45 KB, patch)
2021-06-03 20:06 PDT, Jean-Yves Avenard [:jya]
no flags
Radar WebKit Bug Importer
Comment 1 2021-06-03 17:41:16 PDT
Jean-Yves Avenard [:jya]
Comment 2 2021-06-03 18:58:53 PDT
Jean-Yves Avenard [:jya]
Comment 3 2021-06-03 20:06:25 PDT
EWS
Comment 4 2021-06-03 21:16:48 PDT
Committed r278448 (238468@main): <https://commits.webkit.org/238468@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430534 [details].
Darin Adler
Comment 5 2021-06-04 13:16:38 PDT
Comment on attachment 430534 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430534&action=review > Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h:52 > + WEBCORE_EXPORT static Ref<MediaSessionCoordinator> create(ScriptExecutionContext*); Since we were changing this, it might have been good to make this take a reference instead of a pointer too. Next time, I guess. > Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h:76 > + MediaSessionCoordinator(ScriptExecutionContext*); In a situation like this I suggest we add "explicit" now that the constructor has only a single argument. In practice it’s not critical since this is private anyway, and doing a conversion by accident is unlikely.
Jean-Yves Avenard [:jya]
Comment 6 2021-06-04 16:13:30 PDT
Comment on attachment 430534 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430534&action=review >> Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h:76 >> + MediaSessionCoordinator(ScriptExecutionContext*); > > In a situation like this I suggest we add "explicit" now that the constructor has only a single argument. In practice it’s not critical since this is private anyway, and doing a conversion by accident is unlikely. This is an oversight, I should have done so. We should have a static analyser enforcing the rule that single argument constructor must be made explicit.
Note You need to log in before you can comment on or make changes to this bug.