You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long term, there needs to be a procedure for running Eclipser at regular intervals, for long runs to cover code that OSS-Fuzz libFuzzer and afl are bad at.
I looked at the new coverage added and it didn't include any new line coverage (just edge coverage). When pulling new inputs from other fuzz engines I also see many files added (even with new line coverage), so it is not yet clear whether the files added by Eclipser are actually ones that greybox engines can't find.
BTW, extremely happy to have you onboard the Bitcoin Core fuzzing train @agroce: I'm a huge huge fan of your fuzzing and testing research (context for those unaware).
Super excited to see fuzzing researchers taking interest in Bitcoin Core as a fuzzing target. That's something I've wished for and tried to facilitate/make happen for years :)
but it isn't really useful until some solution to the /tmp cleanup issues is available.
The issue should only affect fuzz targets that boot up a "full node" (process_message*, ...), but not the others. So I think the instructions could still be useful.
@practicalswift I'd looked at bitcoin fuzzing before, but saw that there was nice multi-fuzzer infrastructure in place. I actually got involved when @adamjonas contacted me in late March to see if I knew anyone who might help with saturation issues you all were facing in the fuzzing. I did -- me!
@MarcoFalke what's the process for these on the server? Just continuous libFuzzer, and occasionally checking for new stuff to merge? Any idea if more came from your libFuzzer runs or from OSS-Fuzz (or an equal mix)?
@MarcoFalke@practicalswift this is a tangent, but there's not a better place to discuss it (would either of you like to join an email thread for some "dumb questions" from me?)
Is rpc stateful in that one call can have impact on the next, in the fuzzing setup? It looks like the fuzz harness only does one command. If rpc is not somewhere this would be useful, are there targets where performing a sequence would be useful? If so, are they doing so now?
@MarcoFalke@practicalswift this is a tangent, but there's not a better place to discuss it (would either of you like to join an email thread for some "dumb questions" from me?)
Is rpc stateful in that one call can have impact on the next, in the fuzzing setup? It looks like the fuzz harness only does one command. If rpc is not somewhere this would be useful, are there targets where performing a sequence would be useful? If so, are they doing so now?
Yes, some RPCs are stateful. However in practice this doesn't lead to issues, because the only state IIRC is blockchain, mempool and wallet state. For blockchain it will be hard for the fuzzer to find new state (valid blocks) on it's own. Same goes for mempool. The wallet is currently not compiled into the fuzz binary, so shouldn't cause issues either.
If in the future any state turns out to make issues non-reproducible, we should look into fixing that. And conversely if we believe there are issues to be found only with state preserved between calls, we should look into extending the fuzz target to cover that.
I've written a bunch of targets to be keep state around for a longer time. For example there is process_messages (trailing s) that allows for multiple messages to be sent, because net processing is stateful.
Reacted by Jon Atack, Alex Groce and practicalswift (Thomas J)
Activity
maflcko commentedon Jul 29, 2021
I looked at the new coverage added and it didn't include any new line coverage (just edge coverage). When pulling new inputs from other fuzz engines I also see many files added (even with new line coverage), so it is not yet clear whether the files added by Eclipser are actually ones that greybox engines can't find.
agroce commentedon Jul 29, 2021
Aha. Ok, no actual new lines -- not as exciting. Does merge have a message for new lines being found? I assume new edges are worth adding?
practicalswift commentedon Jul 29, 2021
Absolutely! :)
BTW, extremely happy to have you onboard the Bitcoin Core fuzzing train @agroce: I'm a huge huge fan of your fuzzing and testing research (context for those unaware).
Super excited to see fuzzing researchers taking interest in Bitcoin Core as a fuzzing target. That's something I've wished for and tried to facilitate/make happen for years :)
maflcko commentedon Jul 29, 2021
Indeed they are worth adding.
I run the coverage builds myself. I haven't yet run them on PR70...
maflcko commentedon Jul 29, 2021
The issue should only affect fuzz targets that boot up a "full node" (process_message*, ...), but not the others. So I think the instructions could still be useful.
maflcko commentedon Jul 29, 2021
Just added the latest OSS-Fuzz inputs. (process_message: MERGE-OUTER: 113 new files with 214 new features added; 41 new coverage edges)
Also the inputs from my server (libFuzzer).
Result: https://drahtbot.space/host_reports/DrahtBot/reports/coverage_fuzz/monotree/be92dc5876969da2/fuzz.coverage/index.html
Seems to have added ~50 new coverage lines across all fuzz tests.
Some examples:
./f1294b2302dcf1c7957ae0e2a6413ce2296d0e05(targetrpc) added coverage for line 46: https://drahtbot.space/host_reports/DrahtBot/reports/coverage_fuzz/monotree/be92dc5876969da2/fuzz.coverage/src/util/message.cpp.gcov.html#46./e6a75000517c912c16dfad34add71309a9d0f303(targetscript_sign) added coverage for line 250: https://drahtbot.space/host_reports/DrahtBot/reports/coverage_fuzz/monotree/be92dc5876969da2/fuzz.coverage/src/script/interpreter.cpp.gcov.html#250agroce commentedon Jul 29, 2021
@practicalswift I'd looked at bitcoin fuzzing before, but saw that there was nice multi-fuzzer infrastructure in place. I actually got involved when @adamjonas contacted me in late March to see if I knew anyone who might help with saturation issues you all were facing in the fuzzing. I did -- me!
agroce commentedon Jul 29, 2021
@MarcoFalke what's the process for these on the server? Just continuous libFuzzer, and occasionally checking for new stuff to merge? Any idea if more came from your libFuzzer runs or from OSS-Fuzz (or an equal mix)?
agroce commentedon Jul 30, 2021
@MarcoFalke @practicalswift this is a tangent, but there's not a better place to discuss it (would either of you like to join an email thread for some "dumb questions" from me?)
Is rpc stateful in that one call can have impact on the next, in the fuzzing setup? It looks like the fuzz harness only does one command. If rpc is not somewhere this would be useful, are there targets where performing a sequence would be useful? If so, are they doing so now?
maflcko commentedon Jul 30, 2021
Jup, libFuzzer for each target (with/without sanitizers). I manually
rsyncthe inputs and add them to qa-assets if they are useful.It is hard to say. OSS-Fuzz inputs are 30 days old (the public archives) https://github.com/bitcoin-core/qa-assets/blob/2a7d883b08c8b132e61371c1bc9f336c71c56bc6/download_oss_fuzz_inputs.py#L9. The inputs on my server are fresh (up-to-date for the latest code). OSS-Fuzz added 8k files (bitcoin-core/qa-assets@9c6d701). My run afterward added 27k files (bitcoin-core/qa-assets@2a7d883)
I like all my Bitcoin Core communication to be public for transparency and documentation purposes. And often someone's dumb questions are someone else's dumb questions, too. If you prefer a place with less watchers you can also ask over at https://github.com/bitcoin-core/qa-assets/issues. Though, I am also happy to start an email thread.
Yes, some RPCs are stateful. However in practice this doesn't lead to issues, because the only state IIRC is blockchain, mempool and wallet state. For blockchain it will be hard for the fuzzer to find new state (valid blocks) on it's own. Same goes for mempool. The wallet is currently not compiled into the fuzz binary, so shouldn't cause issues either.
If in the future any state turns out to make issues non-reproducible, we should look into fixing that. And conversely if we believe there are issues to be found only with state preserved between calls, we should look into extending the fuzz target to cover that.
I've written a bunch of targets to be keep state around for a longer time. For example there is
process_messages(trailings) that allows for multiple messages to be sent, because net processing is stateful.agroce commentedon Jul 30, 2021
Thanks! That's very helpful, and here is fine by me!
I should take a look at
process_messages...maflcko commentedon Feb 8, 2024
Closing for now, but pull requests with documentation on the build with Eclipser are weclome