Suppress reports about memory leaks in PostgreSQL ODBC test

Unfortunately we don't get any information about these leaks, the entire
report looks like this:

==6706==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:

    #0 0x7f6473f80602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7f646f89ba82  (/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so+0x1ba82)

Indirect leak of 25 byte(s) in 1 object(s) allocated from:

    #0 0x7f6473f80602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7f646f89ba9a  (/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so+0x1ba9a)

SUMMARY: AddressSanitizer: 49 byte(s) leaked in 2 allocation(s).

So we have no choice but to suppress all leaks from psqlodbca.so to let
the tests to pass on Travis CI.
This commit is contained in:
Vadim Zeitlin
2020-03-29 14:49:55 +02:00
parent f032c2a695
commit 457ec97eec
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
# This is a suppression file for LeakSanitizer when running ODBC tests.
# Unfortunately there is a leak from psqlodbca.so for which ASAN doesn't show
# any stack at all, so we have no choice but to suppress all leaks from this
# library, even though it could easily hide real problems.
leak:psqlodbca.so

View File

@@ -31,4 +31,4 @@ run_make
# Exclude the tests which can't be run due to the absence of ODBC drivers (MS
# SQL and MySQL).
run_test -E 'soci_odbc_test_m.sql'
LSAN_OPTIONS=suppressions=${TRAVIS_BUILD_DIR}/scripts/suppress_odbc.txt run_test -E 'soci_odbc_test_m.sql'