Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bN3He-0003uf-WF for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Jul 2016 19:23:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bN3He-00063z-FN for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Jul 2016 19:23:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bN2zI-0001Iw-Fe for pgsql-bugs@postgresql.org; Tue, 12 Jul 2016 19:04:56 +0000 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bN2zF-0000h0-3H for pgsql-bugs@postgresql.org; Tue, 12 Jul 2016 19:04:55 +0000 Received: by mail-pf0-x22f.google.com with SMTP id t190so9709325pfb.3 for ; Tue, 12 Jul 2016 12:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gravitext-com.20150623.gappssmtp.com; s=20150623; h=date:from:subject:to:message-id:in-reply-to:references:mime-version; bh=NFwXHZ9haWhfV4jkeKPNc8QLMPZ7cglf9hrhDCfpO6U=; b=FPVtIU56/+T5q8g2iEBWzncQHQfUPkJj+P/U1u5CB5AmD5Efq5J7/kQxeni8tn1y1F 3BfhzeNC+2MgW5ryN9HiYgSJetQLzIR/NhwxyhnBGiADxwcKVl7fh/51iKY35Nny7hGz eCBHta114isnc3u0Wut5X4NFLVF55k9aAkKSsMGOgswTV9NfWNzF21tgcqzHeTdWX5Bf c6EuuMVWKwNlX98079GaJwb/f7R4n1G3RXM3Ctw6rdedpompgPj+v5f+HXQzPw5qkVUU KB08sBf31rtLYW2t+nrrp1tGXfwJCe1HVWM01Ng/o8BQ9aj4TiOBNBWrxSHhFQrKtpMS vcAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:subject:to:message-id:in-reply-to :references:mime-version; bh=NFwXHZ9haWhfV4jkeKPNc8QLMPZ7cglf9hrhDCfpO6U=; b=h5QX3eSIZiXpYaG8LhOOja9mENiDRlmwdoojlvnQfKQO7UuCOghoEacd6WkI9L6XbW xPPxfR7iFPTcXUX5dupHQaUQ1jQ3xKVAfYU2FQzFl9LM0zMmIL4IpcwIImXg2oPj1ekg A/YSinpkxFoHsYAIC0a+AEiKXTD6jjggG9bX01P+Ot/aU2N4QR9hKY0NfZ86OQbGutdN gHS09y+V9gUhfQU9pNrZmOY+YEIXumRCaVZBaJ9i/oQ2PypN8o48GyxQzSKxVQw18MSB x2YJGYR3NNkDXgF8bMzwI/qjG4Y6CGKBPCKCdSFrrt45Ob4H68zSKYNjEh79edR3snuN wDyg== X-Gm-Message-State: ALyK8tJ4qpDJiE6Ir35Lal3beBqCW03mhpo8BrnxbpSk8NlzEb3XD3FY/qcWc/UeaKmn7g== X-Received: by 10.98.134.77 with SMTP id x74mr14151665pfd.21.1468350290652; Tue, 12 Jul 2016 12:04:50 -0700 (PDT) Received: from [10.5.18.45] ([64.125.192.130]) by smtp.gmail.com with ESMTPSA id w8sm12864paz.32.2016.07.12.12.04.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Jul 2016 12:04:50 -0700 (PDT) Date: Tue, 12 Jul 2016 12:04:49 -0700 From: David Kellum Subject: Re: BUG #14245: Segfault on weird to_tsquery To: pgsql-bugs Message-Id: <1468350289.2574.6@smtp.gmail.com> In-Reply-To: References: <20160712175855.1414.10498@wrigleys.postgresql.org> X-Mailer: geary/0.11.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-R6YMWM8mptp0jKHF7/qe" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --=-R6YMWM8mptp0jKHF7/qe Content-Type: text/plain; charset=utf-8; format=flowed On Tue, Jul 12, 2016 at 11:40 AM, Peter Geoghegan wrote: > On Tue, Jul 12, 2016 at 10:58 AM, 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. --=-R6YMWM8mptp0jKHF7/qe Content-Type: text/html; charset=utf-8 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.



--=-R6YMWM8mptp0jKHF7/qe--