Bug 203902

Summary: Make sure we never end up with NetworkDataTaskCocoa TaskIdentifier conflicts
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, bfulgham, commit-queue, ggaren, koivisto, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 201822    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2019-11-06 08:32:47 PST
Make sure we never end up with NetworkDataTaskCocoa TaskIdentifier conflicts.
Comment 1 Chris Dumez 2019-11-06 08:37:50 PST
Created attachment 382930 [details]
Patch
Comment 2 WebKit Commit Bot 2019-11-06 12:14:18 PST
Comment on attachment 382930 [details]
Patch

Clearing flags on attachment: 382930

Committed r252141: <https://trac.webkit.org/changeset/252141>
Comment 3 WebKit Commit Bot 2019-11-06 12:14:20 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2019-11-06 12:15:18 PST
<rdar://problem/56953662>
Comment 5 Alex Christensen 2019-11-06 18:04:07 PST
Comment on attachment 382930 [details]
Patch

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

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1247
> +    RELEASE_ASSERT(!map.contains(taskIdentifier));

This will be hit in practice.  I think we should just roll this out and fix it the right way in https://bugs.webkit.org/show_bug.cgi?id=203934
Comment 6 Chris Dumez 2019-11-06 18:06:34 PST
(In reply to Alex Christensen from comment #5)
> Comment on attachment 382930 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=382930&action=review
> 
> > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1247
> > +    RELEASE_ASSERT(!map.contains(taskIdentifier));
> 
> This will be hit in practice.  I think we should just roll this out and fix
> it the right way in https://bugs.webkit.org/show_bug.cgi?id=203934

I did not add any new assertion, so I am not sure I understand why.

Please do NOT revert.
Comment 7 Chris Dumez 2019-11-06 18:21:51 PST
Comment on attachment 382930 [details]
Patch

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

>>> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1247
>>> +    RELEASE_ASSERT(!map.contains(taskIdentifier));
>> 
>> This will be hit in practice.  I think we should just roll this out and fix it the right way in https://bugs.webkit.org/show_bug.cgi?id=203934
> 
> I did not add any new assertion, so I am not sure I understand why.
> 
> Please do NOT revert.

I don't think we generally revert patches without proof that something is wrong. You claim that this assertion will be hit in practice but have not explained at all why it would be. Also, note that I merely turned this debug assertion into a release one. If it really gets hit, I'd argue a crash is better than a security bug.

My patch is simply refactoring the code to have it in a single place and strengthening the assertions. Therefore, I am not sure what you mean by fixing the right way. https://bugs.webkit.org/show_bug.cgi?id=203934 re-enables isolated sessions, it does not simply fix things.