Skip to content

Valgrind errors on some tests execution #925

@saygoodbyye

Description

@saygoodbyye

What happens?

When running make check with walgrind it throws errors on some tests.

To Reproduce

valgrind --quiet --exit-on-first-error=yes --error-exitcode=1 --leak-check=no --time-stamp=yes --gen-suppressions=all --trace-children=yes --suppressions=/home/test/postgres/src/tools/valgrind.supp make check

regression.out

ok 1         - alter_table_commands                   913937 ms
ok 2         - altered_tables                          84172 ms
ok 3         - approx_count_distinct                  777139 ms
ok 4         - array_problems                         227216 ms
ok 5         - array_type_support                     419586 ms
ok 6         - basic                                  704955 ms
not ok 7     - case_insensitivity                    1378237 ms
# (test process exited with exit code 2)
ok 8         - concurrency                            779375 ms
ok 9         - correct_null_conversions               312553 ms
ok 10        - create_schema                            2049 ms
ok 11        - create_table_as                        543098 ms
ok 12        - cte                                   1771235 ms
ok 13        - date                                   736654 ms
ok 14        - domain                                 121562 ms
not ok 15    - duckdb_only_functions                    5123 ms
# (test process exited with exit code 2)
ok 16        - duckdb_recycle                         466012 ms
ok 17        - duckdb_secrets                       27690301 ms
ok 18        - execution_error                        203237 ms
ok 19        - extensions                            5983759 ms
ok 20        - foreign_data_wrapper                     5438 ms
ok 21        - function                               500863 ms
ok 22        - gucs                                   232175 ms
ok 23        - hugeint_conversion                     148914 ms
ok 24        - issue_410                              349330 ms
ok 25        - issue_730                              273940 ms
ok 26        - issue_748                                1969 ms
ok 27        - issue_749                                5440 ms
ok 28        - issue_789                                1759 ms
ok 29        - issue_796                              369418 ms
ok 30        - issue_802                              283111 ms
ok 31        - issue_813                              535107 ms
ok 32        - json_functions_duckdb                 2123978 ms
ok 33        - materialized_view                      346602 ms
ok 34        - non_superuser                          366789 ms
ok 35        - prepare                                 52669 ms
ok 36        - projection_pushdown_unsupported_type    32634 ms
ok 37        - query_filter                           606614 ms
not ok 38    - read_functions                          16358 ms
# (test process exited with exit code 2)
not ok 39    - scan_postgres_tables                   296013 ms
ok 40        - search_path                            175414 ms
ok 41        - simple_functions                         1986 ms
ok 42        - standard_conforming_strings              7148 ms
ok 43        - tablesample                             89934 ms
ok 44        - temporary_tables                      1766153 ms
ok 45        - test_all_types                          33528 ms
ok 46        - time_bucket                           1118943 ms
ok 47        - timescale_conflict                      11352 ms
ok 48        - timestamp_timestamptz                 1617244 ms
ok 49        - timestamp_with_interval                470095 ms
ok 50        - transaction_errors                      46610 ms
ok 51        - transaction_isolation                    1213 ms
ok 52        - transactions                          2992095 ms
ok 53        - type_support                           716407 ms
ok 54        - union_functions                        404519 ms
ok 55        - unresolved_type                       1191997 ms
ok 56        - views                                  248808 ms
not ok 57    - parallel_postgres_scan                 190954 ms
# (test process exited with exit code 2)
1..57
# 5 of 57 tests failed.
==00:01:15:20.552 70220== Conditional jump or move depends on uninitialised value(s)
==00:01:15:20.552 70220==    at 0x99657F8: duckdb::ExternalFileCache::IsValid(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<cha>
==00:01:15:20.552 70220==    by 0x996C7E1: duckdb::CachingFileHandle::GetFileHandle() (in /home/egor/pgsql/lib/libduckdb.so)
==00:01:15:20.552 70220==    by 0x996CB47: duckdb::CachingFileHandle::CachingFileHandle(duckdb::CachingFileSystem&, duckdb::OpenFileInfo const&, duckdb::FileOpenFlags, duckdb::ExternalFileCache::CachedFile&) (in /home/egor/pgsql/lib/libduckdb.so)
==00:01:15:20.552 70220==    by 0x9976157: duckdb::CachingFileSystem::OpenFile(duckdb::OpenFileInfo const&, duckdb::FileOpenFlags) (in /home/egor/pgsql/lib/libduckdb.so)
==00:01:15:20.552 70220==    by 0xA39C7E4: duckdb::ParquetReader::ParquetReader(duckdb::ClientContext&, duckdb::OpenFileInfo, duckdb::ParquetOptions, duckdb::shared_ptr<duckdb::ParquetFileMetadataCache, true>) (in /home/egor/pgsql/lib/libduckdb.so)
==00:01:15:20.552 70220==    by 0xA37C58E: duckdb::ParquetMultiFileInfo::CreateReader(duckdb::ClientContext&, duckdb::OpenFileInfo const&, duckdb::BaseFileReaderOptions&, duckdb::MultiFileOptions const&) (in /home/egor/pgsql/lib/libduckdb.so)
==00:01:15:20.552 70220==    by 0x90A8949: duckdb::MultiFileReader::BindReader(duckdb::ClientContext&, duckdb::vector<duckdb::LogicalType, true>&, duckdb::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, true>&, du>
==00:01:15:20.552 70220==    by 0xA37DB18: duckdb::ParquetMultiFileInfo::BindReader(duckdb::ClientContext&, duckdb::vector<duckdb::LogicalType, true>&, duckdb::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, true>>
==00:01:15:20.552 70220==    by 0xA375766: duckdb::MultiFileFunction<duckdb::ParquetMultiFileInfo>::MultiFileBindInternal(duckdb::ClientContext&, duckdb::unique_ptr<duckdb::MultiFileReader, std::default_delete<duckdb::MultiFileReader>, true>, duckdb::sh>
==00:01:15:20.552 70220==    by 0xA385064: duckdb::MultiFileFunction<duckdb::ParquetMultiFileInfo>::MultiFileBind(duckdb::ClientContext&, duckdb::TableFunctionBindInput&, duckdb::vector<duckdb::LogicalType, true>&, duckdb::vector<std::__cxx11::basic_str>
==00:01:15:20.552 70220==    by 0x8AE7A89: duckdb::Binder::BindTableFunctionInternal(duckdb::TableFunction&, duckdb::TableFunctionRef const&, duckdb::vector<duckdb::Value, true>, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>>
==00:01:15:20.552 70220==    by 0x8AF2536: duckdb::Binder::Bind(duckdb::TableFunctionRef&) (in /home/test/pgsql/lib/libduckdb.so)
==00:01:15:20.552 70220==
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:_ZN6duckdb17ExternalFileCache7IsValidEbRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEElS8_l
   fun:_ZN6duckdb17CachingFileHandle13GetFileHandleEv
   fun:_ZN6duckdb17CachingFileHandleC1ERNS_17CachingFileSystemERKNS_12OpenFileInfoENS_13FileOpenFlagsERNS_17ExternalFileCache10CachedFileE
   fun:_ZN6duckdb17CachingFileSystem8OpenFileERKNS_12OpenFileInfoENS_13FileOpenFlagsE
   fun:_ZN6duckdb13ParquetReaderC1ERNS_13ClientContextENS_12OpenFileInfoENS_14ParquetOptionsENS_10shared_ptrINS_24ParquetFileMetadataCacheELb1EEE
   fun:_ZN6duckdb20ParquetMultiFileInfo12CreateReaderERNS_13ClientContextERKNS_12OpenFileInfoERNS_21BaseFileReaderOptionsERKNS_16MultiFileOptionsE
   fun:_ZN6duckdb15MultiFileReader10BindReaderERNS_13ClientContextERNS_6vectorINS_11LogicalTypeELb1EEERNS3_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1EEERNS_13MultiFileListERNS_17MultiFileBindDataERNS_21BaseFileReaderOptionsERNS_16MultiFile>
   fun:_ZN6duckdb20ParquetMultiFileInfo10BindReaderERNS_13ClientContextERNS_6vectorINS_11LogicalTypeELb1EEERNS3_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1EEERNS_17MultiFileBindDataE
   fun:_ZN6duckdb17MultiFileFunctionINS_20ParquetMultiFileInfoEE21MultiFileBindInternalERNS_13ClientContextENS_10unique_ptrINS_15MultiFileReaderESt14default_deleteIS6_ELb1EEENS_10shared_ptrINS_13MultiFileListELb1EEERNS_6vectorINS_11LogicalTypeELb1EEERNS>
   fun:_ZN6duckdb17MultiFileFunctionINS_20ParquetMultiFileInfoEE13MultiFileBindERNS_13ClientContextERNS_22TableFunctionBindInputERNS_6vectorINS_11LogicalTypeELb1EEERNS7_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1EEE
   fun:_ZN6duckdb6Binder25BindTableFunctionInternalERNS_13TableFunctionERKNS_16TableFunctionRefENS_6vectorINS_5ValueELb1EEESt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_NS_33CaseInsensitiveStringHashFunctionENS_29CaseInsensiti>
   fun:_ZN6duckdb6Binder4BindERNS_16TableFunctionRefE
}
==00:01:15:20.552 70220==
==00:01:15:20.552 70220== Exit program on first error (--exit-on-first-error=yes)
2025-09-09 00:02:25.003 +07 postmaster[62681] LOG:  server process (PID 70220) exited with exit code 1
2025-09-09 00:02:25.003 +07 postmaster[62681] DETAIL:  Failed process was running: select r['UPPER'], r['lower'] from read_parquet('/.../pg_duckdb/test/regression/data/uppercase.parquet') r;

==00:16:53:28.285 134088== Syscall param pwrite64(buf) points to uninitialised byte(s)
==00:16:53:28.285 134088==    at 0x578F555: __libc_pwrite64 (pwrite64.c:25)
==00:16:53:28.285 134088==    by 0x578F555: pwrite (pwrite64.c:23)
==00:16:53:28.285 134088==    by 0x5F75CA: pg_pwritev (pg_iovec.h:97)
==00:16:53:28.285 134088==    by 0x5FA3C6: FileWriteV (fd.c:3006)
==00:16:53:28.285 134088==    by 0x5ECF1B: FileWrite (fd.h:222)
==00:16:53:28.285 134088==    by 0x5ECF1B: BufFileDumpBuffer (buffile.c:537)
==00:16:53:28.285 134088==    by 0x5ED778: BufFileWrite (buffile.c:688)
==00:16:53:28.285 134088==    by 0x7CCD12: ltsWriteBlock (logtape.c:268)
==00:16:53:28.285 134088==    by 0x7CCCF1: ltsWriteBlock (logtape.c:259)
==00:16:53:28.285 134088==    by 0x7CD1CA: LogicalTapeWrite (logtape.c:808)
==00:16:53:28.285 134088==    by 0x439867: hashagg_spill_tuple (nodeAgg.c:2975)
==00:16:53:28.285 134088==    by 0x4399D6: lookup_hash_entries (nodeAgg.c:2138)
==00:16:53:28.285 134088==    by 0x439CF4: agg_fill_hash_table (nodeAgg.c:2559)
==00:16:53:28.285 134088==    by 0x43C836: ExecAgg (nodeAgg.c:2172)
==00:16:53:28.285 134088==  Address 0xbe31ec8 is 80 bytes inside a block of size 8,264 client-defined
==00:16:53:28.285 134088==    at 0x7C7549: palloc (mcxt.c:1341)
==00:16:53:28.285 134088==    by 0x5ECC75: makeBufFileCommon (buffile.c:120)
==00:16:53:28.285 134088==    by 0x5ECCBB: makeBufFile (buffile.c:141)
==00:16:53:28.285 134088==    by 0x5ED350: BufFileCreateTemp (buffile.c:212)
==00:16:53:28.285 134088==    by 0x7CCE77: LogicalTapeSetCreate (logtape.c:595)
==00:16:53:28.285 134088==    by 0x43956F: hash_agg_enter_spill_mode (nodeAgg.c:1894)
==00:16:53:28.285 134088==    by 0x439683: hash_agg_check_limits (nodeAgg.c:1872)
==00:16:53:28.285 134088==    by 0x4396AC: initialize_hash_entry (nodeAgg.c:2052)
==00:16:53:28.285 134088==    by 0x43999E: lookup_hash_entries (nodeAgg.c:2125)
==00:16:53:28.285 134088==    by 0x439CF4: agg_fill_hash_table (nodeAgg.c:2559)
==00:16:53:28.285 134088==    by 0x43C836: ExecAgg (nodeAgg.c:2172)
==00:16:53:28.285 134088==    by 0x42D602: ExecProcNodeFirst (execProcnode.c:466)
==00:16:53:28.285 134088==
{
   <insert_a_suppression_name_here>
   Memcheck:Param
   pwrite64(buf)
   fun:__libc_pwrite64
   fun:pwrite
   fun:pg_pwritev
   fun:FileWriteV
   fun:FileWrite
   fun:BufFileDumpBuffer
   fun:BufFileWrite
   fun:ltsWriteBlock
   fun:ltsWriteBlock
   fun:LogicalTapeWrite
   fun:hashagg_spill_tuple
   fun:lookup_hash_entries
   fun:agg_fill_hash_table
   fun:ExecAgg
}
==00:16:53:28.285 134088==
==00:16:53:28.285 134088== Exit program on first error (--exit-on-first-error=yes)
2025-09-09 15:40:32.734 +07 postmaster[62681] LOG:  server process (PID 134088) exited with exit code 1
2025-09-09 15:40:32.734 +07 postmaster[62681] DETAIL:  Failed process was running: INSERT INTO tbl SELECT i, jsonb_build_object('a', i), array_agg(i) FROM generate_series(1, 500000) i GROUP BY i;

OS:

Ubuntu 24.04

pg_duckdb Version (if built from source use commit hash):

6ce2b8d

Postgres Version (if built from source use commit hash):

3e6dfcfb0529a9d003e07a56f58d0ff3c46556bf

Hardware:

No response

Full Name:

Egor Chindyaskin

Affiliation:

Postgres Professional

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a source build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions