Fencing off Go: Liveness and Safety for Channel-based Programming (extended version)

10/27/2016
by   Julien Lange, et al.
0

Go is a production-level statically typed programming language whose design features explicit message-passing primitives and lightweight threads, enabling (and encouraging) programmers to develop concurrent systems where components interact through communication more so than by lock-based shared memory concurrency. Go can only detect global deadlocks at runtime, but provides no compile-time protection against all too common communication mismatches or partial deadlocks. This work develops a static verification framework for liveness and safety in Go programs, able to detect communication errors and partial deadlocks in a general class of realistic concurrent programs, including those with dynamic channel creation, unbounded thread creation and recursion. Our approach infers from a Go program a faithful representation of its communication patterns as a behavioural type. By checking a syntactic restriction on channel usage, dubbed fencing, we ensure that programs are made up of finitely many different communication patterns that may be repeated infinitely many times. This restriction allows us to implement procedures to check for liveness and safety in types which in turn approximates liveness and safety in Go programs. We have implemented a type inference and liveness and safety checks in a tool-chain and tested it against publicly available Go programs. Note: This is a revised extended version of a paper that appeared in POPL 2017, see page 13 for details.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/27/2020

Static Race Detection and Mutex Safety and Liveness for Go Programs (extended version)

Go is a popular concurrent programming language thanks to its ability to...
research
05/28/2021

Gobra: Modular Specification and Verification of Go Programs (extended version)

Go is an increasingly-popular systems programming language targeting, es...
research
11/23/2021

kmclib: Automated Inference and Verification of Session Types

Theories and tools based on multiparty session types offer correctness g...
research
09/09/2023

From Reversible Computation to Checkpoint-Based Rollback Recovery for Message-Passing Concurrent Programs

The reliability of concurrent and distributed systems often depends on s...
research
05/13/2021

Circular Proofs as Processes: Type-Based Termination via Arithmetic Refinements

Type systems for concurrent programs guarantee such desirable properties...
research
10/12/2020

Multiparty Motion Coordination: From Choreographies to Robotics Programs

We present a programming model and typing discipline for complex multi-r...
research
01/26/2023

Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent Programs

Concurrent programs suffer from data races. To prevent data races, progr...

Please sign up or login with your details

Forgot password? Click here to reset