The SmallRace is an end-to-end framework for Smalltalk race detection based on the LLVM compiler. We have upgrade our tool to support LLVM 12.0.1. It contains two key components, the SmallRace-Generator and SmallRace-Detector. SmallRace-Generator converts Smalltalk source code to LLVM IR, and SmallRace-Detector performs pointer analyses on the generated LLVM IR and reports the potential races. To try it out, clone this repository and build a docker image using the command:
docker pull jncsw/llvm12.0.1:latest
docker build -t smallrace .
docker run -i -t smallrace /bin/bash
SmallRace-Generator is a Smalltalk compiler frontend that converts Smalltalk source code to LLVM IR. The lexer and parser parts are automatically generated by ANTLR4 with our customized grammar for visual works. To manually build SmallRace-Generator, run the following commands:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_INSTALL=/llvm-project/build ..
make -j4
Then you can test it by running ./st-racedetect --dump-ir ../examples/1
under ./build/bin
folder and check dumped IR ./t.ll
.
SmallRace-Detector is built upon the existing implementation of OpenRace. We extend the features in OpenRace to model the source code semantics and detect data races for the Smalltalk language defined in Visual Works.
We use the same environment requirement for OpenRace, and the same way to compile it. We also add a testing example in the example
folder.
We have upgraded to support LLVM 12.0.1. You can build our project with the following commands:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_INSTALL=/llvm-project/build ..
make -j4
To test SmallRace-Detector, simply run ./openrace ../../examples/t1_new.ll
under ./build/bin
folder.
The LLVM IR output will be generated under the current workspace at ./build/bin, naming t.ll.
For more information, please refer to research paper: "SmallRace: Static Race Detection for Dynamic Languages - A Case on Smalltalk" accepted by ICSE'2023. The test example in this code repository is adopted as test 3 in the paper.
AGPL-3.0