Home

Awesome

Chronos

<p align="center"> <img src="https://i.imgur.com/AhLyxVh.jpeg" width="150" height="225"> </p>

made-with-Go made-with-Go MIT license PRs Welcome amit-davidson

Chronos is a static race detector for the Go language written in Go.

Quick Start:

Download the package

go get -v github.com/amit-davidson/Chronos/cmd/chronos

Pass the entry point

chronos --file <path_to_main> --mod <path_to_module>

Help

Usage of ./chronos:
  --file string
    	The file containing the entry point of the program
  --mod string
    	Absolute or relative path to the module where the search should be performed. Should end in the format:{VCS}/{organization}/{package}. Packages outside this path are excluded rom the search.

Example:

<p float="left"> <img src="https://i.imgur.com/LJMP9c2.png" width="245" height="300"> <img src="https://i.imgur.com/X89VVfr.png" width="700" height="300"> </p>

Features:

Support:

Limitations:

Chronos vs go race:

Chronos successfully reports cases where go race fails thanks to it's static nature. Mostly because data races appear in unexpected production workloads, which are hard to produce in dev. In addition, go race is having trouble with short programs where without contrived synchronization the program may exit too quickly.

In contrast, Chronos managed to report only 244/403 = 60.5% of go race test cases. This can be explained by Chronos partial support with Go's features so this number will increase in the future. Also, it lacked due to his static nature where context/path sensitivity was required.

Therefore, I suggest using both according the strengths and weaknesses of each of the race detectors.

Credits:

Jan Wen, J., Jhala, R., & Lerner, S. (n.d.). RELAY: Static Race Detection on Millions of Lines of Code
Colin J. Fidge (February 1988). Timestamps in Message-Passing Systems That Preserve the Partial Ordering"

More examples:

<p float="left"> <img src="https://i.imgur.com/NvVWFRf.png" width="230" height="440"> <img src="https://i.imgur.com/eCNFAX7.png" width=600" height="300"> </p> <hr style="border:2px solid gray"> </hr>