PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16329
PG Version12.2
OSUbuntu 18.04
Opened2020-03-29 21:00:01+00
Reported byAlexander Lakhin
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16329
Logged by:          Alexander Lakhin
Email address:      (redacted)
PostgreSQL version: 12.2
Operating system:   Ubuntu 18.04
Description:        

Running the following query under valgrind:
create table gist_point_tbl(id int4, p point);
insert into gist_point_tbl (id, p)
select g, point(g*10+1, g*10+1) from generate_series(1, 30000) g;
create index gist_pointidx2 on gist_point_tbl using gist(p) with (buffering
= on, fillfactor=50);

leads to a memory access error:
==00:00:00:08.755 18585== Invalid read of size 2
==00:00:00:08.756 18585==    at 0x1F94CA: gistBuildCallback
(gistbuild.c:495)
==00:00:00:08.756 18585==    by 0x21F556: heapam_index_build_range_scan
(heapam_handler.c:1664)
==00:00:00:08.756 18585==    by 0x1F972F: table_index_build_scan
(tableam.h:1522)
==00:00:00:08.756 18585==    by 0x1F972F: gistbuild (gistbuild.c:196)
==00:00:00:08.756 18585==    by 0x29D1FE: index_build (index.c:2909)
==00:00:00:08.756 18585==    by 0x29EAC8: index_create (index.c:1221)
==00:00:00:08.756 18585==    by 0x348C60: DefineIndex (indexcmds.c:1005)
==00:00:00:08.756 18585==    by 0x52B518: ProcessUtilitySlow
(utility.c:1372)
==00:00:00:08.756 18585==    by 0x52AAC5: standard_ProcessUtility
(utility.c:927)
==00:00:00:08.756 18585==    by 0x52AB73: ProcessUtility (utility.c:360)
==00:00:00:08.756 18585==    by 0x527025: PortalRunUtility (pquery.c:1175)
==00:00:00:08.756 18585==    by 0x527C6F: PortalRunMulti (pquery.c:1321)
==00:00:00:08.756 18585==    by 0x5289DE: PortalRun (pquery.c:796)
==00:00:00:08.756 18585==  Address 0x8a4ca1e is 398 bytes inside a block of
size 8,192 alloc'd
==00:00:00:08.756 18585==    at 0x4C2FBFF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:00:08.756 18585==    by 0x6781E6: AllocSetContextCreateInternal
(aset.c:477)
==00:00:00:08.756 18585==    by 0x3BF065: ExecInitFunctionScan
(nodeFunctionscan.c:508)
==00:00:00:08.756 18585==    by 0x3ACE6F: ExecInitNode
(execProcnode.c:247)
==00:00:00:08.756 18585==    by 0x3D03E1: ExecInitModifyTable
(nodeModifyTable.c:2363)
==00:00:00:08.756 18585==    by 0x3ACD4C: ExecInitNode
(execProcnode.c:174)
==00:00:00:08.756 18585==    by 0x3A70F3: InitPlan (execMain.c:1020)
==00:00:00:08.756 18585==    by 0x3A7299: standard_ExecutorStart
(execMain.c:266)
==00:00:00:08.756 18585==    by 0x3A739B: ExecutorStart (execMain.c:148)
==00:00:00:08.756 18585==    by 0x527936: ProcessQuery (pquery.c:156)
==00:00:00:08.756 18585==    by 0x527B34: PortalRunMulti (pquery.c:1283)
==00:00:00:08.756 18585==    by 0x5289DE: PortalRun (pquery.c:796)

Reproduced at least on REL_10_STABLE..master.

Messages

DateAuthorSubject
2020-03-29 21:00:01+00PG Bug reporting formBUG #16329: Valgrind detects an invalid read when building a gist index with buffering
2020-03-30 05:00:00+00Alexander LakhinRe: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
2020-04-06 06:00:00+00Alexander LakhinRe: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
2020-05-02 04:45:00+00Alexander LakhinRe: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
2020-05-05 18:59:17+00Tom LaneRe: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
2020-05-11 20:00:01+00Alexander LakhinRe: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
2020-05-12 05:00:01+00Alexander LakhinRe: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering