📣 Help Shape the Future of UKRI's Gateway to Research (GtR)

We're improving UKRI's Gateway to Research and are seeking your input! If you would be interested in being interviewed about the improvements we're making and to have your say about how we can make GtR more user-friendly, impactful, and effective for the Research and Innovation community, please email gateway@ukri.org.

CONSEQUENCER: Sequentialization-based Verification of Concurrent Programs with FIFO channels

Lead Research Organisation: University of Southampton
Department Name: Electronics and Computer Science

Abstract

The steady exponential increase in processor performance
has reached the inevitable turning point, at which it is no longer feasible to
increase the clock speeds of individual processors. To achieve
higher performance, processors now contain several cores that work in parallel.
Consequently, concurrency has become an important aspect across many
areas within computer science, such as algorithms, data structures, programming
languages, software engineering, testing, and verification.
Concurrent programs consist of several computations or threads that are
active at the same time and communicate through some control mechanism, such as
locks and shared variables, or message passing. Concurrent programming is difficult:
programmers do not only have to guarantee the correctness
of the sequential execution of each individual thread, they must also consider
nondeterministic interferences from other threads. Due to these complex
interactions, considerable resources are spent to repair buggy concurrent
software.

Testing remains
the most used (and often the only known) paradigm in industry to find errors,
even though the inherently nondeterministic nature of the concurrent
schedules causes errors that manifest rarely and are difficult to reproduce and repair.
Testing is not effective in detecting such concurrency errors, as all
possible executions of the programs have to be explored explicitly.
Consequently, testing needs to be complemented by automated verification tools that
enable detection of errors without explicitly (i.e. symbolically) exploring executions.

On the other hand, the state of the art for concurrent program verification lags behind that for sequential programs.
Here, researchers have successfully explored a wide range of techniques and
tools to analyse real-world sequential software.
A recently proposed approach for symbolic verification of concurrent programs
called sequentialization, consists in translating the concurrent program
into an equivalent sequential program so that
verification techniques or tools that were originally designed for
sequential programs can be reused without any changes.

This technique has been successfully used to discover bugs in existing software
and has been implemented in several tools (e.g., Corral by Microsoft Research).
However, existing sequentialization schemas do not support weak memory models,
or distributed programs that use message passing.

In this proposal we address these weaknesses and plan the development of automated verification tools that enable detection of errors in concurrent programs in a systematic and symbolic way. More specifically, we will develop the theory, models and algorithms that underpin sequentialization of concurrent programs that use FIFO channels. This will enable us to capture within a single framework (1) concurrent programs that communicate through shared memory, for the variety of (weak) memory models that are implemented in today's computer architectures, and (2) distributed programs which use a message-passing communication style (i.e., the two most commonly used programming models for concurrency).

A key deliverable of this project will be a set of automatic code-to-code translators, called ConSequencer, for C programs that use Pthread (for shared variables) and MPI (for distributed programs). This will serve as a concurrency plugin for any program verification tool designed for sequential programs. We will evaluate our solutions on publicly available benchmarks using a range of robust sequential verification tools for the C language.

Planned Impact

Part of the proposed research is foundational in nature and
thus the primary pathway to impact for the obtained knowledge
will be through academic publications.
We have identified key international conferences and journals that we will target for
dissemination. They cover the academic communities where our results will be of
most interest.

In addition to the traditional academic publications,
we will also build a project website that will contain
all relevant information about this project (tools, papers, benchmarks,
evaluation, etc.). A strong focus here will be on providing enough details so
that (1) all experiments can be independently repeated, and (2) all
translations can be independently re-implemented. In particular, we plan to
make all translations available as open-source software.

A key deliverable of this project will be an automatic code-to-code translator
called CONSEQUENCER that sequentializes C programs that use
Pthreads (for multi-threaded programs with shared variables) and
MPI (for distributed programs).
We will make CONSEQUENCER available in different
versions, to target different audiences: as a complete black-box verification
tool (i.e., coupled with a sequential verification backend), aimed at
software developers; as an stand-alone concurrency pre-processor, aimed at
practical verification experts; and in source form, aimed at verification researchers and
tool developers. Third, we will participate in competitions for software
verification tools. Such competitions have recently emerged as
both an important driver to shape practical research in program verification
and a good channel for disseminating research results in a condensed form. Our
experience from the last two SV-COMP competitions indicates that a
good competition result translates into immediate impact on the field. Fourth,
and finally, we will contribute further benchmarks for such competitions, in
the form of programs produced by our sequentialization translations. Here, the
impact is longer term and less direct, as it provides incentives to the
developers of sequential verification tools to take the characteristics of
these programs into account.

The technology proposed in this project can be applied to verify
hardware-software designs or applications on advanced computer architectures.
We plan to build on the successful existing
collaborations of ESS with ARM and Imagination. Obviously, the partly
foundational nature of the research, and the small scale of the project, will
make an immediate impact on industrial practice (e.g., in form of industrial
tool applications) difficult. However, the results of this project will serve
to get industrial interest and hence their support. Feedback from these initial
industrial collaborations will also help the PI developing a follow-on project,
which will be a larger and longer-term proposal with direct industrial
involvement.

