liangjs / locksmith

A data race detector for C+Pthreads programs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

locksmith

Locksmith is a static analysis tool that tries to find data races in multithreaded C programs. To do that, it implements a static version of the Lockset algorithm. A race occurs whenever two threads access a memory location without any synchronization, and one of the accesses is a write. Locksmith analyzes multithreaded programs that use locks (or mutexes) to protect accesses to shared locations, and tries to discover which, if any, locks protect each shared location. Whenever an access to a shared memory location is not protected by any lock, it potentially is a race.

See also [http://www.cs.umd.edu/projects/PL/locksmith/].

Build Instructions

The following should work on a fresh installation of Ubuntu 20.04. Clone this repository and run the following in the checked out directory:

sudo apt install gcc opam autoconf automake make gperf python indent emacs flex bison
git submodule update --init --recursive
opam init -n
opam switch create . 3.11.2
eval $(opam env)
./configure
make

If you get errors, try to rebuild banshee:

cd banshee
make
git checkout -- .
git clean -df
make

And now the entire project should build:

cd ..
make

Try it with ./locksmith --list-guardedby simple.c.

About

A data race detector for C+Pthreads programs

License:Other


Languages

Language:OCaml 96.2%Language:C 1.9%Language:P4 1.5%Language:Makefile 0.3%Language:Shell 0.1%