Bug 180304 - WorkerCacheStorageConnection should handle the case of terminated workers
Summary: WorkerCacheStorageConnection should handle the case of terminated workers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
: 180337 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-12-01 18:27 PST by youenn fablet
Modified: 2017-12-04 10:14 PST (History)
9 users (show)

See Also:


Attachments
Patch (18.59 KB, patch)
2017-12-01 18:31 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (16.39 KB, patch)
2017-12-04 09:34 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-12-01 18:27:34 PST
WorkerCacheStorageConnection should handle the case of terminated workers
Comment 1 youenn fablet 2017-12-01 18:31:34 PST
Created attachment 328203 [details]
Patch
Comment 2 Darin Adler 2017-12-02 18:53:58 PST
Comment on attachment 328203 [details]
Patch

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

> Source/WebCore/ChangeLog:14
> +        Added a method to check a worker thread is still valid.

That type of technique won’t work 100% perfectly. It’s possible that the thread has been fully deleted, but then a new thread allocated, and the new one is in the same memory so happens to have the same address.
Comment 3 youenn fablet 2017-12-02 18:57:44 PST
Comment on attachment 328203 [details]
Patch

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

>> Source/WebCore/ChangeLog:14
>> +        Added a method to check a worker thread is still valid.
> 
> That type of technique won’t work 100% perfectly. It’s possible that the thread has been fully deleted, but then a new thread allocated, and the new one is in the same memory so happens to have the same address.

I guess I could further check the thread id if the pointer is still alive.
Comment 4 youenn fablet 2017-12-04 09:34:57 PST
Created attachment 328352 [details]
Patch
Comment 5 Chris Dumez 2017-12-04 09:47:46 PST
Patch appears to fix the crash for me locally.
Comment 6 Chris Dumez 2017-12-04 10:13:50 PST
Comment on attachment 328352 [details]
Patch

Clearing flags on attachment: 328352

Committed r225481: <https://trac.webkit.org/changeset/225481>
Comment 7 Chris Dumez 2017-12-04 10:13:52 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Chris Dumez 2017-12-04 10:14:07 PST
*** Bug 180337 has been marked as a duplicate of this bug. ***
Comment 9 Radar WebKit Bug Importer 2017-12-04 10:14:22 PST
<rdar://problem/35831955>