Re: CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-11-02 Thread Artur Zakirov
On Sun, Nov 3, 2019 at 5:48 AM Tom Lane wrote: > > Arthur Zakirov writes: > > On 2019/10/13 10:26, Tomas Vondra wrote: > >> So I think we need some sort of cross-check here. We certainly need to > >> make NISortDictionary() check the affix value is within AffixData > >> bounds, and error out when

Re: CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-11-02 Thread Tom Lane
Arthur Zakirov writes: > On 2019/10/13 10:26, Tomas Vondra wrote: >> So I think we need some sort of cross-check here. We certainly need to >> make NISortDictionary() check the affix value is within AffixData >> bounds, and error out when the index is non-sensical (maybe negative >> and/or exceedi

Re: CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-10-27 Thread Arthur Zakirov
Hello Tomas, On 2019/10/13 10:26, Tomas Vondra wrote: over in pgsql-bugs [1] we got a report about CREATE TEXT SEARCH DICTIONARY causing segfaults on 12.0. Simply running    CREATE TEXT SEARCH DICTIONARY hunspell_num (Template=ispell,    DictFile=hunspell_sample_num, AffFile=hunspell_sample_l

Re: CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-10-14 Thread Tomas Vondra
I spent a bit of time investigating this, and it seems the new code is somewhat too trusting when it comes to data from the affix/dict files. In this particular case, it boils down to this code in NISortDictionary: if (Conf->useFlagAliases) { for (i = 0; i < Conf->nspell; i++)

CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-10-12 Thread Tomas Vondra
Hi, over in pgsql-bugs [1] we got a report about CREATE TEXT SEARCH DICTIONARY causing segfaults on 12.0. Simply running CREATE TEXT SEARCH DICTIONARY hunspell_num (Template=ispell, DictFile=hunspell_sample_num, AffFile=hunspell_sample_long); does trigger a crash, 100% of the time. The cr