Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Date: 2023-08-13T13:00:01Z
Lists: pgsql-bugs
Attachments
- v1-01-fix-gtsvector_picksplit.patch (text/x-patch) patch v1
- v1-02-fix-gtsvectorout.patch (text/x-patch) patch v1
- v1-03-test-for-tsgistidx.patch (text/x-patch) patch v1
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
Commits
-
Improve description of keys in tsvector
- aa0d3504560d 17.0 landed
-
Fix out-of-bound read in gtsvector_picksplit()
- 358cd2b25109 11.22 landed
- 40ddb8db9f2c 12.17 landed
- 82fa8ae5f9ac 13.13 landed
- df11421d8242 14.10 landed
- 88aa4a049aca 15.5 landed
- fac3fa0d5b21 16.0 landed
- ae10dbb0c5e0 17.0 landed