Skip to content

Commit 9914e73

Browse files
committed
Merge bitcoin/bitcoin#31704: doc: add a section in the fuzzing documentation about using MSan
5c3e4d8 doc: add a section about using MSan (Antoine Poinsot) Pull request description: Just a couple lines in a subsection of the sanitizers section mentioning that using the memory sanitizer is a bit more involve than other sanitizers, describing the steps and pointing to an example. ACKs for top commit: fanquake: ACK 5c3e4d8 dergoegge: ACK 5c3e4d8 Tree-SHA512: 4ff73c2dd0f25cb96148e54bd867b8d340bd0fbc9b9a736a705125039352eb1d40bd724f9f262a44d3dbd1bea8f03166cf30e571d882fec02ceb1dd399ef7422
2 parents 188b021 + 5c3e4d8 commit 9914e73

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/fuzzing.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ INFO: seed corpus: files: 991 min: 1b max: 1858b total: 288291b rss: 150Mb
101101
102102
```
103103
104+
## Using the MemorySanitizer (MSan)
105+
106+
MSan [requires](https://clang.llvm.org/docs/MemorySanitizer.html#handling-external-code)
107+
that all linked code be instrumented. The exact steps to achieve this may vary
108+
but involve compiling `clang` from source, using the built `clang` to compile
109+
an instrumentalized libc++, then using it to build [Bitcoin Core dependencies
110+
from source](../depends/README.md) and finally the Bitcoin Core fuzz binary
111+
itself. One can use the MSan CI job as an example for how to perform these
112+
steps.
113+
114+
Valgrind is an alternative to MSan that does not require building a custom libc++.
115+
104116
## Run without sanitizers for increased throughput
105117
106118
Fuzzing on a harness compiled with `-DSANITIZERS=address,fuzzer,undefined` is

0 commit comments

Comments
 (0)