Re: BUG #14245: Segfault on weird to_tsquery - Mailing list pgsql-bugs

From David Kellum
Subject Re: BUG #14245: Segfault on weird to_tsquery
Date
Msg-id 1468350289.2574.6@smtp.gmail.com
Whole thread Raw
In response to Re: BUG #14245: Segfault on weird to_tsquery  (Peter Geoghegan <pg@heroku.com>)
List pgsql-bugs
On Tue, Jul 12, 2016 at 11:40 AM, Peter Geoghegan <pg@heroku.com> wrote:
> On Tue, Jul 12, 2016 at 10:58 AM,  <david@gravitext.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.

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #14245: Segfault on weird to_tsquery
Next
From: Tom Lane
Date:
Subject: Re: BUG #14245: Segfault on weird to_tsquery