| Summary: | DelayedReleaseScope in MarkedAllocator::tryAllocateHelper is racy | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Mark Hahnenberg <mhahnenberg> | ||||||||||||
| Component: | JavaScriptCore | Assignee: | Mark Hahnenberg <mhahnenberg> | ||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||
| Severity: | Normal | CC: | commit-queue, ggaren, mark.lam | ||||||||||||
| Priority: | P2 | ||||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Mark Hahnenberg
2014-02-11 17:52:14 PST
(In reply to comment #0) > It causes the VM to drop the lock in the middle of adding a new block to the allocator, so another thread could come in and add a block before we're done. Actually, it was the DelayedReleaseScope in tryAllocateHelper that was wrong. Created attachment 223936 [details]
Patch
Comment on attachment 223936 [details]
Patch
This still has issues.
Created attachment 223941 [details]
Patch
Created attachment 223942 [details]
Patch
Created attachment 223969 [details]
Patch
Comment on attachment 223969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223969&action=review > Source/JavaScriptCore/heap/MarkedAllocator.cpp:109 > + void* head = tryPopFreeList(bytes); > ASSERT(head); According to tryPopFreeList() below, it can return a 0. So, is this assertion still valid? (In reply to comment #7) > (From update of attachment 223969 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=223969&action=review > > > Source/JavaScriptCore/heap/MarkedAllocator.cpp:109 > > + void* head = tryPopFreeList(bytes); > > ASSERT(head); > > According to tryPopFreeList() below, it can return a 0. So, is this assertion still valid? Yes. We will loop around the while loop until m_freeList.head is not null. If m_freeList.head is not null then tryPopFreeList *must* succeed. Comment on attachment 223969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223969&action=review > Source/JavaScriptCore/heap/MarkedAllocator.cpp:116 > + ASSERT(m_currentBlock); RELEASE_ASSERT? > Source/JavaScriptCore/heap/MarkedAllocator.cpp:127 > ASSERT(!m_heap->isBusy()); Can we RELEASE_ASSERT here without hurting perf? Created attachment 223996 [details]
Patch
Comment on attachment 223996 [details]
Patch
r=me
Comment on attachment 223996 [details] Patch Clearing flags on attachment: 223996 Committed r164009: <http://trac.webkit.org/changeset/164009> All reviewed patches have been landed. Closing bug. |