Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2mtk-0003Dr-L5 for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Jan 2014 19:10:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W2mtk-0006py-3Y for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Jan 2014 19:10:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2kCZ-0004iQ-H7 for pgsql-bugs@postgresql.org; Mon, 13 Jan 2014 16:17:23 +0000 Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2kCW-0008G9-Fn for pgsql-bugs@postgresql.org; Mon, 13 Jan 2014 16:17:22 +0000 Received: by mail-ea0-f181.google.com with SMTP id m10so3452872eaj.40 for ; Mon, 13 Jan 2014 08:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paralaus.com; s=google; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=JCsqIZImVXqYVSwkrr629GOyDVSVbavXoQBYuuYzGdo=; b=R9k9XVzz12LPPcPCz383ncP9jLs52w2dLQn3Va+PBRFfg1NKoJzdimvA0xHODIKWMo aBj0NM9jWH5llsp6cs1UXDyKW+qS1MhAWMGXe8Hc5BTIX1Ky9+AyLwtG073w59qGxm/N GnfDWa8LXiVog5LawYRv9yNhpftScPibX6e8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version:content-type; bh=JCsqIZImVXqYVSwkrr629GOyDVSVbavXoQBYuuYzGdo=; b=MfU+gPJemuX243umam1uyy8n3ig5Pp0O0eSu8u1M8F0XUhS5RnSZzVbOYUoms8aNEj CJgktRzCBDVy7J28GujTQnNrrHaVOARP3TS+/NXfSqX3A4pE8J1O/p+Gl3nvpxa7FHLH 2odWH0FGEkgFXYhebuRaKMKCYQAThRDqG8+5AY5Ip1okiOonwCKAKhZk4COnPeLjbnu+ WgCYMdVAygC1yAnRZU21Ndz8jcVcHTOzfMW5fUaLMjyO1ygPhOH8QjgCULB06lLXpuXS OYlJWrbTsCRv0+diWNFicoeEd2MwC7WVMU8zh6PGfuIfKgNCVK945K5N7kb+PptWD3Po ea0g== X-Gm-Message-State: ALoCoQnrnxRCQUq+q2R8l6gQ6NRYDVc10ULSMcb0LfKXpnRNIJiqU+bivGlqGmbLz8Ihofr/MhyI X-Received: by 10.14.179.130 with SMTP id h2mr29167682eem.34.1389629838980; Mon, 13 Jan 2014 08:17:18 -0800 (PST) Received: from Ufuk-MBA-2.local ([78.188.173.206]) by mx.google.com with ESMTPSA id 7sm41031236eee.12.2014.01.13.08.17.16 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Jan 2014 08:17:18 -0800 (PST) Date: Mon, 13 Jan 2014 18:17:13 +0200 From: Ufuk Kayserilioglu To: Tom Lane Cc: pgsql-bugs@postgresql.org Message-ID: In-Reply-To: <10064.1389629385@sss.pgh.pa.us> References: <20140113125641.30125.40578@wrigleys.postgresql.org> <10064.1389629385@sss.pgh.pa.us> Subject: Re: BUG #8821: pg_trgm segfault with Turkish locale database X-Mailer: Airmail (223) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="52d41189_68ebc550_c82f" X-Pg-Spam-Score: -2.0 (--) 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 --52d41189_68ebc550_c82f Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Tom, Thanks for the quick response. Just a quick followup note though; running= : SELECT show=5Ftrgm(maker) =46ROM car=5Fmakers; behaves properly, but trying to make a similarity comparison triggers the= segfault (at least in my case). That's why I suspect there may be 2 rela= ted bugs, one related trigram generation and, maybe, one related to trigr= am comparison. Hope this info will help you as well. Regards, -- Ufuk Kayserilioglu =46rom:=C2=A0Tom Lane Tom Lane Reply:=C2=A0Tom Lane tgl=40sss.pgh.pa.us Date:=C2=A013 January 2014 at 18:09:46 To:=C2=A0ufuk=40paralaus.com ufuk=40paralaus.com Subject:=C2=A0 Re: =5BBUGS=5D BUG =238821: pg=5Ftrgm segfault with Turkis= h locale database =20 ufuk=40paralaus.com writes: =20 > Given a database with encoding UT=46-8, locale tr=5FTR.UT=46-8, 'pg=5Ft= rgm' =20 > extension enabled, and the following setup: =20 > CREATE TABLE car=5Fmakers (maker TEXT); =20 > INSERT INTO car=5Fmakers VALUES ('AUDI'), ('MINI'); =20 > Run any one of the following commands: =20 > - SELECT maker <-> 'MAZDA' =46ROM car=5Fmakers; =20 > - SELECT similarity(maker, 'MAZDA') =46ROM car=5Fmakers; =20 > - SELECT show=5Ftrgm('III'); =20 > As a result, it seems there is a problem with trigrams generation and/o= r =20 > comparison when the Turkish locale is being used. =20 It looks like generate=5Ftrgm() is not considering the possibility that =20 case-folding will make the string physically longer, so you get a buffer = =20 overrun when any of these I-containing strings are converted to trigrams.= =20 Will fix, thanks for the report=21 =20 regards, tom lane =20 --52d41189_68ebc550_c82f Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline