RE: [BUG] Uninitializaed configOut.leafType used.

From: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>
To: "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 17:55:40
Message-ID: MN2PR18MB29278ED3DCF436F92D144451E3760@MN2PR18MB2927.namprd18.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

Best regards,
Ranier Vilela

________________________________________
De: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Enviado: quarta-feira, 13 de novembro de 2019 17:18
Para: Ranier Vilela
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Assunto: Re: [BUG] Uninitializaed configOut.leafType used.

Ranier Vilela <ranier_gyn(at)hotmail(dot)com> writes:
> Hi,
> file: /backend/access/spgist/spgvalidate.c
> line: 159
> var: configOut.leafType

TBH, I think whatever tool you're using to detect these things
is buggy. We don't get compiler warnings about it from any
compiler in common use among pghackers, and what might be
more to the point, we don't get Valgrind complaints.

If you want us to take these complaints seriously, you need
to provid more than zero evidence why we should.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2019-11-13 18:03:20 Re: [BUG] Uninitializaed configOut.leafType used.
Previous Message Andres Freund 2019-11-13 17:47:33 Re: BUG #16112: large, unexpected memory consumption