BUG #15899: Valgrind detects errors on create gist index

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #15899: Valgrind detects errors on create gist index
Date: 2019-07-07 19:10:20
Message-ID: 15899-0d24fb273b3dd90c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15899
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 12beta2
Operating system: Ubuntu 18.04
Description:

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

I get several valgrind errors:
2019-07-07 22:01:02.957 MSK|law|regression|5d22416b.5a20|LOG: statement:
create index gist_pointidx2 on gist_point_tbl using gist(p) with (buffering
= on, fillfactor=50);
==00:00:00:12.567 23072== Conditional jump or move depends on uninitialised
value(s)
==00:00:00:12.567 23072== at 0x1F977B: gistAddLoadedBuffer
(gistbuildbuffers.c:205)
==00:00:00:12.567 23072== by 0x1F9E05: gistPushItupToNodeBuffer
(gistbuildbuffers.c:356)
==00:00:00:12.567 23072== by 0x1F89F2: gistProcessItup
(gistbuild.c:645)
==00:00:00:12.567 23072== by 0x1F8AE2: gistBufferingBuildInsert
(gistbuild.c:536)
==00:00:00:12.567 23072== by 0x1F9257: gistBuildCallback
(gistbuild.c:481)
==00:00:00:12.567 23072== by 0x21F0C9: heapam_index_build_range_scan
(heapam_handler.c:1664)
==00:00:00:12.567 23072== by 0x1F9476: table_index_build_scan
(tableam.h:1509)
==00:00:00:12.567 23072== by 0x1F9476: gistbuild (gistbuild.c:196)
==00:00:00:12.567 23072== by 0x29C4F7: index_build (index.c:2726)
==00:00:00:12.567 23072== by 0x29DC4B: index_create (index.c:1177)
==00:00:00:12.567 23072== by 0x3486DF: DefineIndex (indexcmds.c:1004)
==00:00:00:12.567 23072== by 0x529EA2: ProcessUtilitySlow
(utility.c:1366)
==00:00:00:12.567 23072== by 0x529456: standard_ProcessUtility
(utility.c:927)
==00:00:00:12.567 23072== Uninitialised value was created by a heap
allocation
==00:00:00:12.567 23072== at 0x67D391: MemoryContextAlloc (mcxt.c:801)
==00:00:00:12.567 23072== by 0x6594CE: DynaHashAlloc (dynahash.c:281)
==00:00:00:12.567 23072== by 0x65966F: element_alloc (dynahash.c:1673)
==00:00:00:12.567 23072== by 0x659792: get_hash_entry (dynahash.c:1282)
==00:00:00:12.567 23072== by 0x659FF0: hash_search_with_hash_value
(dynahash.c:1055)
==00:00:00:12.567 23072== by 0x65A1A4: hash_search (dynahash.c:911)
==00:00:00:12.567 23072== by 0x1F9C6C: gistGetNodeBuffer
(gistbuildbuffers.c:125)
==00:00:00:12.567 23072== by 0x1F89DF: gistProcessItup
(gistbuild.c:642)
==00:00:00:12.567 23072== by 0x1F8AE2: gistBufferingBuildInsert
(gistbuild.c:536)
==00:00:00:12.567 23072== by 0x1F9257: gistBuildCallback
(gistbuild.c:481)
==00:00:00:12.567 23072== by 0x21F0C9: heapam_index_build_range_scan
(heapam_handler.c:1664)
==00:00:00:12.567 23072== by 0x1F9476: table_index_build_scan
(tableam.h:1509)
==00:00:00:12.567 23072== by 0x1F9476: gistbuild (gistbuild.c:196)

...
==00:00:00:12.662 23072== Syscall param pwrite64(buf) points to
uninitialised byte(s)
==00:00:00:12.662 23072== at 0x5055014: pwrite (pwrite64.c:29)
==00:00:00:12.662 23072== by 0x4F1CC0: FileWrite (fd.c:1963)
==00:00:00:12.662 23072== by 0x4F3C83: BufFileDumpBuffer
(buffile.c:487)
==00:00:00:12.662 23072== by 0x4F4275: BufFileWrite (buffile.c:589)
==00:00:00:12.662 23072== by 0x1F9841: WriteTempFileBlock
(gistbuildbuffers.c:770)
==00:00:00:12.662 23072== by 0x1F9E2E: gistPushItupToNodeBuffer
(gistbuildbuffers.c:375)
==00:00:00:12.662 23072== by 0x1F89F2: gistProcessItup
(gistbuild.c:645)
==00:00:00:12.662 23072== by 0x1F8AE2: gistBufferingBuildInsert
(gistbuild.c:536)
==00:00:00:12.662 23072== by 0x1F9257: gistBuildCallback
(gistbuild.c:481)
==00:00:00:12.662 23072== by 0x21F0C9: heapam_index_build_range_scan
(heapam_handler.c:1664)
==00:00:00:12.662 23072== by 0x1F9476: table_index_build_scan
(tableam.h:1509)
==00:00:00:12.662 23072== by 0x1F9476: gistbuild (gistbuild.c:196)
==00:00:00:12.662 23072== by 0x29C4F7: index_build (index.c:2726)
==00:00:00:12.662 23072== Address 0xf8fa420 is 80 bytes inside a block of
size 8,264 client-defined
==00:00:00:12.662 23072== at 0x67DBD9: palloc (mcxt.c:949)
==00:00:00:12.662 23072== by 0x4F3A63: makeBufFileCommon
(buffile.c:111)
==00:00:00:12.662 23072== by 0x4F3AA9: makeBufFile (buffile.c:132)
==00:00:00:12.662 23072== by 0x4F3DF0: BufFileCreateTemp
(buffile.c:203)
==00:00:00:12.662 23072== by 0x1F9B4C: gistInitBuildBuffers
(gistbuildbuffers.c:61)
==00:00:00:12.662 23072== by 0x1F9117: gistInitBuffering
(gistbuild.c:409)
==00:00:00:12.662 23072== by 0x1F92A6: gistBuildCallback
(gistbuild.c:525)
==00:00:00:12.662 23072== by 0x21F0C9: heapam_index_build_range_scan
(heapam_handler.c:1664)
==00:00:00:12.662 23072== by 0x1F9476: table_index_build_scan
(tableam.h:1509)
==00:00:00:12.662 23072== by 0x1F9476: gistbuild (gistbuild.c:196)
==00:00:00:12.662 23072== by 0x29C4F7: index_build (index.c:2726)
==00:00:00:12.662 23072== by 0x29DC4B: index_create (index.c:1177)
==00:00:00:12.662 23072== by 0x3486DF: DefineIndex (indexcmds.c:1004)
==00:00:00:12.662 23072== Uninitialised value was created by a heap
allocation
==00:00:00:12.662 23072== at 0x67D391: MemoryContextAlloc (mcxt.c:801)
==00:00:00:12.662 23072== by 0x1F992D: gistAllocateNewPageBuffer
(gistbuildbuffers.c:189)
==00:00:00:12.663 23072== by 0x1F9DEF: gistPushItupToNodeBuffer
(gistbuildbuffers.c:354)
==00:00:00:12.663 23072== by 0x1F89F2: gistProcessItup
(gistbuild.c:645)
==00:00:00:12.663 23072== by 0x1F8AE2: gistBufferingBuildInsert
(gistbuild.c:536)
==00:00:00:12.663 23072== by 0x1F9257: gistBuildCallback
(gistbuild.c:481)
==00:00:00:12.663 23072== by 0x21F0C9: heapam_index_build_range_scan
(heapam_handler.c:1664)
==00:00:00:12.663 23072== by 0x1F9476: table_index_build_scan
(tableam.h:1509)
==00:00:00:12.663 23072== by 0x1F9476: gistbuild (gistbuild.c:196)
==00:00:00:12.663 23072== by 0x29C4F7: index_build (index.c:2726)
==00:00:00:12.663 23072== by 0x29DC4B: index_create (index.c:1177)
==00:00:00:12.663 23072== by 0x3486DF: DefineIndex (indexcmds.c:1004)
==00:00:00:12.663 23072== by 0x529EA2: ProcessUtilitySlow
(utility.c:1366)
...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2019-07-07 19:21:26 Re: BUG #15899: Valgrind detects errors on create gist index
Previous Message Tom Lane 2019-07-07 18:24:51 Re: VACUUM FULL results in ERROR: integer out of range