Bug 161893

Summary: ParkingLot is going to have a bad time with threads dying
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: Web Template FrameworkAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, cdumez, cmarcelo, commit-queue, dbates, ddkilzer, ggaren, jfbastien, keith_miller, mark.lam, mhahnenb, msaboff, oliver, saam, sam
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
the patch msaboff: review+

Description Filip Pizlo 2016-09-12 22:12:56 PDT
If a thread dies right as it falls out of parkConditionally, then unparkOne() and friends might die because they will dereference a deallocated ThreadData.

The solution is to ref-count ThreadData's.  When unparkOne() and friends want to hold onto a ThreadData past the queue lock, they can +1 the ref count.
Comment 1 Filip Pizlo 2016-09-12 22:14:15 PDT
Created attachment 288674 [details]
the patch
Comment 2 Michael Saboff 2016-09-13 07:31:16 PDT
Comment on attachment 288674 [details]
the patch

r=me
Comment 3 Filip Pizlo 2016-09-13 09:01:48 PDT
Landed in https://trac.webkit.org/changeset/205859
Comment 4 David Kilzer (:ddkilzer) 2016-09-13 12:27:02 PDT
<rdar://problem/23594388>