Earlier quoted context omitted.
The simplest way to do this, what I believe memtest86 and friends do, is to write a fixed pattern over a region of memory and then read it back later and see if it changed; then you write patterns that require flipping the bits that you wrote before, and so on. Things like [1] will also tell you that something corrupted your memory, and if you see a nontrivial (e.g. lots of bits high and low) magic number that has on…
[4] looks like it's only a runner for the actual testing, which is a separate crate: https://github.com/mozilla/memtest (see: https://github.com/mozilla-firefox/firefox/blob/main/toolkit... , which points to a specific commit in that repo - turns out to be tip of main)
I pointed to the runner because otherwise it seemed likely I'd get a comment insisting there's no proof it's used in Firefox.