Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u78Jn-00Avdy-1U for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Apr 2025 07:45:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u78Jk-00CAd7-KU for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Apr 2025 07:45:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u78Jk-00CAcx-9y for pgsql-hackers@lists.postgresql.org; Tue, 22 Apr 2025 07:45:21 +0000 Received: from mail.nataraj.su ([168.119.121.177]) by makus.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1u78Ji-001JWP-1h for pgsql-hackers@lists.postgresql.org; Tue, 22 Apr 2025 07:45:20 +0000 Received: from thinkpad-pgpro.localnet (unknown [91.203.188.92]) by mail.nataraj.su (Postfix) with ESMTPSA id F33FD144ABB; Tue, 22 Apr 2025 10:45:16 +0300 (MSK) From: Nikolay Shaplov To: Daniel Gustafsson , pgsql-hackers@lists.postgresql.org Cc: PostgreSQL Developers , egori@altlinux.org, nickel@altlinux.org, kuznetsovam@altlinux.org Subject: Re: [PATCH] Check for TupleTableSlot nullness before dereferencing Date: Tue, 22 Apr 2025 10:45:15 +0300 Message-ID: <2539287.KokGdZ0ToA@thinkpad-pgpro> Organization: Postgres Professional In-Reply-To: <18bda8da-1ab0-4a4d-9aca-826610a244a8@altlinux.org> References: <98e18ffc-c402-4710-ae28-6d6dbcf08e44@altlinux.org> <18bda8da-1ab0-4a4d-9aca-826610a244a8@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2046189.NnIJQXNAa5"; micalg="pgp-sha512"; protocol="application/pgp-signature" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --nextPart2046189.NnIJQXNAa5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Nikolay Shaplov Date: Tue, 22 Apr 2025 10:45:15 +0300 Message-ID: <2539287.KokGdZ0ToA@thinkpad-pgpro> Organization: Postgres Professional In-Reply-To: <18bda8da-1ab0-4a4d-9aca-826610a244a8@altlinux.org> MIME-Version: 1.0 =D0=92 =D0=BF=D0=B8=D1=81=D1=8C=D0=BC=D0=B5 =D0=BE=D1=82 =D0=BF=D1=8F=D1=82= =D0=BD=D0=B8=D1=86=D0=B0, 13 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 202= 4 =D0=B3. 11:54:35 MSK =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1= =82=D0=B5=D0=BB=D1=8C Alexander=20 Kuznetsov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > Hello, >=20 > ping. What do you think about reasoning below? Maybe we should consider > proposing different patch for removing redundant check there? Hi! Please, pay attention that commitfest entry for this patch https://commitfest.postgresql.org/patch/5662/ reports problems with windows build. There is a small chance that this is flase alarm, sometimes checkers fails = for=20 their own reason. But most probably this is persistent error, and if it is,= =20 this problem should be researched first of all, and fixed. Only after that = there=20 there can be any discussion if this null-related problem should be fixed or= =20 not. >=20 > 09.10.2024 18:23, Alexander Kuznetsov wrote: > > 03.10.2024 12:48, Daniel Gustafsson wrote: > >> From a quick reading we can only reach there after evaluating an > >> expression, so can it really be null though? This code hasn't changed > >> all that much since 2009, if there was a reachable segfault on a null > >> pointer deref I have a feeling we'd heard about it by now so some extra > >> care seems warranted to ensure it's not a static analyzer false > >> positive. > >=20 > > Thanks for your response! > > It seems to me that dereferencing is possible under the following > > scenario: > > [...] > > This entire reasoning is based on the assumption that slot2 can > > theoretically be NULL, as there is such a check at line 968. Is it > > possible that no errors have occurred because this condition has always > > been satisfied and is, perhaps, redundant, or maybe I'm misunderstanding > > something? =2D-=20 Nikolay Shaplov aka Nataraj =46uzzing Engineer at Postgres Professional Matrix IM: @dhyan:nataraj.su --nextPart2046189.NnIJQXNAa5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEE+sk3ebqQKlezKOi8PMbfuIHAGpgFAmgHSQwACgkQPMbfuIHA GphGBgf9FElTut6zh/GGRL05/QFR2C7lPV/kiCb4BMTC0iKLfKUULLXdWvPXQ+ru 5+EG40OJaD/G0Y2rgK9ZRv/KmEsvbWSS/C43BYz4vfuJaLIdwYKYFAKNtQlUqv1M jbZlpKbfOHHs7uipdDGS0NZrTKk2rwynLd7kBbwl0Ke8eb9wXmNjM8MLbwH/PYwj yLkwmHe0MlM/6ysh5nglVY6ZWOW2DryGZAdRErZJ+wstKdVaMBf6zOaFZdWq3/BT 7/26hs39RESUdu9AF6pYG/O6aBMTogP8RLZJPWIjDMgtCgYCBxIIBFN/JWaDZS3D k0vuGMMOCNuaE4KJ4l2i8dUrHramNw== =T3nM -----END PGP SIGNATURE----- --nextPart2046189.NnIJQXNAa5--