I had once implemented what we called Hostile Memory Allocator.(HMA)
I checked in the code without doing extensive testing. It caused lot
of pain and it took me more than a month to stabilize the code.
This can be disabled during production builds.
In memory allocation code we can do something like this:
if (some randomly generated condition) && (request is atomic)