Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lind026/ucsan
The User Concurrency Sanitizer (UCSAN)
https://github.com/lind026/ucsan
c concurrency concurrent-programming data-race-detection
Last synced: about 1 month ago
JSON representation
The User Concurrency Sanitizer (UCSAN)
- Host: GitHub
- URL: https://github.com/lind026/ucsan
- Owner: linD026
- License: mit
- Created: 2022-04-11T13:11:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-13T11:40:15.000Z (about 2 years ago)
- Last Synced: 2023-08-29T11:14:56.197Z (over 1 year ago)
- Topics: c, concurrency, concurrent-programming, data-race-detection
- Language: C
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ucsan
The User Concurrency Sanitizer (UCSAN) is the watchpoint-based data race detector.
It uses the [thread sanitizer](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual) interface in [Clang](https://releases.llvm.org/3.8.0/tools/clang/docs/ThreadSanitizer.html) (v3.2+) and [GCC](https://gcc.gnu.org/gcc-4.8/changes.html) (v4.8+) to determine whether the variable data race.Currently, it only will check the non-volatile type of variable access.
In other words, all the variables with thread-safety operations can declare as volatile types to avoid data race checking.## Get start
## Build
Build this project with following commands:
```bash
$ make # Generate static library: libucsan.a
$ make clean # Delete generated files
```### Makefile Parameter
* `nr_cpu` : number of cpu.
* `nr_wp` : number of watchpoint slot.
* `CC` : compiler, gcc or clang.## How to use?
Add the static library `libucsan.a` to your project:
```bash
$ gcc -c main.c -fsanitize=thread
$ gcc -o main main.o -L/path/to/libucsan/ -lucsan -rdynamic -pthread
```Or you can move the `libucsan.a` to your project directory. Then:
```bash
$ gcc -c main.c -fsanitize=thread
$ gcc -o main main.o libucsan.a -rdynamic -pthread
```