Open vadz opened 1 year ago
Weirdly enough, running the build in Ubuntu 18.04 container also results in memory leak reports, but different ones: now we get (variable-sized but pretty big) leaks inside SQLDriverConnect()
.
I'm leaving my attempts to fix this in vadz/ci-odbc-container branch, but it looks like it would be about as simple to fix the leaks under 22.04 than in 18.04 container.
Running ODBC test under Ubuntu 22.04 results in many memory leak reports, mostly inside
SQLDescribeCol()
. We need to check if we really forget to free something or if the reports are bogus -- and suppress them in this case.Full log
``` Test command: /home/runner/work/soci/soci/_build/bin/soci_odbc_test_postgresql "FILEDSN=/home/runner/work/soci/soci/tests/odbc/test-postgresql.dsn" "--invisibles" Working Directory: /home/runner/work/soci/soci/_build/tests/odbc Test timeout computed to be: 10000000 Using ODBC driver version 13.02.0000 =============================================================================== All tests passed (1892 assertions in 59 test cases) ================================================================= ==3508==ERROR: LeakSanitizer: detected memory leaks Direct leak of 320 byte(s) in 1 object(s) allocated from: #0 0x7f2486706867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x7f248309847a in QR_Constructor /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/qresult.c:174 #2 0x7f24830d1b77 in ParseAndDescribeWithLibpq.constprop.0 /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/statement.c:2943 #3 0x7f248308fdb2 in desc_params_and_sync /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/convert.c:2839 #4 0x7f248308fdb2 in prepareParameters /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/convert.c:2899 #5 0x7f248308fdb2 in prepareParameters /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/convert.c:2876 #6 0x7f248309c529 in SC_describe /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/statement.c:1160 #7 0x7f248309c529 in SC_describe_ok /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/results.c:95 #8 0x7f248309c8d5 in PGAPI_DescribeCol /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/results.c:318 #9 0x7f24830b344f in SQLDescribeCol /build/psqlodbc-vOSmp8/psqlodbc-13.02.0000/odbcapi.c:273 #10 0x7f24865f6f0a in SQLDescribeCol (/lib/x86_64-linux-gnu/libodbc.so.2+0x13f0a) #11 0x7f24865a1af8 in soci::odbc_statement_backend::column_size(int) /home/runner/work/soci/soci/src/backends/odbc/statement.cpp:395 #12 0x7f2486599115 in soci::odbc_standard_into_type_backend::define_by_pos(int&, void*, soci::details::exchange_type) /home/runner/work/soci/soci/src/backends/odbc/standard-into-type.cpp:46 #13 0x7f2486478ace in soci::details::standard_into_type::define(soci::details::statement_impl&, int&) /home/runner/work/soci/soci/src/core/into-type.cpp:27 #14 0x7f24865129d7 in soci::details::statement_impl::define_and_bind() /home/runner/work/soci/soci/src/core/statement.cpp:214 #15 0x7f2486511167 in soci::details::statement_impl::statement_impl(soci::details::prepare_temp_type const&) /home/runner/work/soci/soci/src/core/statement.cpp:57 #16 0x5616a4e694c4 in soci::statement::statement(soci::details::prepare_temp_type const&) /home/runner/work/soci/soci/include/soci/statement.h:177 #17 0x5616a4f25633 in soci::details::rowset_impl