Hopefully better memory test on crash.

The old test, designed to do a transformation on the bits that was
invertible, in order to avoid touching the original memory content, was
not effective as it was redis-server --test-memory. The former often
reported OK while the latter was able to spot the error.

So the test was substituted with one that may perform better, however
the new one must backup the memory tested, so it tests memory in small
pieces. This limits the effectiveness because of the CPU caches. However
some attempt is made in order to trash the CPU cache between the fill
and the check stages, but not for the addressing test unfortunately.

We'll see if this test will be able to find errors where the old failed.
This commit is contained in:
antirez
2015-12-16 17:41:20 +01:00
parent ef92f90d34
commit fc00042ef9
3 changed files with 133 additions and 86 deletions

View File

@ -1650,7 +1650,7 @@ void enableWatchdog(int period);
void disableWatchdog(void);
void watchdogScheduleSignal(int period);
void serverLogHexDump(int level, char *descr, void *value, size_t len);
int memtest_test(unsigned long *m, size_t bytes, int passes, int interactive);
int memtest_preserving_test(unsigned long *m, size_t bytes, int passes);
#define redisDebug(fmt, ...) \
printf("DEBUG %s:%d > " fmt "\n", __FILE__, __LINE__, __VA_ARGS__)