Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
Alexander Lakhin <exclusion@gmail.com>,
pgsql-bugs@lists.postgresql.org
Date: 2020-10-12T20:03:10Z
Lists: pgsql-bugs
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
Commits
-
Fix dereference of dangling pointer in GiST index buffering build.
- d2a1d4b190ec 12.15 landed
- b5c6776c1127 11.20 landed
- a1904c9ce56a 14.8 landed
- 8e5eef50c5b4 16.0 landed
- 2dc77adc768e 15.3 landed
- 2adb6adad5f8 13.11 landed
-
Fix GiST buffering build to work when there are included columns.
- 962ab473ec3d 13.1 landed
- 371668a8389d 14.0 landed
- 12945874ebd6 12.5 landed
-
Re-allow testing of GiST buffered builds.
- 78c0b6ed273a 14.0 landed
-
Add support for building GiST index by sorting.
- 16fa9b2b30a3 14.0 cited