All Projects → nickng → Dingo Hunter

nickng / Dingo Hunter

Licence: apache-2.0
Static analyser for finding Deadlocks in Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Dingo Hunter

Reading
A list of computer-science readings I recommend
Stars: ✭ 1,919 (+605.51%)
Mutual labels:  static-analysis, concurrency, research
gospal
Go static program analyser
Stars: ✭ 56 (-79.41%)
Mutual labels:  research, static-analysis
Bolt
Bolt is a language with in-built data-race freedom!
Stars: ✭ 215 (-20.96%)
Mutual labels:  static-analysis, concurrency
SOMns
SOMns: A Newspeak for Concurrency Research
Stars: ✭ 62 (-77.21%)
Mutual labels:  research, concurrency
Cfripper
Library and CLI tool for analysing CloudFormation templates and check them for security compliance.
Stars: ✭ 265 (-2.57%)
Mutual labels:  static-analysis
Cone
Cone Programming Language
Stars: ✭ 257 (-5.51%)
Mutual labels:  concurrency
Python Atomicwrites
Powerful Python library for atomic file writes.
Stars: ✭ 253 (-6.99%)
Mutual labels:  concurrency
Parsifal
Parsifal is a tool to assist researchers to perform Systematic Literature Reviews
Stars: ✭ 254 (-6.62%)
Mutual labels:  research
Chronos
Chronos - A static race detector for the go language
Stars: ✭ 272 (+0%)
Mutual labels:  static-analysis
Tool lists
Links to tools by subject
Stars: ✭ 270 (-0.74%)
Mutual labels:  static-analysis
Drone Core
The core crate for Drone, an Embedded Operating System.
Stars: ✭ 263 (-3.31%)
Mutual labels:  concurrency
Gowp
golang worker pool , Concurrency limiting goroutine pool
Stars: ✭ 259 (-4.78%)
Mutual labels:  concurrency
Stormpot
A fast object pool for the JVM
Stars: ✭ 267 (-1.84%)
Mutual labels:  concurrency
Pymeasure
Scientific measurement library for instruments, experiments, and live-plotting
Stars: ✭ 255 (-6.25%)
Mutual labels:  research
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (-0.37%)
Mutual labels:  static-analysis
Krane
Kubernetes RBAC static Analysis & visualisation tool
Stars: ✭ 254 (-6.62%)
Mutual labels:  static-analysis
Badtouch
Scriptable network authentication cracker
Stars: ✭ 262 (-3.68%)
Mutual labels:  concurrency
Seahorn
SeaHorn Verification Framework
Stars: ✭ 270 (-0.74%)
Mutual labels:  static-analysis
Promise Pool
Map-like, concurrent promise processing
Stars: ✭ 258 (-5.15%)
Mutual labels:  concurrency
Zio
ZIO — A type-safe, composable library for async and concurrent programming in Scala
Stars: ✭ 3,167 (+1064.34%)
Mutual labels:  concurrency

dingo-hunter Build Status

Static analyser for finding Deadlocks in Go

This is a static analyser to model concurrency and find deadlocks in Go code. The main purpose of this tool is to infer from Go source code its concurrency model in either of the two formats:

  • Communicating Finite State Machines (CFSMs)
  • MiGo types

The inferred models are then passed to separate tools for formal analysis. In both approaches, we apply a system known in the literature as Session Types to look for potential communication mismatches to preempt potential deadlocks.

Install

dingo-hunter can be installed by go get, go version go1.7.1 is required.

$ go get -u github.com/nickng/dingo-hunter

Usage

There are two approaches (CFSMs and MiGo types) based on two research work.

CFSMs approach

This approach generates CFSMs as models for goroutines spawned in the program, the CFSMs are then passed to a synthesis tool to construct a global choreography and check for validity (See paper).

First install the synthesis tool gmc-synthesis by checking out the submodule:

$ cd $GOPATH/src/github.com/nickng/dingo-hunter; git submodule init; git submodule update
$ cd third_party/gmc-synthesis

Follow README to install and build gmc-synthesis, i.e.

$ cabal install MissingH split Graphalyze
$ ./getpetrify # and install to /usr/local/ or in $PATH
$ ghc -threaded GMC.hs --make && ghc --make BuildGlobal

To run CFSMs generation on example/local-deadlock/main.go:

$ dingo-hunter cfsms --prefix deadlock example/local-deadlock/main.go

Output should say 2 channels, then run synthesis tool on extracted CFSMs

$ cd third_party/gmc-synthesis
$ ./runsmc inputs/deadlock_cfsms 2 # where 2 is the number of channels

The SMC check line indicates if the global graph satisfies SMC (i.e. safe) or not.

Limitations

  • Our tool currently support synchronous (unbuffered channel) communication only
  • Goroutines spawned after any communication operations must not depend on those communication. Our model assumes goroutines are spawned independenly.

MiGo types approach

This approach generates MiGo types, a behavioural type introduced in this work, to check for safety and liveness by a restriction called fencing on channel usage (See paper).

The checker for MiGo types is available at nickng/gong, follow the instructions to build the tool:

$ git clone ssh://github.com/nickng/gong.git
$ cd gong; ghc Gong.hs

To run MiGo types generation on example/local-deadlock/main.go:

$ dingo-hunter migo example/local-deadlock/main.go --no-logging --output deadlock.migo
$ /path/to/Gong -A deadlock.migo

Limitations

  • Channels as return values are not supported right now
  • Channel recv,ok test not possible to represent in MiGo (requires inspecting value but abstracted by types)

Research publications

Notes

This is a research prototype, and may not work for all Go source code. Please file an issue for problems that look like a bug.

License

dingo-hunter is licensed under the Apache License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].