Heartbleed example does not work out of the box.
See original GitHub issueI was going over the documentation on this page: https://google.github.io/clusterfuzz/setting-up-fuzzing/heartbleed-example/
To do that I first followed the pre-requisites section here: https://google.github.io/clusterfuzz/setting-up-fuzzing/libfuzzer-and-afl/#compiler
That recommends installing clang 6.0 or greater. I installed it via apt
and got clang version 6.0.0-1ubuntu2
as output by clang -v
The example handshake-fuzzer.cc
does not compile out of the box with that version of clang as I believe it only supports the filesystem
extension as experimental feature.
When I try to run the build step from the documentation:
/usr/bin/clang++ -g handshake-fuzzer.cc -fsanitize=address,fuzzer openssl-1.0.1f/libssl.a openssl-1.0.1f/libcrypto.a -std=c++17 -Iopenssl-1.0.1f/include/ -lstdc++fs -ldl -lstdc++ -o handshake-fuzzer
I get this error:
handshake-fuzzer.cc:25:10: fatal error: 'filesystem' file not found
#include <filesystem>
^~~~~~~~~~~~
1 error generated.
This can be fixed by changing the include to experimental/filesystem
and then changing the using
statement below to also include experimental
at the right spot - but I imagine that will break the build on later versions of clang (I haven’t tested).
A proper fix likely involves using an API that’s available in clang 6 (though it may be more verbose).
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
Maybe we can just use some ifdef here? @jonathanmetzman
Thanks! Just to be clear this wont work with clang5, I was just pointing out that the filesystem part of the example with clang5 (but I need to use
-std=c++1z
), so I assumed it work in clang6.