Bug 125939 - [iOS] Frequent ASSERT(hasOneRef()) in SharedBuffer::releasePurgeableBuffer
Summary: [iOS] Frequent ASSERT(hasOneRef()) in SharedBuffer::releasePurgeableBuffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 12:34 PST by Tim Horton
Modified: 2013-12-18 13:01 PST (History)
7 users (show)

See Also:


Attachments
patch (2.51 KB, patch)
2013-12-18 12:37 PST, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-12-18 12:34:30 PST
http://trac.webkit.org/changeset/146082 fixed this by not making a purgeable buffer if a SharedBuffer has multiple refs, but the check was put in ResourceBuffer::createPurgeableBuffer instead of down in SharedBuffer::createPurgeableBuffer. This is fine for ToT WebKit, because ResourceBuffer::createPurgeableBuffer is the only caller of SharedBuffer::createPurgeableBuffer, but causes trouble for not-quite-yet-upstreamed iOS SharedBuffer code, which has another caller of SharedBuffer::createPurgeableBuffer.

Pushing the early-return down into SharedBuffer::createPurgeableBuffer makes more sense and will fix the aforementioned assertion failures on iOS, and hopefully resolve some hard-to-track-down crashes.
Comment 1 Tim Horton 2013-12-18 12:37:55 PST
Created attachment 219558 [details]
patch
Comment 2 Pratik Solanki 2013-12-18 12:50:15 PST
Comment on attachment 219558 [details]
patch

Patch looks fine to me. Though you'll need an official reviewer to give you r+.
Comment 3 Tim Horton 2013-12-18 13:01:41 PST
http://trac.webkit.org/changeset/160792