/
Dynamic Race Prediction in  Dynamic Race Prediction in 

Dynamic Race Prediction in  - PowerPoint Presentation

min-jolicoeur
min-jolicoeur . @min-jolicoeur
Follow
397 views
Uploaded On 2018-02-13

Dynamic Race Prediction in  - PPT Presentation

Linear Time Umang Mathur Dileep Kini Mahesh Viswanathan University of Illinois at Urbana Champaign Debugging concurrent p rograms is a nightmare Reasoning about all possible interleavings ID: 631192

rel acq wcp thread acq rel thread wcp race races sync predictable events predictive data time critical analysis 160 10k program trace

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Dynamic Race Prediction in " is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Dynamic Race Prediction in Linear Time

Umang Mathur

Dileep Kini

Mahesh Viswanathan

University of Illinois at Urbana ChampaignSlide2

Debugging concurrent programs is a nightmare

Reasoning about all possible inter-leavings !

Data Races, Deadlocks, ……

Fundamental Challenge !

Data RacesSlide3

Data Races and How to Find ThemA data race occurs in an

executionSlide4

Data Races and How to Find ThemA data race occurs

in an execution when two concurrent threads consecutively accessing a shared memory

location

Thread t1

Thread t2

1

acq

(l)

2

r(x)

3

w(x)

4

rel

(l)Slide5

Data Races and How to Find ThemA data race occurs in an execution when two concurrent threads consecutively accessing a shared memory location

At

least one of the events is a write

Thread t1

Thread t2

1

acq

(l)

2

r(x)

3

w(x)

4

rel

(l)Slide6

Thread t1

Thread t2

1

acq

(l)

2

r(x)

3

w(x)

4

rel

(l)

Data Races and How to Find Them

A data race occurs in an execution when two concurrent threads consecutively accessing a shared memory location

At

least one of the events is a writeSlide7

Static Race Detection – Undecidable in general, false positivesDynamic Race DetectionLockset Based (Eraser)

– false alarmsSound

Predictive Analysis Happens Before

(Lamport)

Causally Precedes (Smaragdakis et al)

Maximal Causal Models

(Rosu et al)

Our technique detects more races and scales too !

Data Races and How to Find ThemSlide8

Predictive AnalysisA given execution may not have a race, but can provide insights on other possible executions (by the same program) that exhibit race.

Thread t1

Thread t2

1

w(x)

2

acq

(l)

3

r(x)

4

rel

(l)

Thread t1

Thread t2

1

acq

(l)

2

w(x)

3

r(x)

4

rel

(l)

No data

race

PREDICTSlide9

Predictive AnalysisA given execution may not have a race, but can provide insights on other possible executions (by the same program) that exhibit race.

Thread t1

Thread t2

1

w(x)

2

acq

(l)

3

r(x)

4

rel

(l)

Thread t1

Thread t2

1

acq

(l)

2

w(x)

3

r(x)

4

rel

(l)

No data

race

Predictable data race

Data race uncovered

PREDICTSlide10

Predictive AnalysisTrace σ’ is a correct reordering

of a trace σ if :

σ’|t is a prefix of

σ|t for every thread t

Critical sections do not overlapAll reads in σ’ see the same values

as in

σ – last w(x) before any r(x) is the same in both σ

and

σ

Thread t1

Thread t2

1

w(x)

2

acq

(l)3r(x)

4

rel

(l)

5

acq

(l)

6

rel

(l)

Thread t1

Thread t21acq(l)

2

r(x)

3

rel

(l)

4

acq

(l)

5

w(x)

6

rel

(l)

Any program that generates

σ

can also generate

all its correct

reorderingsSlide11

Predictive AnalysisTrace σ’ is a correct reordering

of a trace σ if :

σ’|t is a prefix of

σ|t for every thread t

Critical sections do not overlapAll reads in σ’ see the same values

as in

σ – last w(x) before any r(x) is the same in both σ

and

