Re: BUG #15899: Valgrind detects errors on create gist index

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15899: Valgrind detects errors on create gist index
Date: 2019-07-07 19:21:26
Message-ID: 38f18230-e766-3a87-e3ad-fef6562c0c23@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> 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

Attachment Content-Type Size
gistbuildbuffers.patch text/x-patch 915 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Manuel Rigger 2019-07-07 22:42:24 Issue with CHAR column and "column LIKE column" condition
Previous Message PG Bug reporting form 2019-07-07 19:10:20 BUG #15899: Valgrind detects errors on create gist index