Re: [BUG] Uninitializaed configOut.leafType used.

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG] Uninitializaed configOut.leafType used.
Date: 2019-11-13 18:47:15
Message-ID: 20191113184715.hgpfvphfx4lw6fwm@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 13, 2019 at 05:55:40PM +0000, Ranier Vilela wrote:
>Hi,
>Ok, so all these commands are for what?
>
> case SPGIST_CONFIG_PROC:
> ok = check_amproc_signature(procform->amproc, VOIDOID, true,
> 2, 2, INTERNALOID, INTERNALOID);
> configIn.attType = procform->amproclefttype;
> memset(&configOut, 0, sizeof(configOut));
>
> OidFunctionCall2(procform->amproc,
> PointerGetDatum(&configIn),
> PointerGetDatum(&configOut));
>
> configOutLefttype = procform->amproclefttype;
> configOutRighttype = procform->amprocrighttype;
>
> /*
> * When leaf and attribute types are the same, compress
> * function is not required and we set corresponding bit in
> * functionset for later group consistency check.
> */
> if (!OidIsValid(configOut.leafType) ||
> configOut.leafType == configIn.attType)
> {
>
>When case SPGIST_CONFIG_PROC, OidIsValid(configOut.leafType) is tested,
>but when case SPGIST_COMPRESS_PROC is fired, OidIsValid(configOut.leafType) is not necessary and configOut.leafType
>happy accessed?
>
>Maybe, the Valgrind paths, didn't have a chance, with case SPGIST_COMPRESS_PROC.
>
>I review carefully, before send to list and premature judgments, don't help.
>

That's great, but unfortunately it's useless if you don't explain the
reasoning while reporting the issue. Even better if you can provide a
reproducer hitting the issue, of course.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2019-11-13 18:47:59 Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash
Previous Message Andres Freund 2019-11-13 18:42:13 Re: BUG #16109: Postgres planning time is high across version - 10.6 vs 10.10