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: Alexander Lakhin <exclusion@gmail.com>, pgsql-bugs@lists.postgresql.org,
kyzevan23@mail.ru
Date: 2023-03-29T15:37:53Z
Lists: pgsql-bugs
Pavel Borisov <pashkin.elfe@gmail.com> writes: > So I think that the patch by Alexander will do the thing. I also added some > comments to the code and removed extra context reset in gistBuildCallback > (which is already done level down) to make things clear. My apologies for having let this slip through the cracks. I think I'd wanted to understand why the committed version of the GiST index tests doesn't expose the problem, and I never got time to study that. I still haven't tracked it down, but the proposed patch seems clearly safe so I've gone ahead and pushed it. I did use Alexander's original code change that just moved the totals-incrementing. It looks to me like gistProcessEmptyingQueue is not guaranteed to reach the context reset, and I'd rather have an extra reset than miss one. (No-op context resets are cheap.) 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