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 1pb3Vu-0006vO-LY for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Mar 2023 18:00:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pb3Vs-000677-FS for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Mar 2023 18:00:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pb3Vs-00066y-48 for pgsql-hackers@lists.postgresql.org; Sat, 11 Mar 2023 18:00:12 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pb3Vl-0007lQ-JV for pgsql-hackers@lists.postgresql.org; Sat, 11 Mar 2023 18:00:11 +0000 Received: by mail-lf1-x133.google.com with SMTP id n2so10679173lfb.12 for ; Sat, 11 Mar 2023 10:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678557603; 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=aGk4cPXoAqkp7wJ9Oi8KQatyFRjRmxIYm5/iYIfsh9o=; b=NhPV1PA3ZEeprnMv5J4jNg8srU500Sr51e9KcpXkcQjYVuUImVXdFsjFSCgHjhtrjk vlJzVL70gHh+bMooXmEtB6w1wDxMkENp5XrhT7MermnczofYZo+AmR4WYBjJFdL39Fo5 Qzel095CuYTKMTfPvBbiySheQbvb9lAUo9GAuVu3gN4T/kJeohL+aWeP16IaJxnMOkrR 9AhDQI/pWA0+oVros/qdQxNBPr9CtN2KYS2al7ohdwb56AYtD7BdSfdn5JucwGJwlFyT 6g2q6r9p3fGLekYi2syMPN7aX1lNbWESS7Gcl391xfLpJ5dh9GF4oW+l1uZgjOklfKNi MAhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678557603; 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=aGk4cPXoAqkp7wJ9Oi8KQatyFRjRmxIYm5/iYIfsh9o=; b=U75CnuMFDSk2/aNx22Jek8xgq4vRgLW5Fgr+i3QpKr9Wi2olY5dGqzAhgXaqxcW2PX ryr4lJwtUCfNw+jat9vSRin8s6BxNWLVdklFXNLW0o7G/xo2lrmfvpuJ/9Xs8CqLo96f lhLNP8G4eoUiQFadk6hRublIB2NlRfEERYgf7aH/9Gln9j82SDGp8aDQEhKAIJ8MNL6D TLUlJ8SHMTNTB/8vPC7geYD8W8N9uMCmdRk04j0qZ5xojKckU7xBI4RfNvxMACvbytyT V3uRgPze0gKPwVmfG8FYXapGrgD28FH6L4QDr9n5Ts9lf+xUV7qj08D7yDVE9H/kjwmc tSxA== X-Gm-Message-State: AO0yUKVPZuo8NulT600qtLV3Y5duqqQho15PRFyNMS5sUUq4Fr3a0oMd JQLQLrLfm0m5ynPueun9jRI= X-Google-Smtp-Source: AK7set/egibbprMQd41PGVLmAfaITwhad0GqPuOL7xJ20fqtrochJaBHTCwJLetde+RK2Lkcso9PwA== X-Received: by 2002:ac2:5ec8:0:b0:4e1:5d87:330c with SMTP id d8-20020ac25ec8000000b004e15d87330cmr7693056lfq.50.1678557602843; Sat, 11 Mar 2023 10:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.5.76]) by smtp.gmail.com with ESMTPSA id m2-20020a195202000000b004d3d43c7569sm384252lfb.3.2023.03.11.10.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Mar 2023 10:00:02 -0800 (PST) Message-ID: <717391f1-4d73-45c0-e649-4b4aaff3f87d@gmail.com> Date: Sat, 11 Mar 2023 21:00:00 +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: gkokolatos@pm.me Cc: Tomas Vondra , "shiy.fnst@fujitsu.com" , Michael Paquier , Justin Pryzby , "pgsql-hackers@lists.postgresql.org" , Rachel Heaton References: <7zu6GYFi72jByVk2SEe_nd8r1DHhwA35vSntAE9sAfiMX9Lfk6bwimkwmu7GDgYaEvL27SE4qF1uK4_LHWQM4H-SXOwkMAI-GV8PKGmED_E=@pm.me> <535565cd-b69f-c064-a845-15c0fc44db4a@enterprisedb.com> <22cb80ed-ec87-54c7-fd5b-cdcf79766bb1@enterprisedb.com> <8421f53d-c9f7-c02e-3278-9f9522a8e8f3@enterprisedb.com> <33496f7c-3449-1426-d568-63f6bca2ac1f@gmail.com> <1aBKUlb8BGVUUTkRJwEmU3ud1NyeHVCoC7bpOKAuRYlHHJ7hRiDVXYgad-wmjx1K3pykd_ctyY4Lqy9xA7JGLXOm1Eul-imdZ_7TVr5LY8U=@pm.me> From: Alexander Lakhin In-Reply-To: <1aBKUlb8BGVUUTkRJwEmU3ud1NyeHVCoC7bpOKAuRYlHHJ7hRiDVXYgad-wmjx1K3pykd_ctyY4Lqy9xA7JGLXOm1Eul-imdZ_7TVr5LY8U=@pm.me> 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 Hi Georgios, 11.03.2023 13:50, gkokolatos@pm.me wrote: > I can not answer about the buildfarms. Do you think that adding an explicit > check for this warning in meson would help? I am a bit uncertain as I think > that type-limits are included in extra. > > @@ -1748,6 +1748,7 @@ common_warning_flags = [ > '-Wshadow=compatible-local', > # This was included in -Wall/-Wformat in older GCC versions > '-Wformat-security', > + '-Wtype-limits', > ] I'm not sure that I can promote additional checks (or determine where to put them), but if some patch introduces a warning of a type that wasn't present before, I think it's worth to eliminate the warning (if it is sensible) to keep the source code check baseline at the same level or even lift it up gradually. I've also found that the same commit introduced a single instance of the analyzer-possible-null-argument warning: CPPFLAGS="-Og -fanalyzer -Wno-analyzer-malloc-leak -Wno-analyzer-file-leak -Wno-analyzer-null-dereference -Wno-analyzer-shift-count-overflow -Wno-analyzer-free-of-non-heap -Wno-analyzer-null-argument -Wno-analyzer-double-free -Wanalyzer-possible-null-argument" ./configure --with-lz4 -q && make -s -j8 compress_io.c: In function ‘hasSuffix’: compress_io.c:158:47: warning: use of possibly-NULL ‘filename’ where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]   158 |         int                     filenamelen = strlen(filename);       | ^~~~~~~~~~~~~~~~   ‘InitDiscoverCompressFileHandle’: events 1-3 ... (I use gcc-11.3.) As I can see, many existing uses of strdup() are followed by a check for null result, so maybe it's a common practice and a similar check should be added in InitDiscoverCompressFileHandle(). (There also a couple of other warnings introduced with the lz4 compression patches, but those ones are not unique, so I maybe they aren't worth fixing.) >> It is a good thing that the restore fails with bad input. Yet it should >> have failed earlier. The attached makes certain it does fail earlier. >> Thanks! Your patch definitely fixes the issue. Best regards, Alexander