Another application of this research is in security, as many attacks exploit
errors in the software implementing the security protocols. The PI is a member
of the GCHQ-supported Centre of Excellence in CyberSecurity Research in
Southampton, and will work through this with the Research Institute in
Automated Program Analysis and Verification and with national security
agencies.

The final pathway to impact is through education of the young researcher and
students. The researcher will benefit by working with the PI and the two
PhD students. He or she will gain detailed knowledge about verification of
concurrent systems and model checking technology, which are areas with a high
demand for (but with low supply of) experts in the UK. The
researcher will also gain experience in supervising research students, which
will be beneficial for a potential further academic career. The PhD students
will benefit by working with the researcher, which will help them in the timely
completion of their PhD programme.

Publications

10 25 50
 
Description We have developed four new techniques based on sequentialization both for finding bugs and proving correctness of concurrent programs that communicate through shared memory (by means of FIFO channels/weak memory models). Sequentialization consists in rewriting concurrent programs so that verification techniques or tools that were originally designed for sequential programs can be reused without any changes. We have implemented a framework, called CSeq, for the development of sequentializations. Within this framework, we have implemented four tools for C concurrent programs. We entered the software verification competition in 2015, 2016 and 2017 and these tools have won gold, silver and bronze medals in the concurrency category of these three editions. Our tools are able to find bugs in complex benchmarks that were out of reach for existing automatic techniques. We have also developed a new approach that combines testing and symbolic methods; its effectiveness is amplified when used on a cluster of computers.
Exploitation Route For dissemination and exploitation of results, we are addressing research community through our research publications but also with the help of our tools, and test cases. Competitions (e.g., the SAT-, SMT-, and Software Verification competitions) have become established vehicles to drive research in verification. We have participated in the last three editions of SV-COMP (international software verification competition). Our tools have been used by others to find concurrency bugs in lock-free data structures which are notoriously hard to analyse. Also, it has been used/adapted for the analysis of programs deployed on modern cars.
Sectors Aerospace

Defence and Marine

Digital/Communication/Information Technologies (including Software)

Education

Electronics

Security and Diplomacy

Transport

URL http://users.ecs.soton.ac.uk/gp4/cseq/cseq.html
 
Description Approaches and tools designed and developed in the course of this project have been used and adapted to handle other forms of concurrency.
First Year Of Impact 2016
Sector Aerospace, Defence and Marine,Digital/Communication/Information Technologies (including Software),Education,Electronics,Financial Services, and Management Consultancy,Security and Diplomacy
Impact Types Societal

 
Title LAzy-CSeq-Swarm 
Description Swarm-based verification methods split the original verification task into a large number of simpler independent subtasks and so exploit the availability of large numbers of computational cores to speed up verification. Here, we use a swarm-based method with Lazy-CSeq as verification engine for the individual subtasks. The key idea of our approach is to constrain the interleavings such that context switches can only happen within prescribed windows (i.e., contiguous code segments within the individual threads). This under-approximates the program's behaviors, with the number and size of windows as additional parameters, which allows to vary the complexity of the verification subtasks. We further re- duce the number of subtasks required to achieve a given coverage target with a randomized placement of the windows. This significantly improves Lazy-CSeq's peak memory consumption and (wall-clock) verification time. 
Type Of Technology Software 
Year Produced 2016 
Open Source License? Yes  
Impact Lazy-CSeq-Swarm won the bronze medal in the concurrency category of the international software verification competition SV-COMP'17. 
URL http://users.ecs.soton.ac.uk/gp4/cseq/cseq.html
 
Title LAzy-Cseq-abs 
Description Lazy-CSeq-ABS is a context-bounded verification tool for sequentially consistent C programs using POSIX threads. It first translates a multi-threaded C program into a bounded nondeterministic sequential C program that preserves bounded reachability for all round-robin schedules up to a given number of rounds. It then reuses existing high-performance bounded model checkers as sequential verification backends. Lazy-CSeq handles the full C language and the main parts of the POSIX thread API, such as dynamic thread creation and deletion, and synchronization via thread join, locks, and condition variables. It supports assertion checking and deadlock detection, and returns counterexamples in case of errors. However, the sizes of the individual states still pose problems for further scaling. We therefore use abstract interpretation to minimize the representation of the concurrent program's (shared global and thread-local) state variables. More specifically, we run the Frama-C abstract interpretation tool over the programs constructed by Lazy-CSeq to compute overapproximating intervals for all (original) state variables and then exploit CBMC's bitvector support to reduce the number of bits required to represent these in the sequentialized program. We have implemented this approach in the last release of Lazy-CSeq and demonstrate the effectiveness of this approach; in particular, we show that it leads to large performance gains for very hard verification problems. 
Type Of Technology Software 
Year Produced 2016 
Open Source License? Yes  
Impact Lazy-CSeq outperforms other concurrency verification tools and has won the a silver medal in the concurrency category of the international software verification competition SV-COMP'17. 
URL http://users.ecs.soton.ac.uk/gp4/cseq/cseq.html
 
Title Lazy-CSeq 
Description Lazy-CSeq is a context-bounded verification tool for sequentially consistent C programs using POSIX threads. It first translates a multi-threaded C program into a bounded nondeterministic sequential C program that preserves bounded reachability for all round-robin schedules up to a given number of rounds. It then reuses existing high-performance bounded model checkers as sequential verification backends. Lazy-CSeq handles the full C language and the main parts of the POSIX thread API, such as dynamic thread creation and deletion, and synchronization via thread join, locks, and condition variables. It supports assertion checking and deadlock detection, and returns counterexamples in case of errors. 
Type Of Technology Software 
Year Produced 2015 
Open Source License? Yes  
Impact Lazy-CSeq outperforms other concurrency verification tools and has won the 2 gold and 1 silver medals in the concurrency category of the last 3 editions of the international software verification competition SV-COMP. 
URL http://users.ecs.soton.ac.uk/gp4/cseq/cseq.html
 
Title MU-CSeq 
Description MU-CSeq is a context-bounded verification tool for sequentially consistent C programs using POSIX threads. It first translates a multi-threaded C program into a bounded nondeterministic sequential C program that preserves bounded reachability. It then reuses existing high-performance bounded model checkers as sequential verification backends. MU-CSeq handles the full C language and the main parts of the POSIX thread API, such as dynamic thread creation and deletion, and synchronization via thread join, locks, and condition variables. It supports assertion checking. 
Type Of Technology Software 
Year Produced 2015 
Open Source License? Yes  
Impact MU-CSeq outperforms other concurrency verification tools and has won the 1 gold and 2 silver medals in the concurrency category of the last 3 editions of the international software verification competition SV-COMP. 
URL http://users.ecs.soton.ac.uk/gp4/cseq/cseq.html
 
Title UL-CSeq 
Description Sequentializations are mostly designed for bug finding in concurrent programs. In contrast, UL-CSeq's lazy sequentialization can be used to construct correctness proofs for programs with unbounded loops and an unbounded num- ber of context switches. UL-CSeq 1.0 implements an improved code-to-code transformation that works well for both bounded model checking and proof- constructing sequential verification backends. This version also supports more backends, including CBMC, which gives it a bug finding performance similar to that of Lazy-CSeq, and SeaHorn and VVT, which yield substantial performance gains over the previous release for proof construction. UL-CSeq can thus be used as an effective tool for both bug finding and proof construction by running in parallel multiple backends over the same sequentialized program. 
Type Of Technology Software 
Year Produced 2016 
Open Source License? Yes  
Impact UL-CSeq 1.0 participated in the concurrency category of international software verification competition SV-COMP'17. 
URL http://users.ecs.soton.ac.uk/gp4/cseq/cseq.html
 
Description ATVA 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Scientific conference presentation. The main purpose of this activity concerns dissemination and exploitation of results.
Year(s) Of Engagement Activity 2016
URL http://atva2016.gforge.inria.fr/
 
Description FMCAD 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Scientific conference presentation. The main purpose of this activity concerns dissemination and exploitation of results.
Year(s) Of Engagement Activity 2016
 
Description IMT 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Schools
Results and Impact Teaching: 20-hour module on Verification of Concurrent Programs, PhD program, IMT School for Advanced Studies, Lucca, Italy, April 2016
Year(s) Of Engagement Activity 2016
 
Description IMT PhD School lecture series 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Regional
Primary Audience Schools
Results and Impact Lecture series at IMT PhD School on Program Verification, School for Advanced Studies Lucca, Italy, July-August 2018
Year(s) Of Engagement Activity 2018
 
Description Plenary Talk at ICTAC 2018 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Plenary Talk at ICTAC 2018. The talk included lazy-CSeq sequentialization and the parallelization approach based on VERISMART.
Year(s) Of Engagement Activity 2018
URL https://www.ictac.org.za/invited.html
 
Description Stellenbosch 
Form Of Engagement Activity Participation in an open day or visit at my research institution
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Schools
Results and Impact Presentation at the University Paris Diderot presenting work funded by this project.
Year(s) Of Engagement Activity 2016
 
Description TACAS 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Presentation at the TACAS conference. The main purpose of this activity concerns dissemination and exploitation of results.
Year(s) Of Engagement Activity 2015,2016
URL http://www.etaps.org/2015/tacas
 
Description UPMARC Summer School 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Lecture series at UPMARC Summer School on Multicore Computing, Uppsala University, Sweden, June 2015
Year(s) Of Engagement Activity 2015
URL http://www.it.uu.se/research/upmarc/events/SS2015/ss2015/Start.html