Add a monitor_fuzz.py script - #9069
Conversation
This script runs and monitors fuzz_opt.py for up to a given number of iterations, redirecting its output to a rotating log file and printing its progress to stdout once a minute. When it detects that the fuzzer has found a bug, it prints the iteration number and the seed so the bug can be reproduced. This script is nicer to run in agent harnesses than raw fuzz_opt.py because agents can easily run the fuzzer for X iterations and can show the progress without overly polluting the context.
| except Exception: | ||
| try: | ||
| _, hard = resource.getrlimit(resource.RLIMIT_STACK) | ||
| resource.setrlimit(resource.RLIMIT_STACK, (hard, hard)) |
There was a problem hiding this comment.
Maybe. If we want to use this everywhere and worry less about recursion limits, it's probably a good idea. But OTOH maybe it makes sense to want to get our recursion limits right.
I'd lean toward removing this entirely. I can continue to use ulimit -s unlimited when fuzzing with my LTO build that is known to blow the stack. WDYT?
There was a problem hiding this comment.
I don't feel strongly. I'm ok with removing it entirely or moving it to the other script.
lgtm with one of those
(but keeping it here strikes me as odd, as this is just "higher-level" than the other script, and this is a low-level workaround)
| .cache/* | ||
|
|
||
| # Generated by scripts/monitor_fuzz.py | ||
| /fuzz.log |
There was a problem hiding this comment.
Perhaps put this in out/test/ like the fuzzer's own temp files?
This script runs and monitors fuzz_opt.py for up to a given number of iterations, redirecting its output to a rotating log file and printing its progress to stdout once a minute. When it detects that the fuzzer has found a bug, it prints the iteration number and the seed so the bug can be reproduced.
This script is nicer to run in agent harnesses than raw fuzz_opt.py because agents can easily run the fuzzer for X iterations and can show the progress without overly polluting the context.