Bug 137239

Summary: REGRESSION (r173272): Crash in ResourceResponse::platformSuggestedFilename() when called on the null response
Product: WebKit Reporter: mitz
Component: PlatformAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: ap, koivisto, psolanki
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Add a null check psolanki: review+

Description mitz 2014-09-29 16:22:24 PDT
Networking crashed in ResourceResponse::platformSuggestedFilename(). Here’s the top of the backtrace

* thread #1: tid = 0x299351, 0x000000010818463b CFNetwork`URLResponse::createFilenameFromResponseHeaders() + 7, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x60)
    frame #0: 0x000000010818463b CFNetwork`URLResponse::createFilenameFromResponseHeaders() + 7
    frame #1: 0x00000001081846a0 CFNetwork`URLResponse::copySuggestedFilename() + 42
  * frame #2: 0x000000010f93ed2e WebCore`WebCore::ResourceResponse::platformSuggestedFilename(this=0x00007fff58e577b8) const + 46 at ResourceResponseCFNet.cpp:123
    frame #3: 0x000000010f93ab5c WebCore`WebCore::ResourceResponseBase::suggestedFilename(this=0x00007fff58e577b8) const + 28 at ResourceResponseBase.cpp:225
    frame #4: 0x000000010f93d249 WebCore`WebCore::ResourceResponseBase::compare(a=0x00007fff58e577b8, b=0x00007f89bc00c290) + 313 at ResourceResponseBase.cpp:577
    frame #5: 0x000000010de41e5d WebCore`WebCore::operator==(a=0x00007fff58e577b8, b=0x00007f89bc00c290) + 29 at ResourceResponseBase.h:196
    frame #6: 0x000000010de41dcd WebCore`WebCore::operator!=(a=0x00007fff58e577b8, b=0x00007f89bc00c290) + 29 at ResourceResponseBase.h:197
    frame #7: 0x000000010de41be8 WebCore`WebCore::AuthenticationChallengeBase::compare(a=0x00007fff58e57760, b=0x00007f89bc00c238) + 328 at AuthenticationChallengeBase.cpp:102
    frame #8: 0x000000010f91c74d WebCore`WebCore::operator==(a=0x00007fff58e57760, b=0x00007f89bc00c238) + 29 at AuthenticationChallengeBase.h:65
    frame #9: 0x000000010f919f5d WebCore`WebCore::operator!=(a=0x00007fff58e57760, b=0x00007f89bc00c238) + 29 at AuthenticationChallengeBase.h:66
    frame #10: 0x000000010f918370 WebCore`WebCore::ResourceHandle::receivedCancellation(this=0x00007f89bb0101b0, 

The this object in frame #2 is the null ResourceResponse.

This is new in http://trac.webkit.org/r173272, the fix for bug 136534.
Comment 1 mitz 2014-09-30 09:42:38 PDT
This is getting in the way of working with anything that requires authentication. Can it be easily fixed or should r173272 be reverted in the mean time?
Comment 2 mitz 2014-10-02 17:06:11 PDT
<rdar://problem/18531395>
Comment 3 mitz 2014-10-02 17:21:00 PDT
Created attachment 239161 [details]
Add a null check
Comment 4 Pratik Solanki 2014-10-02 17:22:32 PDT
Comment on attachment 239161 [details]
Add a null check

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

> Source/WebCore/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=137239

Please add the radar link as well.
Comment 5 mitz 2014-10-02 17:34:38 PDT
(In reply to comment #4)
> (From update of attachment 239161 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=239161&action=review
> 
> > Source/WebCore/ChangeLog:4
> > +        https://bugs.webkit.org/show_bug.cgi?id=137239
> 
> Please add the radar link as well.

Radar link is there in the line above the bugs.webkit.org URL. Thanks for the review!
Comment 6 Pratik Solanki 2014-10-02 17:36:42 PDT
Comment on attachment 239161 [details]
Add a null check

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

>>> Source/WebCore/ChangeLog:4
>>> +        https://bugs.webkit.org/show_bug.cgi?id=137239
>> 
>> Please add the radar link as well.
> 
> Radar link is there in the line above the bugs.webkit.org URL. Thanks for the review!

Oh wow. How did I miss that? So used to seeing 3 lines that I assumed the radar link wasn't there.
Comment 7 mitz 2014-10-02 17:37:58 PDT
Fixed in <http://trac.webkit.org/r174252>.