pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
Date: Mon, 12 Oct 2020 16:03:10 -0400
Message-ID: <3249980.1602532990@sss.pgh.pa.us> (raw)
In-Reply-To: <CALT9ZEF1P37jN_-jn5Okesga9Lzasq034LpQc=cbEYC+AMG73A@mail.gmail.com>
References: <16329-7a6aa9b6fa1118a1@postgresql.org>
	<ca1f896b-e5d1-53a7-5bc3-9451ab9aca22@gmail.com>
	<e91e45fd-a614-bb87-e9fc-c556c2b95fe5@gmail.com>
	<3dda6945-c147-5afc-7720-38ec6848dafa@gmail.com>
	<10261.1588705157@sss.pgh.pa.us>
	<93ca4540-0016-8217-2b31-535613499987@gmail.com>
	<06f117b8-bbc1-4190-d204-ef329121cbca@gmail.com>
	<CALT9ZEECCV5m7wvxg46PC-7x-EybUmnpupBGhSFMoAAay+r6HQ@mail.gmail.com>
	<CALT9ZEF1P37jN_-jn5Okesga9Lzasq034LpQc=cbEYC+AMG73A@mail.gmail.com>

Pavel Borisov <pashkin.elfe@gmail.com> writes:
>> I investigated this issue under Valgrind and found that in v13 it is no
>> longer detected and the patch in the discussion above is no longer needed.

> I want to correct myself that issue is no longer detected in master, but
> not in 13stable. Everything else is without changes.

I went to try to evaluate this, and found that with or without your
proposed testing addition, the code coverage for gistbuildbuffers.c
remains at 0.0%.  The previous testing patch is the same.  So that's
why the issue is "no longer detectable": the code is not reached in
HEAD.

After some investigation, I found that commit 16fa9b2b3 broke this:
if the opclass(es) have GIST_SORTSUPPORT_PROC, then the buffering
code will not be used, no matter what the index's options say.

This seems like a spectacularly bad idea from a testing standpoint,
even if it's the right thing for most users.  Basically, it is now
impossible to test buffering builds at all, unless you find a gist
opclass that lacks GIST_SORTSUPPORT_PROC.  Although there are a
few candidates to pick from, someone could at any time add such
a support proc and silently break your testing plan, just as
16fa9b2b3 did by adding such a proc to point_ops.

So I think 16fa9b2b3 has to be reconsidered: if we have a
buffering=on index parameter, we must go with that independently
of the availability of sort support procs.  Unless I hear very
loud squawks very quickly, I'll go make that happen.

(I observe that 16fa9b2b3 also failed to update the relevant
documentation in 65.4.1...)

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <3249980.1602532990@sss.pgh.pa.us>
Permalink:  ../3249980.1602532990@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3249980.1602532990@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pashkin.elfe@gmail.com, hlinnaka@iki.fi, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
  In-Reply-To: <3249980.1602532990@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox