Re: Stack overflow issue
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Егор Чиндяскин <kyzevan23@mail.ru>, Richard Guo <guofenglinux@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, mahendrakar s <mahendrakarforpg@gmail.com>
Date: 2022-08-30T22:57:06Z
Lists: pgsql-hackers
Attachments
- limit-length-of-strings-passed-to-snowball-2.patch (text/x-diff) patch
I wrote: > The upstream recommendation, which seems pretty sane to me, is to > simply reject any string exceeding some threshold length as not > possibly being a word. Apparently it's common to use thresholds > as small as 64 bytes, but in the attached I used 1000 bytes. On further thought: that coding treats anything longer than 1000 bytes as a stopword, but maybe we should just accept it unmodified. The manual says "A Snowball dictionary recognizes everything, whether or not it is able to simplify the word". While "recognizes" formally includes the case of "recognizes as a stopword", people might find this behavior surprising. We could alternatively do it as attached, which accepts overlength words but does nothing to them except case-fold. This is closer to the pre-patch behavior, but gives up the opportunity to avoid useless downstream processing of long words. regards, tom lane
Commits
-
Refactoring for CommitTransactionCommand()/AbortCurrentTransaction()
- 40126ac68f2f 17.0 landed
-
Avoid recursion in MemoryContext functions
- 4c1973fcaecd 17.0 landed
-
Avoid stack overflow in ShowTransactionStateRec()
- 6f38c43eb135 17.0 landed
-
Turn tail recursion into iteration in CommitTransactionCommand()
- fefd9a3fed27 17.0 landed
-
Adjust memory allocation functions to allow sibling calls
- 743112a2e993 17.0 cited
-
Add missing check_stack_depth() to some recursive functions
- d57b7cc3338e 17.0 landed
-
In the Snowball dictionary, don't try to stem excessively-long words.
- f5aa855cd8a6 11.18 landed
- f204ad3a2b19 13.9 landed
- e969f1ae2b01 14.6 landed
- cba393a10af8 10.23 landed
- a53e0ea782c5 12.13 landed
- 61f6e5c23603 15.0 landed
- 1058555a5ecc 16.0 landed
-
Defend against stack overrun in a few more places.
- f25bed3801e1 16.0 landed
- 3d3c05c70fc7 15.0 landed
- f5157a9acc9d 10.23 landed
- 599a487b093a 12.13 landed
- 444ec169a7de 14.6 landed
- 310d734efb3b 11.18 landed
- 2d1f1523ce83 13.9 landed