Open Shnatsel opened 6 years ago
I'd prefer to fix this by building two different dynamic libraries, libdiffuzz and libdiffuzz-random, with the appropriate mode hardcoded in each.
There is also dynamic setup of the amount of memory to over-allocate, but that's a fairly obscure feature which can be moved into a compile-time parameter.
Currently libdiffuzz switches to non-deterministic mode after reading an environment variable from a function called from link-time "constructors" section:
https://github.com/Shnatsel/libdiffuzz/blob/f0c7a8f3b27df24d389d9e003ebda01ad89eb1cf/src/lib.rs#L31-L33
This is not a great idea for two reasons: