797 research outputs found
Static Trace-Based Deadlock Analysis for Synchronous Mini-Go
We consider the problem of static deadlock detection for programs in the Go
programming language which make use of synchronous channel communications. In
our analysis, regular expressions extended with a fork operator capture the
communication behavior of a program. Starting from a simple criterion that
characterizes traces of deadlock-free programs, we develop automata-based
methods to check for deadlock-freedom. The approach is implemented and
evaluated with a series of examples
Automated Verification of Go Programs via Bounded Model Checking
The artifact of the ASE 2021 paper entitled "Automated Verification of Go Programs via Bounded Model Checking"
Bounded verification of message-passing concurrency in Go using Promela and Spin
This paper describes a static verification framework for the message-passing fragment of the Go programming language. Our framework extracts models that over-approximate the message-passing behaviour of a program. These models, or behavioural types, are encoded in Promela, hence can be efficiently verified with Spin. We improve on previous works by verifying programs that include communication-related parameters that are unknown at compile-time, i.e., programs that spawn a parameterised number of threads or that create channels with a parameterised capacity. These programs are checked via a bounded verification approach with bounds provided by the user
Automatic detection and resolution of deadlocks in Go programs
The Go programming language is acquiring momentum in the development of concurrent
software. Even though Go supports the shared-memory model, the message-passing
alternative is the favoured idiomatic approach. Naturally, this practice is not exempt of
the usual difficulties: programs may deadlock and the language run-time has only very
basic support for deadlock detection. Previous research on deadlock detection mainly
focused on shared-memory concurrency models. For mainstream languages, tools and
approaches specific to the message-passing paradigm are scarce and incipient. There is
however a large body of work on models of concurrency that only recently started to be
applied to languages like Go. Since the Go run-time lets many deadlocks pass unnoticed,
and the existing solutions provided by third party tools detect many deadlocks but only
try to fix a limited set of specific patterns, imposing severe conditions to do so, there is a
clear need for more general deadlock resolution strategies, going beyond prevention and
avoidance. To gain insight on real-world deadlock bugs, we first built and categorized a
collection of bugs sourced from high-profile open-source Go projects. Next, we extended
and implemented an algorithm that takes an abstraction of the communication behaviour
of the program and, when all the communication operations on channels necessary for
progress are present, but a deadlock is possible, presents the problem and offers a possible
resolution for the error. The extensions allows our approach to analyse a much wider
range of real world programs. We conclude with an evaluation, comparing with two other
state-of-the-art solutions.A linguagem de programação Go tem ganhado tração no desenvolvimento de software
concorrente. Apesar de o Go suportar o modelo de partilha de memória, o modelo
alternativo de partilha de mensagens é a abordagem idiomática. Naturalmente, esta
prática não está isenta das dificuldades usuais: os programas podem bloquear e o runtime
da linguagem só possui um suporte muito básico para a deteção destes bloqueios.
Investigação anterior na deteção de bloqueios focou principalmente no modelo de partilha
de memória. Para linguagens convencionais, ferramentas e abordagens dedicadas ao
paradigma de passagem de mensagens são escassas e incipientes. No entanto, existe
um grande conjunto de trabalhos sobre modelos de concorrência que só recentemente
começou a ser aplicado em linguagens como o Go. Visto que o run-time do Go deixa
muitos bloqueios passar despercebidos e as soluções existentes detetam muitos bloqueios,
mas só tentam resolver um conjunto muito pequeno de padrões. De modo a ganhar
conhecimento sobre erros de bloqueio reais, nós começámos por construir e categorizar
uma coleção de erros obtidos a partir de projetos Go open-source de alto perfil. De
seguida, nós estendemos e implementámos um algoritmo que recebe uma abstração
do comportamento da comunicação de um programa e quando todas as operações de
comunicação nos canais necessários para o progresso estão presentes, mas um bloqueio
é possível, apresenta o erro e oferece uma possível resolução do erro. A nossa extensão
permite analisar um conjunto muito maior de programas reais. Concluímos com uma
avaliação, comparando com duas outras soluções do estado da arte
Fencing off go: liveness and safety for channel-based programming
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 bounded 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 and infinite 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 bounded verification procedures (akin to bounded model checking) 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
Static Race Detection and Mutex Safety and Liveness for Go Programs
Go is a popular concurrent programming language thanks to its ability to efficiently combine concurrency and systems programming. In Go programs, a number of concurrency bugs can be caused by a mixture of data races and communication problems. In this paper, we develop a theory based on behavioural types to statically detect data races and deadlocks in Go programs. We first specify lock safety/liveness and data race properties over a Go program model, using the happens-before relation defined in the Go memory model. We represent these properties of programs in a μ-calculus model of types, and validate them using type-level model-checking. We then extend the framework to account for Go’s channels, and implement a static verification tool which can detect concurrency errors. This is, to the best of our knowledge, the first static verification framework of this kind for the Go language, uniformly analysing concurrency errors caused by a mix of shared memory accesses and asynchronous message-passing communications
An Empirical Study of Messaging Passing Concurrency in Go Projects
Go is a popular programming language renowned for its good support for system programming and its channel-
based message passing concurrency mechanism. These strengths have made it the language of choice of many platform software such as Docker and Kubernetes. In this paper, we analyse 865 Go projects from GitHub in order to understand how message passing concurrency is used in publicly available code. Our results include the following findings: (1) message passing primitives are used frequently and intensively, (2) concurrency-related features are generally clustered in specific parts of a Go project, (3) most projects use synchronous communication channels over asynchronous ones, and (4) most Go projects use simple concurrent thread topologies, which are however currently
unsupported by existing static verification frameworks
- …