Re: Coredump with text search dictionary

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Coredump with text search dictionary
Date: 2022-08-09 04:52:51
Message-ID: 774952.1660020771@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Japin Li <japinli(at)hotmail(dot)com> writes:
> When attempting use text search, here is a core dump
> (reported from my friend, Song Jinzhou).

> CREATE TEXT SEARCH TEMPLATE public.my_ts_template (
> init = varchar_support,
> lexize = dispell_lexize
> );

> CREATE TEXT SEARCH DICTIONARY public.my_ts_dict (
> template = public.my_ts_template
> );

There's a reason why CREATE TEXT SEARCH TEMPLATE is superuser-only:
it's on you to supply valid parameters. varchar_support is a
completely inappropriate choice for a TS template init function.
The proposed patch doesn't add any meaningful amount of safety
(just add some options to the dictionary, and it'll still crash).
Moreover, the patch breaks init functions that would, say, want
to insist that option X be provided.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-08-09 05:15:00 Re: BUG #17508: ja.po for pg_ctl has an obvious mistake
Previous Message Japin Li 2022-08-09 04:30:59 Coredump with text search dictionary