Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
Date: 2023-08-13 13:00:01
Message-ID: e2f36991-0519-bfcf-1da9-c31ca645b4ec@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

17.06.2023 17:00, Alexander Lakhin wrote:
> 29.05.2023 23:00, PG Bug reporting form wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference:      17950
>
> I managed to reduce the reproducer to the following:
> CREATE TABLE tst(t tsvector);
> INSERT INTO tst SELECT array_to_string(array(SELECT 'a' || x::text FROM generate_series(1, 125) x), ' ')::tsvector
> FROM generate_series(1, 3000);
> INSERT INTO tst SELECT '' FROM generate_series(1, 100);
> CREATE INDEX gistidx ON tst USING gist (t tsvector_ops(siglen=1));
>
>
> A trivial fix for the issue is attached.
>

I can also propose a regression test addition that demonstrates the valgrind
complaint and also the output of gtsvectorout() for the case ISALLTRUE and
the opposite.

This addition increases the duration of `make check -C contrib/pageinspect`
under valgrind by 7-8 seconds for me:
ok 5         - gist                                     2496 ms
->
ok 5         - gist                                     9890 ms

In absence of any objections or other propositions, I'm inclined to register
this bugfix on the commitfest.

Best regards,
Alexander

Attachment Content-Type Size
v1-01-fix-gtsvector_picksplit.patch text/x-patch 718 bytes
v1-02-fix-gtsvectorout.patch text/x-patch 836 bytes
v1-03-test-for-tsgistidx.patch text/x-patch 2.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-08-13 14:35:43 Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
Previous Message Sandeep Thakkar 2023-08-13 09:38:47 Re: BUG #18040: PostgreSQL does not report its version correctly