σ

Thread t1

Thread t2

1

w(x)

2

acq

(l)3r(x)

4

rel

(l)

5

acq

(l)

6

rel

(l)

Thread t1

Thread t21acq(l)

2

r(x)

3

rel

(l)

4

acq

(l)

5

w(x)

6

rel

(l)

❌Slide12

Predictive AnalysisTrace σ’ is a correct reordering

of a trace σ if :

σ’|t is a prefix of

σ|t for every thread t

Critical sections do not overlapAll reads in σ’ see the same values

as in

σ – last w(x) before any r(x) is the same in both σ

and

σ

Predictive analysis techniques tend to check if there is a correct reordering of a given trace

σ

that exhibits a concurrency error, typically using partial orders over the events in

σSlide13

Predictive Analysis - HBOrder events in a trace (≤HB ) :

Events inside a thread are ordered as seen in the trace.Order critical sections as they appear in the trace.

Declare a race when two conflicting accesses are unordered.

Admits an online linear time algorithm

Thread t1

Thread t2

1

acq

(l)

2

rel

(l)

3

acq

(l)

4

r(x)

5

rel

(l)

6

w(x)

7

r(x)

2

Data Race

1

1

1

1

1

Pair of read/write events on same memory location performed by different threads, of which at least one is a writeSlide14

Thread t1

Thread t2

1

acq

(l)

2

r(x)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

w(x)

8

rel

(l)

1

1

1

1

1

1

2

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

r(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

rel

(l)

8

r(y)

1

1

1

1

1

1

2

No HB race

Predictive Analysis - HB

No HB race

No predictable raceSlide15

Thread t1

Thread t2

1

acq

(l)

2

r(x)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

w(x)

8

rel

(l)

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

r(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

rel

(l)

8

r(y)

Predictive Analysis - HB

No HB race

No HB race

No predictable race

Predictable raceSlide16

Thread t1

Thread t2

1

acq

(l)

2

r(x)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

w(x)

8

rel

(l)

Thread t1

Thread t2

1

2

3

4

5

6

7

8

acq

(l)

r(x)

rel

(l)

acq

(l)

r(x)

rel

(l)

w(y)

r(y)

w(y)

HB is too conservative !

r(y)

Predictive Analysis - HB

No HB race

No HB race

No predictable race

Predictable raceSlide17

<CP is the smallest transitive relation that orders e1 and e2 if:e1 = rel(l)

, e2 = acq(l

), and their critical sections have conflicting eventse1 =

rel(l), e2 =

acq(l), and their critical sections have events ordered by <CP

.

∃e3 such that e1 ≤HB e3

<

CP

e2

or e1 <

CP

e3

HB

e2

Partial order ≤CP = <CP ∪Thread-orderDeclare a race when two conflicting accesses are unordered.acq(l)r(x)rel(l)

acq

(l)

w(x)

rel

(l)

acq

(l)

e

rel

(l)

acq(l)

e’

rel

(l)

1

2

e1

e3

e2

3

HB

CP

CP

Sound Predictive Race Detection in Polynomial Time, Y.

Smaragdakis

et al

,

POPL

2012

Predictive Analysis - CPSlide18

Predictive Analysis - CP

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

r(y)

8

rel

(l)

1

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(y)

7

r(x)

8

rel

(l)

No CP race

No predictable raceSlide19

Predictive Analysis - CP

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

r(y)

8

rel

(l)

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(y)

7

r(x)

8

rel

(l)

No CP race

No predictable raceSlide20

Predictive Analysis - CP

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

r(y)

8

rel

(l)

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(y)

7

r(x)

8

rel

(l)

1

No CP race

No CP race

No predictable raceSlide21

Predictive Analysis - CP

Thread t1

Thread t2

1

w(y)

2

acq

(l)

3

w(x)

4

rel

(l)

5

acq

(l)

6

r(x)

7

r(y)

8

rel

(l)

Thread t1

Thread t2

1

2

3

4

5

6

7

8

w(y)

acq

(l)

w(x)

rel

(l)

acq(l)

r(y)

r(x)

rel

(l)

r(y)

acq

(l)

w(y)

w(y)

r(y)

No CP race

No CP race

No predictable race

Predictable race missed by CPSlide22

CP misses races CP does not have a linear time algorithm – fails to scale to traces having millions of eventsResort to windowing –

can miss even HB races !

Remedy ?WCP to the rescue

Predictive Analysis - CP

Linear running time

Detects races missed by CPSlide23

Weak Causal Precedence<WCP is the smallest transitive relation that orders e1 and e2 if:

e1 = rel

(l), e2 = r(x)/w(x) inside a critical section of lock l

, and e2 conflicts with an event in crit. sec. of e1e1

= rel(l), e2 =

rel

(l), and their critical sections have events ordered by <WCP

∃e3 such that e1

HB

e3

<

WCP

e2

or e1 <

WCP

e3 ≤HB e2 Partial order ≤WCP = <WCP ∪Thread-orderDeclare a race when two conflicting accesses are unordered.acq(l)r(x)rel(l)

acq

(l)

w(x)

rel

(l)

acq

(l)

e

rel

(l)

acq(l)

e’

rel

(l)

1

2

e1

e3

e2

3

HB

WCP

WCPSlide24

WCP v/s CP

acq

(l)

r(x)

rel

(l)

acq

(l)

w(x)

rel

(l)

WCP

CP

Rule 1.

Rule 2.

acq

(l)

e

rel

(l)

acq

(l)

e’

rel

(l)

WCP

CP

WCP adds fewer orderings than CP, thus allowing for more correct re-orderingsSlide25

Thread t1

Thread t2

1

2

3

4

5

6

7

8

w(y)

acq

(l)

w(x)

rel

(l)

acq(l)

r(y)

r(x)

rel

(l)

WCP v/s CPSlide26

Thread t1

Thread t2

1

2

3

4

5

6

7

8

w(y)

acq

(l)

w(x)

rel

(l)

acq(l)

r(y)

r(x)

rel

(l)

WCP v/s CP

Predictable race missed by CP

CP

WCP

Predictable race

caught

by

WCPSlide27

Thread t1

Thread t2

1

2

3

4

5

6

7

8

w(y)

acq

(l)

w(x)

rel

(l)

acq(l)

r(y)

r(x)

rel

(l)

r(y)

acq

(l)

w(y)

w(y)

r(y)

WCP v/s CP

Predictable race missed by CP

Predictable race caught by WCPSlide28

WCP SoundnessWCP is weakly sound

Given

any trace

σ

, if

σ

exhibits a WCP-race then

σ

exhibits a predictable race or a

predictable deadlock

conflicting events unordered by

WCP

Any program generating

σ

can generate an execution σ’ (correct reordering) exhibiting a race/deadlockAssumption - Nested locking paradigmProof of soundness is non trivial. Soundness proof for CP was incorrect.Slide29

Vector Clock AlgorithmAssigns timestamp

Ce to each event e, similar to HB vector clock algorithm

Timestamps are vector times

(clocks) – thread indexed vectors, supporting various operations : comparison (⊑

), join (⊔), update, etc.,

C

e ⊑ Ce’ iff

e

WCP

e’

conflicting events with unordered timestamps imply a WCP race

One pass online algorithm

detects races as they occurProcesses events as they are generated, updates internal state (comprising of vector clocks and FIFO queues) Slide30

Vector Clock AlgorithmLinear running time –

O(n) where n is the number of events

Worst case space requirement – O(n)

Empirically, the space overhead was observed to be small.Optimal space usage –

any single pass algorithm for WCP takes Ω(n) space

Optimal time/space tradeoff

– For any algorithm computing WCP in time T(n) and space S(n), it must be the case that T(n)S(n)

 Slide31

Weak Causal PrecedenceWCP detects all races (and deadlocks) detected by CP or HB, and even more

WCP admits a

linear time algorithm

HB < CP < WCP

CP < HB ≈

WCPSlide32

Experimental Evaluation

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Program

LOC

#Events

#

Thrds

#Locks

#Races

WCP Queue Length (%)

Time

WCP

HB

RV

WCP

HB

RV

Max

w

=1K,

s

=60s

w

=10K,

s

=240s

w

=1K,

s=60sw=10K, s=240saccount871304344

4

4

4

0

0.2s

0.3s

1s

1s

airline

83

128

2

0

4

4

4

4

4

0

0.2s

0.2s

0.8s

2s

array

36

47

3

2

0

0

0

0

0

4.3

0.2s

0.2s

1.1s

0.8s

boundedbuffer

334

333

2

2

2

2

2

2

2

0

0.3s

0.2s

1s

0.8s

bubblesort

274

4K

10

2

6

6

6

0

6

2.4

0.7s

0.5s

3.6s

7m3s

bufwriter

199

11.7M

6

1

2

2

2

2

2

10

47s

22.4s

4.1s

4.5s

critical

63

55

4

0

8

8

8

8

8

0

0.2s

0.2s

1.7s

0.9s

mergesort

298

3K

5

3

3

3

1

2

2

1.3

0.4s

0.4s

1.1s

1.4s

pingpong

124

146

4

0

7

7

7

7

7

0

0.5s

0.3s

1.2s

1.3s

moldyn

2.9K

164K

3

2

44

44

2

2

2

0

7.1s

2.4s

1.4s

17.4s

montecarlo

2.9K

7.2M

3

3

5

5

1

1

1

0

23.4s

16.2s

7.1s

5.7s

raytracer

2.9K

16K

3

8

3

3

2

3

3

0

2.4s

1s

1s

14.7s

derby

302K

1.3M

4

1112

23

23

11

-

14

0.6

16.2s

7s

31.2s

TO

eclipse

560K

87M

14

8263

66

64

5

0

8

0.4

6m51s

4m18s

26.2s

15m10s

ftpserver

32K

49K

11

304

36

36

10

12

12

2.2

5.7s

2.1s

3.8s

3m

jigsaw

101K

3M

13

280

14

11

6

6

6

0

18s

11.8s

2.8s

14.7s

lusearch

410K

216M

7

118

160

160

0

0

0

0

10m13s

6m48s

57.3s

46.7s

xalan

180K

122M

6

2494

18

15

7

8

8

0.1

7m22s

4m46s

43.1s

7m11sSlide33

Experimental Evaluation

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Program

LOC

#Events

#

Thrds

#Locks

#Races

WCP Queue Length (%)

Time

WCP

HB

RV

WCP

HB

RV

Max

w

=1K,

s

=60s

w

=10K,

s

=240s

w

=1K,

s=60sw=10K, s=240saccount871304344

4

4

4

0

0.2s

0.3s

1s

1s

airline

83

128

2

0

4

4

4

4

4

0

0.2s

0.2s

0.8s

2s

array

36

47

3

2

0

0

0

0

0

4.3

0.2s

0.2s

1.1s

0.8s

boundedbuffer

334

333

2

2

2

2

2

2

2

0

0.3s

0.2s

1s

0.8s

bubblesort

274

4K

10

2

6

6

6

0

6

2.4

0.7s

0.5s

3.6s

7m3s

bufwriter

199

11.7M

6

1

2

2

2

2

2

10

47s

22.4s

4.1s

4.5s

critical

63

55

4

0

8

8

8

8

8

0

0.2s

0.2s

1.7s

0.9s

mergesort

298

3K

5

3

3

3

1

2

2

1.3

0.4s

0.4s

1.1s

1.4s

pingpong

124

146

4

0

7

7

7

7

7

0

0.5s

0.3s

1.2s

1.3s

moldyn

2.9K

164K

3

2

44

44

2

2

2

0

7.1s

2.4s

1.4s

17.4s

montecarlo

2.9K

7.2M

3

3

5

5

1

1

1

0

23.4s

16.2s

7.1s

5.7s

raytracer

2.9K

16K

3

8

3

3

2

3

3

0

2.4s

1s

1s

14.7s

derby

302K

1.3M

4

1112

23

23

11

-

14

0.6

16.2s

7s

31.2s

TO

eclipse

560K

87M

14

8263

66

64

5

0

8

0.4

6m51s

4m18s

26.2s

15m10s

ftpserver

32K

49K

11

304

36

36

10

12

12

2.2

5.7s

2.1s

3.8s

3m

jigsaw

101K

3M

13

280

14

11

6

6

6

0

18s

11.8s

2.8s

14.7s

lusearch

410K

216M

7

118

160

160

0

0

0

0

10m13s

6m48s

57.3s

46.7s

xalan

180K

122M

6

2494

18

15

7

8

8

0.1

7m22s

4m46s

43.1s

7m11s

6

WCP

4

4

0

2

6

2

8

3

7

44

5

3

23

66

36

14

160

18

Detects more races than other techniquesSlide34

Experimental Evaluation

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Program

LOC

#Events

#

Thrds

#Locks

#Races

WCP Queue Length (%)

Time

WCP

HB

RV

WCP

HB

RV

Max

w

=1K,

s

=60s

w

=10K,

s

=240s

w

=1K,

s=60sw=10K, s=240saccount871304344

4

4

4

0

0.2s

0.3s

1s

1s

airline

83

128

2

0

4

4

4

4

4

0

0.2s

0.2s

0.8s

2s

array

36

47

3

2

0

0

0

0

0

4.3

0.2s

0.2s

1.1s

0.8s

boundedbuffer

334

333

2

2

2

2

2

2

2

0

0.3s

0.2s

1s

0.8s

bubblesort

274

4K

10

2

6

6

6

0

6

2.4

0.7s

0.5s

3.6s

7m3s

bufwriter

199

11.7M

6

1

2

2

2

2

2

10

47s

22.4s

4.1s

4.5s

critical

63

55

4

0

8

8

8

8

8

0

0.2s

0.2s

1.7s

0.9s

mergesort

298

3K

5

3

3

3

1

2

2

1.3

0.4s

0.4s

1.1s

1.4s

pingpong

124

146

4

0

7

7

7

7

7

0

0.5s

0.3s

1.2s

1.3s

moldyn

2.9K

164K

3

2

44

44

2

2

2

0

7.1s

2.4s

1.4s

17.4s

montecarlo

2.9K

7.2M

3

3

5

5

1

1

1

0

23.4s

16.2s

7.1s

5.7s

raytracer

2.9K

16K

3

8

3

3

2

3

3

0

2.4s

1s

1s

14.7s

derby

302K

1.3M

4

1112

23

23

11

-

14

0.6

16.2s

7s

31.2s

TO

eclipse

560K

87M

14

8263

66

64

5

0

8

0.4

6m51s

4m18s

26.2s

15m10s

ftpserver

32K

49K

11

304

36

36

10

12

12

2.2

5.7s

2.1s

3.8s

3m

jigsaw

101K

3M

13

280

14

11

6

6

6

0

18s

11.8s

2.8s

14.7s

lusearch

410K

216M

7

118

160

160

0

0

0

0

10m13s

6m48s

57.3s

46.7s

xalan

180K

122M

6

2494

18

15

7

8

8

0.1

7m22s

4m46s

43.1s

7m11s

12

WCP

0.2s

0.2s

0.2s

0.3s

0.7s

47s

0.2s

0.4s

0.5s

7.1s

23.4s

2.4s

16.2s

6m51s

5.7s

18s

10m13s

7m22s

FastSlide35

Experimental Evaluation

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Program

LOC

#Events

#

Thrds

#Locks

#Races

WCP Queue Length (%)

Time

WCP

HB

RV

WCP

HB

RV

Max

w

=1K,

s

=60s

w

=10K,

s

=240s

w

=1K,

s=60sw=10K, s=240saccount871304344

4

4

4

0

0.2s

0.3s

1s

1s

airline

83

128

2

0

4

4

4

4

4

0

0.2s

0.2s

0.8s

2s

array

36

47

3

2

0

0

0

0

0

4.3

0.2s

0.2s

1.1s

0.8s

boundedbuffer

334

333

2

2

2

2

2

2

2

0

0.3s

0.2s

1s

0.8s

bubblesort

274

4K

10

2

6

6

6

0

6

2.4

0.7s

0.5s

3.6s

7m3s

bufwriter

199

11.7M

6

1

2

2

2

2

2

10

47s

22.4s

4.1s

4.5s

critical

63

55

4

0

8

8

8

8

8

0

0.2s

0.2s

1.7s

0.9s

mergesort

298

3K

5

3

3

3

1

2

2

1.3

0.4s

0.4s

1.1s

1.4s

pingpong

124

146

4

0

7

7

7

7

7

0

0.5s

0.3s

1.2s

1.3s

moldyn

2.9K

164K

3

2

44

44

2

2

2

0

7.1s

2.4s

1.4s

17.4s

montecarlo

2.9K

7.2M

3

3

5

5

1

1

1

0

23.4s

16.2s

7.1s

5.7s

raytracer

2.9K

16K

3

8

3

3

2

3

3

0

2.4s

1s

1s

14.7s

derby

302K

1.3M

4

1112

23

23

11

-

14

0.6

16.2s

7s

31.2s

TO

eclipse

560K

87M

14

8263

66

64

5

0

8

0.4

6m51s

4m18s

26.2s

15m10s

ftpserver

32K

49K

11

304

36

36

10

12

12

2.2

5.7s

2.1s

3.8s

3m

jigsaw

101K

3M

13

280

14

11

6

6

6

0

18s

11.8s

2.8s

14.7s

lusearch

410K

216M

7

118

160

160

0

0

0

0

10m13s

6m48s

57.3s

46.7s

xalan

180K

122M

6

2494

18

15

7

8

8

0.1

7m22s

4m46s

43.1s

7m11s

3

#Events

130

128

47

333

4K

11.7M

55

3K

146

164K

7.2M

16K

1.3M

87M

49K

3M

216M

122M

Scales to large tracesSlide36

Experimental Evaluation

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Program

LOC

#Events

#

Thrds

#Locks

#Races

WCP Queue Length (%)

Time

WCP

HB

RV

WCP

HB

RV

Max

w

=1K,

s

=60s

w

=10K,

s

=240s

w

=1K,

s=60sw=10K, s=240saccount871304344

4

4

4

0

0.2s

0.3s

1s

1s

airline

83

128

2

0

4

4

4

4

4

0

0.2s

0.2s

0.8s

2s

array

36

47

3

2

0

0

0

0

0

4.3

0.2s

0.2s

1.1s

0.8s

boundedbuffer

334

333

2

2

2

2

2

2

2

0

0.3s

0.2s

1s

0.8s

bubblesort

274

4K

10

2

6

6

6

0

6

2.4

0.7s

0.5s

3.6s

7m3s

bufwriter

199

11.7M

6

1

2

2

2

2

2

10

47s

22.4s

4.1s

4.5s

critical

63

55

4

0

8

8

8

8

8

0

0.2s

0.2s

1.7s

0.9s

mergesort

298

3K

5

3

3

3

1

2

2

1.3

0.4s

0.4s

1.1s

1.4s

pingpong

124

146

4

0

7

7

7

7

7

0

0.5s

0.3s

1.2s

1.3s

moldyn

2.9K

164K

3

2

44

44

2

2

2

0

7.1s

2.4s

1.4s

17.4s

montecarlo

2.9K

7.2M

3

3

5

5

1

1

1

0

23.4s

16.2s

7.1s

5.7s

raytracer

2.9K

16K

3

8

3

3

2

3

3

0

2.4s

1s

1s

14.7s

derby

302K

1.3M

4

1112

23

23

11

-

14

0.6

16.2s

7s

31.2s

TO

eclipse

560K

87M

14

8263

66

64

5

0

8

0.4

6m51s

4m18s

26.2s

15m10s

ftpserver

32K

49K

11

304

36

36

10

12

12

2.2

5.7s

2.1s

3.8s

3m

jigsaw

101K

3M

13

280

14

11

6

6

6

0

18s

11.8s

2.8s

14.7s

lusearch

410K

216M

7

118

160

160

0

0

0

0

10m13s

6m48s

57.3s

46.7s

xalan

180K

122M

6

2494

18

15

7

8

8

0.1

7m22s

4m46s

43.1s

7m11s

11

WCP Queue Length (%)

0

0

4.3

0

2.4

10

0

1.3

0

0

0

0

0.6

0.4

2.2

0

0

0.1

Low memory overheadSlide37

ConclusionsWCP –

generalizes the CP relationLinear time algorithm

Detects more races in practiceScales to large traces

Future Work

Further weakeningControl flow information

Epoch based optimizationsSlide38

Thank You !Slide39
Slide40

Thread t1

Thread t2

Thread t3

1

acq

(l)

2

acq

(m)

3

rel

(m)

4

r(z)

5

rel

(l)

6

acq

(m)

7

acq

(n)

8

sync(x)

9

rel

(n)

10

acq

(n)

11

acq

(l)

12

rel

(l)

13

sync(x)

14

w(z)

15

rel

(n)

16

sync(y)

17

sync(y)

18

rel

(m)

WCP DeadlockSlide41

Thread t1

Thread t2

Thread t3

1

acq

(l)

2

acq

(m)

3

rel

(m)

4

r(z)

5

rel

(l)

6

acq

(m)

7

acq

(n)

8

sync(x)

9

rel

(n)

10

acq

(n)

11

acq

(l)

12

rel

(l)

13

sync(x)

14

w(z)

15

rel

(n)

16

sync(y)

17

sync(y)

18

rel

(m)

WCP Deadlock

acq

(

xlock

)

r(

xvar

)

w(

xvar

)

rel

(

xlock

)Slide42

Thread t1

Thread t2

Thread t3

1

acq

(l)

2

acq

(m)

3

rel

(m)

4

r(z)

5

rel

(l)

6

acq

(m)

7

acq

(n)

8

sync(x)

9

rel

(n)

10

acq

(n)

11

acq

(l)

12

rel

(l)

13

sync(x)

14

w(z)

15

rel

(n)

16

sync(y)

17

sync(y)

18

rel

(m)

WCP Deadlock

WCP

WCPSlide43

Thread t1

Thread t2

Thread t3

1

acq

(l)

2

acq

(m)

3

rel

(m)

4

r(z)

5

rel

(l)

6

acq

(m)

7

acq

(n)

8

sync(x)

9

rel

(n)

10

acq

(n)

11

acq

(l)

12

rel

(l)

13

sync(x)

14

w(z)

15

rel

(n)

16

sync(y)

17

sync(y)

18

rel

(m)

WCP Deadlock

WCP

WCP race, but no predictable race

WCPSlide44

Thread t1

Thread t2

Thread t3

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

WCP Deadlock

acq

(l)

acq(m)

rel

(m)

r(z)

rel

(l)

acq(m)

acq(n)

sync(x)

rel(n)

acq(n)

acq(l)

rel(l)

sync(x)

w(z)

rel(n)

sync(y)

sync(y)

rel(m)

acq

(n)

acq

(m)

acq

(l)

acq

(m)

acq

(n)

acq

(l)

Predictable deadlock