1 2 3 4 5 6 go runtime deadlock detector
play

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


  1. 1

  2. 2

  3. 3

  4. 4

  5. 5

  6. 6

  7. Go runtime deadlock detector 7

  8. 8

  9. 9

  10. 10

  11. 11

  12. 12

  13. 13

  14. 14

  15. 15

  16. 16

  17. 17

  18. 18

  19. 19

  20. 20

  21. 21

  22. 22

  23. 23

  24. 24

  25. 25

  26. 26

  27. 27

  28. Implementation Toolchain Gong written in Haskell Gong The tool checks input behavioural types Behavioural types for liveness and channel safety. GoInfer GoInfer written in Go go/ssa package The tool loads source code, type-checks and builds SSA IR using go/ssa package, Load main() then extracts communication from the SSA IR as behavioural types. Go source code f a i c t r t A * C o m p * l e n t t e e A t * * s i W s n E github.com/nickng/gong e L o l C C l P D * O o * c e u s P u m E e e R n * o t t e v y d s a E * a d e u l t a 28

  29. 29

  30. 30

  31. 31

  32. Evaluation # chans Analysis [4] Examples LoC unbuf. buf. Live Safe Time (ms) Static Safe 19 2 0 � � 209.55 sieve × 23 2 0 14638.4 fib � � × 23 1 1 � � 32173.8 fib-async × 19 2 0 206.63 fact � � × dinephil [2] 56 3 0 � � 646921.76 × 41 0 1 48.12 jobsched � � × concsys [1] 112 2 0 � 323.75 × × fanin [5, 4] 36 3 0 � � 89.14 � � × 1 fanin-alt [4] 37 3 0 � 209.02 � � mismatch [4] 26 2 0 � 26.59 � × × fixed [4] 25 2 0 24.58 � � � � alt-bit [3] 74 0 2 � � 405.78 � � 40 3 0 31.01 forselect � � � � 32 2 0 � � 34.08 � � cond-recur 1 : testing for channel close state is not supported in this version 32

  33. 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 . 32

Recommend


More recommend