Re: BUG #14245: Segfault on weird to_tsquery

From: David Kellum <david(at)gravitext(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14245: Segfault on weird to_tsquery
Date: 2016-07-12 19:04:49
Message-ID: 1468350289.2574.6@smtp.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Tue, Jul 12, 2016 at 11:40 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Tue, Jul 12, 2016 at 10:58 AM, <david(at)gravitext(dot)com> wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference: 14245
>>
>> I am doing some (fuzz) testing of full text queries and managed to
>> generate the following case which causes a SEGFAULT on PostgreSQL
>> 9.6
>> beta1 and beta2:
>>
>> select to_tsquery('!(a & !b) & c') as tsquery
>
> Interesting discovery. How did you fuzz test?

Motivated by the new phrase search support in 9.6, I'm working on a
query language which is lenient to any user input when parsed and can
be transformed and output to PG tsquery syntax. The fuzz testing is by
randomly permuted fragments in the custom query language. Using this,
I found and fixed a bunch of issues in my own parser, and identified
lots of characters to treat as whitespace and filter before output to
tsquery, before stumbling on this Postgres crash.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-07-12 19:42:25 Re: BUG #14245: Segfault on weird to_tsquery
Previous Message Peter Geoghegan 2016-07-12 19:01:02 Re: BUG #14245: Segfault on weird to_tsquery

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-07-12 19:24:01 Re: GiST index build versus NaN coordinates
Previous Message Peter Geoghegan 2016-07-12 19:01:02 Re: BUG #14245: Segfault on weird to_tsquery