Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | |||||
**DEBUG_LOCKORDER** | **DEBUG_LOCKORDER** | ||||
Bitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs | Bitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs | ||||
can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure | can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure | ||||
CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of which locks | CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of which locks | ||||
are held, and adds warnings to the debug.log file if inconsistencies are detected. | are held, and adds warnings to the debug.log file if inconsistencies are detected. | ||||
**Valgrind suppressions file** | |||||
Valgrind is a programming tool for memory debugging, memory leak detection, and | |||||
profiling. The repo contains a Valgrind suppressions file | |||||
([`valgrind.supp`](contrib/valgrind.supp)) | |||||
which includes known Valgrind warnings in our dependencies that cannot be fixed | |||||
in-tree. Example use: | |||||
```shell | |||||
$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin | |||||
$ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ | |||||
--show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite | |||||
$ valgrind -v --leak-check=full src/bitcoind -printtoconsole | |||||
``` | |||||
**compiling for test coverage** | **compiling for test coverage** | ||||
LCOV can be used to generate a test coverage report based upon `make check` | LCOV can be used to generate a test coverage report based upon `make check` | ||||
execution. LCOV must be installed on your system (e.g. the `lcov` package | execution. LCOV must be installed on your system (e.g. the `lcov` package | ||||
on Debian/Ubuntu). | on Debian/Ubuntu). | ||||
To enable LCOV report generation during test runs: | To enable LCOV report generation during test runs: | ||||
```shell | ```shell | ||||
./configure --enable-lcov | ./configure --enable-lcov | ||||
make | make | ||||
make cov | make cov | ||||
# A coverage report will now be accessible at `./test_bitcoin.coverage/index.html`. | # A coverage report will now be accessible at `./test_bitcoin.coverage/index.html`. | ||||
``` | ``` | ||||
**Valgrind suppressions file** | |||||
Valgrind is a programming tool for memory debugging, memory leak detection, and | |||||
profiling. The repo contains a Valgrind suppressions file | |||||
([`valgrind.supp`](contrib/valgrind.supp)) | |||||
which includes known Valgrind warnings in our dependencies that cannot be fixed | |||||
in-tree. Example use: | |||||
```shell | |||||
$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin | |||||
$ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ | |||||
--show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite | |||||
$ valgrind -v --leak-check=full src/bitcoind -printtoconsole | |||||
``` | |||||
**Sanitizers** | **Sanitizers** | ||||
Bitcoin ABC can be compiled with various "sanitizers" enabled, which add | Bitcoin ABC can be compiled with various "sanitizers" enabled, which add | ||||
instrumentation for issues regarding things like memory safety, thread race | instrumentation for issues regarding things like memory safety, thread race | ||||
conditions, or undefined behavior. This is controlled with the | conditions, or undefined behavior. This is controlled with the | ||||
`--with-sanitizers` configure flag, which should be a comma separated list of | `--with-sanitizers` configure flag, which should be a comma separated list of | ||||
sanitizers to enable. The sanitizer list should correspond to supported | sanitizers to enable. The sanitizer list should correspond to supported | ||||
`-fsanitize=` options in your compiler. These sanitizers have runtime overhead, | `-fsanitize=` options in your compiler. These sanitizers have runtime overhead, | ||||
▲ Show 20 Lines • Show All 542 Lines • Show Last 20 Lines |