Re: [PATCH] Check for TupleTableSlot nullness before dereferencing - Mailing list pgsql-hackers

From Nikolay Shaplov
Subject Re: [PATCH] Check for TupleTableSlot nullness before dereferencing
Date
Msg-id 2539287.KokGdZ0ToA@thinkpad-pgpro
Whole thread Raw
In response to Re: [PATCH] Check for TupleTableSlot nullness before dereferencing  (Alexander Kuznetsov <kuznetsovam@altlinux.org>)
List pgsql-hackers
В письме от пятница, 13 декабря 2024 г. 11:54:35 MSK пользователь Alexander
Kuznetsov написал:
> Hello,
>
> 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
their own reason. But most probably this is persistent error, and if it is,
this problem should be researched first of all, and fixed. Only after that there
there can be any discussion if this null-related problem should be fixed or
not.


>
> 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.
> >
> > 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?


--
Nikolay Shaplov aka Nataraj
Fuzzing Engineer at Postgres Professional
Matrix IM: @dhyan:nataraj.su

Attachment

pgsql-hackers by date:

Previous
From: Filip Janus
Date:
Subject: Re: Proposal: Adding compression of temporary files
Next
From: Daniel Gustafsson
Date:
Subject: Re: pgsql: Add function to get memory context stats for processes