Fuzzing the simulation

Feruscore has been changed in this chapter to include raw memory access in both Rust and through FFI. The responsible thing to do is fuzz Mars and make sure we're not causing segmentation faults. We'll use AFL, which we discussed back in Chapter 2Sequential Rust Performance and Testing, and again in Chapter 5, Locks – Mutex, Condvar, Barriers, and RWLock. The fuzz target is src/bin/fuzz_target.rs. The trick with fuzzing is ensuring stability. That is, AFL can't really do its work if for some input applied multiple times multiple paths come out. Fuzzing is more efficient in the case of a deterministic system. We were careful to make Mars::compete_inner deterministic, where Mars::compete uses randomness to determine ...

Get Hands-On Concurrency with Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.