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

Ubuntu libFuzzer/AFL #49

Closed
maflcko opened this issue May 25, 2021 · 0 comments
Closed

Ubuntu libFuzzer/AFL #49

maflcko opened this issue May 25, 2021 · 0 comments
Labels

Comments

@maflcko
Copy link
Owner

maflcko commented May 25, 2021

native/libc++

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git bitcoin-core && cd bitcoin-core && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq     libevent-dev libboost-dev  libsqlite3-dev  libdb++-dev clang llvm libc++-dev libc++abi-dev  -y   &&  ./autogen.sh && ./configure CC=clang CXX='clang++ -stdlib=libc++'   --enable-fuzz --with-sanitizers=fuzzer && make -j$(nproc)

mkdir temp_pms

FUZZ=process_messages ./src/test/fuzz/fuzz -workers=9 -jobs=9 ./temp_pms

32-bit (depends)

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git bitcoin-core && cd bitcoin-core && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq make automake cmake curl clang llvm g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison -y  && ( cd depends && make DEBUG=1 HOST=i686-pc-linux-gnu NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) && ./autogen.sh && CONFIG_SITE="$PWD/depends/i686-pc-linux-gnu/share/config.site" ./configure CC='clang -m32' CXX='clang++ -m32' --enable-fuzz --with-sanitizers=fuzzer && make  -j $(nproc)

32-bit libc++ (depends) (focal only?)

export V=12 && dpkg --add-architecture i386 && export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git ./bitcoin-core && cd bitcoin-core && apt install libc++abi-$V-dev:i386 libc++-$V-dev:i386 clang-$V:i386 llvm-$V:i386        make automake cmake curl libtool  bsdmainutils pkg-config patch bison        -y  && ( cd depends && make CC="clang-$V -m32 -O1 -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link" CXX="clang++-$V -m32 -g -O1 -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++" DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) && ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure CC="clang-$V -m32 -O1 -fno-omit-frame-pointer -gline-tables-only" CXX="clang++-$V -m32 -g -O1 -fno-omit-frame-pointer -gline-tables-only -stdlib=libc++" --with-sanitizers=fuzzer,address --enable-fuzz --with-seccomp=no --enable-fuzz  && make -j $(nproc)

afl

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git ./bitcoin-core && cd bitcoin-core && git checkout master && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq     libevent-dev libboost-dev  clang llvm   -y   &&  ./autogen.sh && apt-get install -y build-essential python3-dev automake git flex bison libglib2.0-dev libpixman-1-dev python3-setuptools  lld llvm llvm-dev clang && apt-get install -y gcc-$(gcc --version|head -n1|sed 's/.* //'|sed 's/\..*//')-plugin-dev libstdc++-$(gcc --version|head -n1|sed 's/.* //'|sed 's/\..*//')-dev && git clone https://github.com/google/AFL.git && make -C AFL && CC=$PWD/AFL/afl-clang CXX=$PWD/AFL/afl-clang++ ./configure --enable-fuzz && ( cat /tmp/a|git apply ) && make -j 9 && git clone https://github.com/bitcoin-core/qa-assets --depth=1 && mkdir outdir && FUZZ=process_message AFL/afl-fuzz -i qa-assets/fuzz_seed_corpus/process_message -o ./outdir -m 500 -t 30000 -- src/test/fuzz/fuzz
AFL_NO_UI=1 AFL_DEBUG=1 FUZZ=process_message AFLplusplus/afl-fuzz -i - -o ./outdir2 -t 10000 -- src/test/fuzz/fuzz
@maflcko maflcko added the blog label May 25, 2021
@maflcko maflcko changed the title Focal native libFuzzer Focal libFuzzer Jul 22, 2021
@maflcko maflcko changed the title Focal libFuzzer Focal libFuzzer/AFL Jul 30, 2021
maflcko pushed a commit that referenced this issue Sep 29, 2021
0d624261ef Merge bitcoin-core/crc32c-subtree#2: Merge upstream
cac7ca830b Merge commit 'fa5ade41ee480003d9c5af6f43567ba22e4e17e6' into bitcoin-fork
fa5ade41ee Fix compilation warnings on ARM64 with old GCC versions. (#52)
db08d22129 Updated Travis-CI configuration. (#51)
e31619a5b7 Fix GitHub links. (#50)
7fa4c263e8 Update Travis CI config. (#49)
a3d9e6d1a4 Updated third_party/ and Travis CI config. (#48)

git-subtree-dir: src/crc32c
git-subtree-split: 0d624261ef83ab08c953c196540ed18f355add4c
@maflcko maflcko changed the title Focal libFuzzer/AFL Ubuntu libFuzzer/AFL Feb 9, 2022
@maflcko maflcko closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant