Re: BUG #17950: Incorrect memory access in gtsvector_picksplit() - Mailing list pgsql-bugs

From Alexander Lakhin
Subject Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
Date
Msg-id e2f36991-0519-bfcf-1da9-c31ca645b4ec@gmail.com
Whole thread Raw
In response to Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
List 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

pgsql-bugs by date:

Previous
From: Sandeep Thakkar
Date:
Subject: Re: BUG #18040: PostgreSQL does not report its version correctly
Next
From: Tom Lane
Date:
Subject: Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()