Re: BUG #16329: Valgrind detects an invalid read when building a gistindex with buffering

Поиск
Список
Период
Сортировка
От Alexander Lakhin
Тема Re: BUG #16329: Valgrind detects an invalid read when building a gistindex with buffering
Дата
Msg-id ca1f896b-e5d1-53a7-5bc3-9451ab9aca22@gmail.com
обсуждение исходный текст
Ответ на BUG #16329: Valgrind detects an invalid read when building a gist index with buffering  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16329: Valgrind detects an invalid read when building a gistindex with buffering  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-bugs
30.03.2020 00:00, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference:      16329
> Logged by:          Alexander Lakhin
> Email address:      exclusion@gmail.com
> 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)
I've found that the memory context where the itup is created:
    oldCtx = MemoryContextSwitchTo(buildstate->giststate->tempCxt);

    /* form an index tuple and point it at the heap tuple */
    itup = gistFormTuple(buildstate->giststate, index, values, isnull,
true);

can be reset in gistBufferingBuildInsert->gistProcessEmptyingQueue:
            /* Free all the memory allocated during index tuple
processing */
            MemoryContextReset(buildstate->giststate->tempCxt);

Probably, the offending commit is d22a09dc.




В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16330: psql accesses null pointer in connect.c:do_connect
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #16330: psql accesses null pointer in connect.c:do_connect