Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puoUF-0005DL-AC for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 06:00:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puoUD-0001tV-SH for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 06:00:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puoUD-0001tL-JB for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 06:00:09 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1puoU8-000gOk-BS for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 06:00:09 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4efec123b28so1593093e87.1 for ; Thu, 04 May 2023 23:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683266403; x=1685858403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oRy3LB3+PZ+DyXZbcFnWUfxtCT1hVFaqnA8aCYn4fHQ=; b=olPQYoc8yI2Gb2IZRnRCcmtv/Puy2ub2TNQimw+z0RUS20tB/5WNBLIn3i/Xcx2l26 +3Cwk1S5hOZYNrKypUdxvs3YQat49EnE3e+AQc5I3X56wymUAII8mmCxQO9wn0Ukntuh Crun0XvrD2WXSqHQBsQSDPga3wUSKgcj4yti34+Apr7rVeLQzGsNbpUMC2I/3GbOqhMd dEAo2lHVV+T2HBZ4CBVNTYMxBGF1cUS44jkaDheL/+ZVWZwqhXBYBDAe0kmBmtC5ZADu VNXeFRk+K5K6TvXX+tSkUAoYR5/mQZszU5S6CfQiMQUuiCK7lnAHDa9PkoX/n5VV+Z6G eckA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683266403; x=1685858403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oRy3LB3+PZ+DyXZbcFnWUfxtCT1hVFaqnA8aCYn4fHQ=; b=BlZh4KlwZ6dlcfRggibg+1lKZFb5Mpo7o0ee2zDxoP2LBw5nHXevVtWkX0aqszqc+8 QV91hFAmWbzK6usTzafqDtHNBZH4ZSNWJvLgl4CbEUMVfxKasoCZotyQNyUmaJf2Hx4p jVtSVDi/Y3mqXqugxrk98URFJCL+ykZOHUoYA+MUHSn6TkXIALFXCTi35Ni/LhCczClp G/lElhmJ6z5RjD2fjWBND4iDX4s8QHfQJalpVm1Ft/7WviE+25w7ndBL71ibAahtkTGy PYqmuiU4N3wVnm0vTtll84Z1YuYQDWUNCV+lw5ZIRLCr+cdvcPZLxADT7HedbRdX+fCk 8P5w== X-Gm-Message-State: AC+VfDwCP3HRdqS53LnAYk4tJPM1nX+0NApuCu0K6iESjFFcujOPhpsu ZKUxG4XvXcUzLspgiMrQ+Fo= X-Google-Smtp-Source: ACHHUZ43DrhGo8iiqC2O8a6ESR8jGuj1zGUwZ1zxkqu+/Z3s3NOM8JKNGUb406Q5r9lvKxdE8YiP6A== X-Received: by 2002:a19:c209:0:b0:4d1:3d1d:4914 with SMTP id l9-20020a19c209000000b004d13d1d4914mr223366lfc.33.1683266403362; Thu, 04 May 2023 23:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.28.115]) by smtp.gmail.com with ESMTPSA id a17-20020ac25211000000b004f002961a96sm154791lfl.230.2023.05.04.23.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 May 2023 23:00:02 -0700 (PDT) Message-ID: <94ae9bca-5ebb-1e68-bb7b-4f32e89fefbe@gmail.com> Date: Fri, 5 May 2023 09:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Add LZ4 compression in pg_dump Content-Language: en-US To: Tomas Vondra , Justin Pryzby , gkokolatos@pm.me Cc: shiy.fnst@fujitsu.com, Michael Paquier , pgsql-hackers@lists.postgresql.org, Rachel Heaton References: <7zu6GYFi72jByVk2SEe_nd8r1DHhwA35vSntAE9sAfiMX9Lfk6bwimkwmu7GDgYaEvL27SE4qF1uK4_LHWQM4H-SXOwkMAI-GV8PKGmED_E=@pm.me> <8421f53d-c9f7-c02e-3278-9f9522a8e8f3@enterprisedb.com> <33496f7c-3449-1426-d568-63f6bca2ac1f@gmail.com> <1aBKUlb8BGVUUTkRJwEmU3ud1NyeHVCoC7bpOKAuRYlHHJ7hRiDVXYgad-wmjx1K3pykd_ctyY4Lqy9xA7JGLXOm1Eul-imdZ_7TVr5LY8U=@pm.me> <3da84c90-7e12-75ee-a582-025bc68dd098@enterprisedb.com> <5qAu7vrMV3hEodlIC82b0JICWTwEUSRoIDWlIaczNBIEVVfDH2lccxHNIQ726e4nX_Qqjc4lPc5_z9RtV28NMdVv7BNiADF4JB-FDahmlVk=@pm.me> <32ba9612-1982-4b2d-135a-5d1222987082@enterprisedb.com> <3beb0dd7-c927-3eca-689f-716e255d5b27@enterprisedb.com> From: Alexander Lakhin In-Reply-To: <3beb0dd7-c927-3eca-689f-716e255d5b27@enterprisedb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 23.03.2023 20:10, Tomas Vondra wrote: > So pushed all three parts, after updating the commit messages a bit. > > This leaves the empty-data issue (which we have a fix for) and the > switch to LZ4F. And then the zstd part. > I'm sorry that I haven't noticed/checked that before, but when trying to perform check-world with Valgrind I've discovered another issue presumably related to LZ4File_gets(). When running under Valgrind: PROVE_TESTS=t/002_pg_dump.pl make check -C src/bin/pg_dump/ I get: ... [07:07:11.683](0.000s) ok 1939 - compression_lz4_dir: glob check for .../src/bin/pg_dump/tmp_check/tmp_test_HB6A/compression_lz4_dir/*.dat.lz4 # Running: pg_restore --jobs=2 --file=.../src/bin/pg_dump/tmp_check/tmp_test_HB6A/compression_lz4_dir.sql .../src/bin/pg_dump/tmp_check/tmp_test_HB6A/compression_lz4_dir ==00:00:00:00.579 2811926== Conditional jump or move depends on uninitialised value(s) ==00:00:00:00.579 2811926==    at 0x4853376: rawmemchr (vg_replace_strmem.c:1548) ==00:00:00:00.579 2811926==    by 0x4C96A67: _IO_str_init_static_internal (strops.c:41) ==00:00:00:00.579 2811926==    by 0x4C693A2: _IO_strfile_read (strfile.h:95) ==00:00:00:00.579 2811926==    by 0x4C693A2: __isoc99_sscanf (isoc99_sscanf.c:28) ==00:00:00:00.579 2811926==    by 0x11DB6F: _LoadLOs (pg_backup_directory.c:458) ==00:00:00:00.579 2811926==    by 0x11DD1E: _PrintTocData (pg_backup_directory.c:422) ==00:00:00:00.579 2811926==    by 0x118484: restore_toc_entry (pg_backup_archiver.c:882) ==00:00:00:00.579 2811926==    by 0x1190CC: RestoreArchive (pg_backup_archiver.c:699) ==00:00:00:00.579 2811926==    by 0x10F25D: main (pg_restore.c:414) ==00:00:00:00.579 2811926== ... It looks like the line variable returned by gets_func() here is not null-terminated:     while ((CFH->gets_func(line, MAXPGPATH, CFH)) != NULL)     { ...         if (sscanf(line, "%u %" CppAsString2(MAXPGPATH) "s\n", &oid, lofname) != 2) ... And Valgrind doesn't like it. Best regards, Alexander