mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Add memcheck/asan/ubsan to readme
This commit is contained in:
parent
b014d6199c
commit
61aa47da90
19
README.md
19
README.md
|
@ -111,6 +111,25 @@ sudo cp *.a /usr/lib
|
|||
To run the tests you must target `run_tests` with make:
|
||||
`make run_tests`
|
||||
|
||||
Using AddressSanitizer + UndefinedBehaviourSanitizer or Valgrind's Memcheck
|
||||
---------------------------------------------------------------------------
|
||||
ASan+UBSan and Memcheck are useful to find code problems more easily. Please use them to test your changes if you can.
|
||||
|
||||
For ASan+UBSan compile with:
|
||||
```bash
|
||||
CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" cmake -DCMAKE_BUILD_TYPE=Debug .
|
||||
make
|
||||
```
|
||||
and run with:
|
||||
```bash
|
||||
UBSAN_OPTIONS=log_path=./SAN:print_stacktrace=1:halt_on_errors=0 ASAN_OPTIONS=log_path=./SAN:print_stacktrace=1:check_initialization_order=1:detect_leaks=1:halt_on_errors=0 ./DDNet
|
||||
```
|
||||
|
||||
Check the SAN.\* files afterwards. This finds more problems than memcheck, runs faster, but requires a modern GCC/Clang compiler.
|
||||
|
||||
For valgrind's memcheck compile a normal Debug build and run with: `valgrind --tool=memcheck ./DDNet`
|
||||
Expect a large slow down.
|
||||
|
||||
Building on Windows with Visual Studio
|
||||
--------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue