Re: BUG #15899: Valgrind detects errors on create gist index
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Date: 2019-07-07T19:21:26Z
Lists: pgsql-bugs
Attachments
- gistbuildbuffers.patch (text/x-patch) patch
> 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.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) The attached patch eliminates these errors (but maybe MemoryContextAllocZero is too superficial). Best regards, Alexander
Commits
-
Fix variable initialization when using buffering build with GiST
- 7b60468fa14a 9.4.24 landed
- b9e1538fcf35 9.5.19 landed
- 6365f3ca24b8 9.6.15 landed
- 4fea3434939d 10.10 landed
- 1cde7fe84a47 11.5 landed
- 4d713595914b 12.0 landed
- fa19a08d71fb 13.0 landed