Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2k5G-0004cH-Ok for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Jan 2014 16:09:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W2k5G-0003E9-9A for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Jan 2014 16:09:50 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2k5F-0003E3-GH for pgsql-bugs@postgresql.org; Mon, 13 Jan 2014 16:09:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2k5D-00085b-16 for pgsql-bugs@postgresql.org; Mon, 13 Jan 2014 16:09:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s0DG9jWD010065; Mon, 13 Jan 2014 11:09:45 -0500 From: Tom Lane To: ufuk@paralaus.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8821: pg_trgm segfault with Turkish locale database In-reply-to: <20140113125641.30125.40578@wrigleys.postgresql.org> References: <20140113125641.30125.40578@wrigleys.postgresql.org> Comments: In-reply-to ufuk@paralaus.com message dated "Mon, 13 Jan 2014 12:56:41 +0000" Date: Mon, 13 Jan 2014 11:09:45 -0500 Message-ID: <10064.1389629385@sss.pgh.pa.us> 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 ufuk@paralaus.com writes: > Given a database with encoding UTF-8, locale tr_TR.UTF-8, 'pg_trgm' > extension enabled, and the following setup: > CREATE TABLE car_makers (maker TEXT); > INSERT INTO car_makers VALUES ('AUDI'), ('MINI'); > Run any one of the following commands: > - SELECT maker <-> 'MAZDA' FROM car_makers; > - SELECT similarity(maker, 'MAZDA') FROM car_makers; > - SELECT show_trgm('III'); > As a result, it seems there is a problem with trigrams generation and/or > comparison when the Turkish locale is being used. It looks like generate_trgm() is not considering the possibility that case-folding will make the string physically longer, so you get a buffer overrun when any of these I-containing strings are converted to trigrams. Will fix, thanks for the report! regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs