You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-15 01:04:37 +02:00
Make Valgrind return an error even when a non-fatal issue is detected.
By default Valgrind does not exit with an error code when a non-fatal error is detected, e.g. unfreed memory. Use the --error-exitcode option to enabled this behavior. Update some minor issues discovered in the tests as a result. Luckily, no issues were missed in the core code.
This commit is contained in:
@ -51,6 +51,10 @@
|
||||
|
||||
<release-test-list>
|
||||
<release-development-list>
|
||||
<release-item>
|
||||
<p>Make Valgrind return an error even when a non-fatal issue is detected. Update some minor issues discovered in the tests as a result.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Fix typo in unit test error messages, EXECTED => EXPECTED.</p>
|
||||
</release-item>
|
||||
|
@ -239,7 +239,7 @@ sub run
|
||||
"make -s 2>&1 && " .
|
||||
($self->{oTest}->{&TEST_VM} ne VM_CO6 ?
|
||||
" valgrind -q --gen-suppressions=all --suppressions=$self->{strBackRestBase}/test/src/valgrind.suppress" .
|
||||
" --leak-check=full --leak-resolution=high" : '') .
|
||||
" --leak-check=full --leak-resolution=high --error-exitcode=25" : '') .
|
||||
" ./test 2>&1'";
|
||||
}
|
||||
else
|
||||
|
@ -117,6 +117,7 @@ testRun(void)
|
||||
String *controlFile = strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL);
|
||||
PgControlFile control = {.systemId = 0xFACEFACE, .controlVersion = 1002, .catalogVersion = 201707211};
|
||||
Buffer *controlBuffer = bufNew(512);
|
||||
memset(bufPtr(controlBuffer), 0, bufSize(controlBuffer));
|
||||
memcpy(bufPtr(controlBuffer), &control, sizeof(PgControlFile));
|
||||
bufUsedSet(controlBuffer, bufSize(controlBuffer));
|
||||
storagePutNP(storageNewWriteNP(storageTest, controlFile), controlBuffer);
|
||||
|
@ -36,7 +36,7 @@ testLogLoad(const char *logFile, char *buffer, size_t bufferSize)
|
||||
{
|
||||
FUNCTION_HARNESS_BEGIN();
|
||||
FUNCTION_HARNESS_PARAM(STRINGZ, logFile);
|
||||
FUNCTION_HARNESS_PARAM(STRINGZ, buffer);
|
||||
FUNCTION_HARNESS_PARAM(CHARP, buffer);
|
||||
FUNCTION_HARNESS_PARAM(SIZE, bufferSize);
|
||||
|
||||
FUNCTION_HARNESS_ASSERT(logFile != NULL);
|
||||
|
@ -175,6 +175,7 @@ testRun(void)
|
||||
|
||||
decompress->inputSame = true;
|
||||
decompress->done = true;
|
||||
inflateEnd(decompress->stream);
|
||||
decompress->stream = NULL;
|
||||
TEST_RESULT_INT(gzipDecompressToLog(decompress, buffer, STACK_TRACE_PARAM_MAX), 41, "format object");
|
||||
TEST_RESULT_STR(buffer, "{inputSame: true, done: true, availIn: 0}", " check format");
|
||||
|
@ -66,6 +66,7 @@ testRun(void)
|
||||
String *controlFile = strNew(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL);
|
||||
PgControlFile control = {.systemId = 0xFACEFACE, .controlVersion = 833, .catalogVersion = 200711281};
|
||||
Buffer *controlBuffer = bufNew(512);
|
||||
memset(bufPtr(controlBuffer), 0, bufSize(controlBuffer));
|
||||
memcpy(bufPtr(controlBuffer), &control, sizeof(PgControlFile));
|
||||
bufUsedSet(controlBuffer, bufSize(controlBuffer));
|
||||
storagePutNP(storageNewWriteNP(storageTest, controlFile), controlBuffer);
|
||||
|
@ -16,3 +16,12 @@
|
||||
...
|
||||
obj:*/libperl.so*
|
||||
}
|
||||
|
||||
# This only seems to be an issue on Ubuntu 12.04 -- probably due to the old version of Valgrind
|
||||
{
|
||||
ignore_libz_uninit_cond_jump
|
||||
Memcheck:Cond
|
||||
fun:inflateReset2
|
||||
...
|
||||
obj:*/libz.so*
|
||||
}
|
||||
|
Reference in New Issue
Block a user