Tips and tricks when bugs won’t reproduce¶
If the program is multi-threaded, use the Thread Fuzzing feature. This permutes the scheduling of threads in the program while it is being recorded, to increase the frequency with which concurrency bugs are reproduced. Use the
--thread-fuzzing
option to live-record, or theUNDO_tf
environment variable.Run the program many times (tens, hundreds, or even thousands) until it fails and a recording is saved.
When using the live-record tool, use the
--retry-for
option to run the program for a specified duration or until a recording is saved, and the--save-on error
option to save a recording only if the program exits on a signal or exits with a non-zero status.When using the LiveRecorder API, call
undolr_save_on_termination_cancel()
if the program succeeds, to avoid unnecessarily saving a recording in this case.Run the stress-ng program in another terminal to keep other CPUs busy. On Ubuntu, stress-ng can be installed using:
$ apt install stress-ng
For details on using stress-ng, see the stress-ng manual.