RESOLVED FIXED Bug 179792
Fix occasional crash when adding and removing videos
https://bugs.webkit.org/show_bug.cgi?id=179792
Summary Fix occasional crash when adding and removing videos
Alex Christensen
Reported 2017-11-16 13:03:46 PST
Fix occasional crash when adding and removing videos
Attachments
Patch (1.47 KB, patch)
2017-11-16 13:06 PST, Alex Christensen
ggaren: review+
Alex Christensen
Comment 1 2017-11-16 13:06:16 PST
Geoffrey Garen
Comment 2 2017-11-16 16:48:31 PST
Comment on attachment 327097 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327097&action=review r=me > Source/WebCore/ChangeLog:11 > + Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader& > + but in ObjC if session is null it will call a method on null, which crashes. I don't understand this explanation. A message to nil is well-defined in Objective-C: it returns a zero value and does not crash. Maybe the actual problem is that _restart calls the C++ member function requestResource, passing nullptr as the |this| value. Is the the case? Would be good to fix this explanation. > Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm:451 > + if (!self.session) > + return; > + > ASSERT(isMainThread()); > [self _cancel]; Should we put the ASSERT at the top so we don't skip it in the null session case?
Alex Christensen
Comment 3 2017-11-16 21:50:51 PST
(In reply to Geoffrey Garen from comment #2) > I don't understand this explanation. A message to nil is well-defined in > Objective-C: it returns a zero value and does not crash. > > Maybe the actual problem is that _restart calls the C++ member function > requestResource, passing nullptr as the |this| value. Is the the case? That's exactly what's going on. > Would be good to fix this explanation. I did. > > Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm:451 > > + if (!self.session) > > + return; > > + > > ASSERT(isMainThread()); > > [self _cancel]; > > Should we put the ASSERT at the top so we don't skip it in the null session > case? Good idea! Done. http://trac.webkit.org/r224960
Radar WebKit Bug Importer
Comment 4 2017-11-16 21:51:16 PST
Alex Christensen
Comment 5 2017-11-17 13:52:37 PST
Alex Christensen
Comment 6 2017-11-27 15:39:34 PST
Note You need to log in before you can comment on or make changes to this bug.