Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Allow to configure --with-sanitizers=fuzzer #15047

Merged
merged 1 commit into from Jan 10, 2019

Conversation

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Dec 27, 2018

No description provided.

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Dec 28, 2018

Concept ACK

@laanwj
Copy link
Member

@laanwj laanwj commented Jan 2, 2019

Might be useful to document this somewhere.

@MarcoFalke MarcoFalke force-pushed the Mf1812-buildSanFuzz branch 4 times, most recently from cb9fc55 to fac2451 Jan 5, 2019
@MarcoFalke MarcoFalke force-pushed the Mf1812-buildSanFuzz branch from fac2451 to fad058a Jan 5, 2019
@MarcoFalke
Copy link
Member Author

@MarcoFalke MarcoFalke commented Jan 5, 2019

Added documentation

@fanquake
Copy link
Member

@fanquake fanquake commented Jan 7, 2019

Concept/utACK fad058a

Annoyingly, this doesn't work out of the box on macOS:

checking whether C++ compiler accepts -Werror... yes
checking whether C++ compiler accepts -fsanitize=fuzzer,address... yes
checking whether the linker accepts -fsanitize=fuzzer,address... no
configure: error: linker did not accept requested flags, you are missing required libraries

Seemingly because Xcode 10 doesn't include a copy of libclang_rt.fuzzer_osx.a. i.e:

clang++ -fsanitize=fuzzer -o fuzzme fuzzme.cpp
ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/lib/darwin/libclang_rt.fuzzer_osx.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Configuring Core with all other sanitizers, address, thread, undefined etc, works correctly.

Will test in a Linux env shortly.

@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Jan 9, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15043 (test: Build fuzz targets into seperate executables by MarcoFalke)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Jan 10, 2019

Gitian builds for commit 5da08e0 (master):

Gitian builds for commit 830fd7c66bef66cac0acd33d4300f04cea47a8c1 (master and this pull):

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Jan 10, 2019

utACK fad058a

@MarcoFalke MarcoFalke merged commit fad058a into bitcoin:master Jan 10, 2019
2 checks passed
MarcoFalke added a commit that referenced this issue Jan 10, 2019
fad058a build: Allow to configure --with-sanitizers=fuzzer (MarcoFalke)

Pull request description:

Tree-SHA512: 67b775577da03639ee11826dccb14c82e78d239fe3bcbb753082b254cec52ca8bda071a8161f2f3bc284a7cdc303bbf1b649a1854a42973b1d53cd0ffb516214
@MarcoFalke MarcoFalke deleted the Mf1812-buildSanFuzz branch Jan 10, 2019
random-zebra added a commit to PIVX-Project/PIVX that referenced this issue May 28, 2021
d059544 [Build] fuzz target, change LIBBITCOIN_ZEROCOIN link order. (furszy)
2396e6b [fuzz] Add ContextualCheckTransaction call to transaction target. (furszy)
f0887a0 Fuzzing documentation "PIVX-fication" (furszy)
9631f46 [doc] add sanitizers documentation in developer-notes.md (furszy)
70a0ace tests: Test serialisation as part of deserialisation fuzzing. Test round-trip equality where possible. Avoid code repetition. (practicalswift)
e1b92b6 ignore new fuzz targets gitignore (furszy)
d058d8c tests: Add deserialization fuzzing harnesses (furszy)
e1f666c tests: Remove TRANSACTION_DESERIALIZE (replaced by transaction fuzzer) (practicalswift)
b5f291c tests: Add fuzzing harness for CheckTransaction(...), IsStandardTx(...) and other CTransaction related functions (furszy)
3205871 fuzz: Remove option --export_coverage from test_runner (MarcoFalke)
52693ee fuzz: Add option to merge input dir to test runner (MarcoFalke)
2b4f8aa doc: Remove --disable-ccache from docs (MarcoFalke)
b54b1d6 tests: Improve test runner output in case of target errors (practicalswift)
cd6134f test: Log output even if fuzzer failed (MarcoFalke)
48cd0c8 doc: Improve fuzzing docs for macOS users (Fabian Jahr)
d642b67 [Build] Do not disable wallet when fuzz is enabled. (furszy)
c3447b5 Update doc and CI config (qmma)
1266d3e Disable other targets when enable-fuzz is set (qmma)
f28ac9a build: Allow to configure --with-sanitizers=fuzzer (MarcoFalke)
425742c fuzz: test_runner: Better error message when built with afl (MarcoFalke)
541f442 qa: Add test/fuzz/test_runner.py (MarcoFalke)
89fe5b2 Add missing LIBBITCOIN_ZMQ to test target (furszy)
58dbe79 add fuzzing binaries to gitignore. (furszy)
393a126 fuzz: Move deserialize tests to test/fuzz/deserialize.cpp (MarcoFalke)
a568df5 test: Build fuzz targets into separate executables (furszy)
d5dddde [test] fuzz: make test_one_input return void (MarcoFalke)
2e4ec58 [fuzzing] initialize chain params by default. (furszy)
08d8ebe [tests] Add libFuzzer support. (practicalswift)
84f72da [test] Speed up fuzzing by ~200x when using afl-fuzz (practicalswift)
faf2be6 Init ECC context for test_bitcoin_fuzzy. (Gregory Maxwell)
11150df Make fuzzer actually test CTxOutCompressor (Pieter Wuille)
d6f6a85 doc: Add bare-bones documentation for fuzzing (Wladimir J. van der Laan)
5c3b550 Simple fuzzing framework (pstratem)

Pull request description:

  As the title says, adding fuzzing framework support so we can start getting serious on this area as well.

  Adapted the following PRs:

  * bitcoin#9172.
  * bitcoin#9354.
  * bitcoin#9691.
  * bitcoin#10415.
  * bitcoin#10440.
  * bitcoin#15043.
  * bitcoin#15047.
  * bitcoin#15295.
  * bitcoin#15399 (fabcfa5 only).
  * bitcoin#16338.
  * bitcoin#17051.
  * bitcoin#17076.
  * bitcoin#17225.
  * bitcoin#17942.
  * bitcoin#16236 (only fa35c42).
  * bitcoin#18166 (only f2472f6).
  * bitcoin#18300.
  * And.. probably will go further and continue adapting more PRs..

ACKs for top commit:
  random-zebra:
    utACK d059544 and merging...

Tree-SHA512: c0b05bca47bf99bafd8abf1453c5636fe05df75f16d0e9c750368ea2aed8142f0b28d28af1d23468b8829188412a80fd3b7bdbbda294b940d78aec80c1c7d03a
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 26, 2021
fad058a build: Allow to configure --with-sanitizers=fuzzer (MarcoFalke)

Pull request description:

Tree-SHA512: 67b775577da03639ee11826dccb14c82e78d239fe3bcbb753082b254cec52ca8bda071a8161f2f3bc284a7cdc303bbf1b649a1854a42973b1d53cd0ffb516214
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 28, 2021
fad058a build: Allow to configure --with-sanitizers=fuzzer (MarcoFalke)

Pull request description:

Tree-SHA512: 67b775577da03639ee11826dccb14c82e78d239fe3bcbb753082b254cec52ca8bda071a8161f2f3bc284a7cdc303bbf1b649a1854a42973b1d53cd0ffb516214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants