1 2 3 4 5 6 Go runtime deadlock detector 7 8 9 10 11 12 - - PowerPoint PPT Presentation

1 2 3 4 5 6 go runtime deadlock detector
SMART_READER_LITE
LIVE PREVIEW

1 2 3 4 5 6 Go runtime deadlock detector 7 8 9 10 11 12 - - PowerPoint PPT Presentation

1 2 3 4 5 6 Go runtime deadlock detector 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Implementation Toolchain Gong written in Haskell Gong The tool checks input behavioural types Behavioural types


slide-1
SLIDE 1

1

slide-2
SLIDE 2

2

slide-3
SLIDE 3

3

slide-4
SLIDE 4

4

slide-5
SLIDE 5

5

slide-6
SLIDE 6

6

slide-7
SLIDE 7

7

Go runtime deadlock detector

slide-8
SLIDE 8

8

slide-9
SLIDE 9

9

slide-10
SLIDE 10

10

slide-11
SLIDE 11

11

slide-12
SLIDE 12

12

slide-13
SLIDE 13

13

slide-14
SLIDE 14

14

slide-15
SLIDE 15

15

slide-16
SLIDE 16

16

slide-17
SLIDE 17

17

slide-18
SLIDE 18

18

slide-19
SLIDE 19

19

slide-20
SLIDE 20

20

slide-21
SLIDE 21

21

slide-22
SLIDE 22

22

slide-23
SLIDE 23

23

slide-24
SLIDE 24

24

slide-25
SLIDE 25

25

slide-26
SLIDE 26

26

slide-27
SLIDE 27

27

slide-28
SLIDE 28

28

Implementation

Toolchain

Gong GoInfer

go/ssa package

Go source code Load main() Behavioural types Gong written in Haskell The tool checks input behavioural types for liveness and channel safety. GoInfer written in Go The tool loads source code, type-checks and builds SSA IR using go/ssa package, then extracts communication from the SSA IR as behavioural types. github.com/nickng/gong

C

  • n

s i s t e n t * C

  • m

p l e t e * W e l l D

  • c

u m e n t e d * E a s y t

  • R

e u s e *

*

E v a l u a t e d

* P O P L *

A r t i f a c t

* A E C

slide-29
SLIDE 29

29

slide-30
SLIDE 30

30

slide-31
SLIDE 31

31

slide-32
SLIDE 32

32

Evaluation

# chans Analysis [4] Examples LoC unbuf. buf. Live Safe Time (ms) Static Safe sieve 19 2

  • 209.55

× fib 23 2

  • 14638.4

× fib-async 23 1 1

  • 32173.8

× fact 19 2

  • 206.63

× dinephil [2] 56 3

  • 646921.76

× jobsched 41 1

  • 48.12

× concsys [1] 112 2 ×

  • 323.75

× fanin [5, 4] 36 3

  • 89.14
  • fanin-alt [4]

37 3 ×1

  • 209.02
  • mismatch [4]

26 2 ×

  • 26.59
  • ×

fixed [4] 25 2

  • 24.58
  • alt-bit [3]

74 2

  • 405.78
  • forselect

40 3

  • 31.01
  • cond-recur

32 2

  • 34.08
  • 1: testing for channel close state is not supported in this version
slide-33
SLIDE 33

32

Collection of Golang concurrency patterns. https://github.com/stillwater-sc/concurrency.

  • E. Giachino, N. Kobayashi, and C. Laneve.

Deadlock analysis of unbounded process networks. In CONCUR, volume 8704 of LNCS, pages 63–77. Springer, 2014.

  • R. Milner.

Communication and Concurrency. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1989.

  • N. Ng and N. Yoshida.

Static Deadlock Detection for Concurrent Go by Global Session Graph Synthesis. In CC 2016, pages 174–184. ACM, 2016. Sameer Ajmani. Go Concurrency Patterns: Pipelines and cancellation, 2014. https://blog.golang.org/pipelines.