Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGnKK-0008WQ-Al for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2014 10:27:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGnKJ-0004rq-Jh for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2014 10:27:27 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGnKH-0004rh-Uc for pgsql-hackers@postgresql.org; Fri, 21 Feb 2014 10:27:26 +0000 Received: from mail-ee0-x229.google.com ([2a00:1450:4013:c00::229]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGnKA-0000bk-9X for pgsql-hackers@postgresql.org; Fri, 21 Feb 2014 10:27:25 +0000 Received: by mail-ee0-f41.google.com with SMTP id e49so1522308eek.0 for ; Fri, 21 Feb 2014 02:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Dp/xDLjHEa2WK/NhQdh4TLkI3eQd+setG7YzYFfbJ0Y=; b=n8/KJ4keCHQHWfg48xCnoo2tWmvnucvN5XdxQmvPBcMIkVeZYzr77ESAdSGjh0WArB VTIQKEv5i57ulRwdqvHt/S+J/5KEiYdGeczYTYoy2bQEzQnpQrKXiXrtl+Ik7gGhVoUR XWYnmi4TbRJvGPxMIB6vHLCWEB+nGpVY/rm5oCDH9uAIpP14QlIgkm8JR/vKJIEg/D3b LlpokTBYUk4CHisxGJZqjLZPFPK2XvJuiWxTVpdzkPHAabmODfD/YydLidpEeyP4VHtl V+tG8Wym0YB2g+QHyJpg4UyF+X43vU/G+OZqbkLamjETz7ind7a8OW3G+l5mM5+VXD/l 6n0g== X-Received: by 10.14.47.133 with SMTP id t5mr7545363eeb.96.1392978436800; Fri, 21 Feb 2014 02:27:16 -0800 (PST) Received: from localhost (ip-46-232-148-34.static.adsl.cheapnet.it. [46.232.148.34]) by mx.google.com with ESMTPSA id 43sm23131384eeh.13.2014.02.21.02.27.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 02:27:16 -0800 (PST) Date: Fri, 21 Feb 2014 11:27:13 +0100 From: Sandro Santilli To: pgsql-hackers@postgresql.org Subject: Re: Uninterruptable regexp_replace in 9.3.1 ? Message-ID: <20140221102713.GN6924@localhost> Mail-Followup-To: pgsql-hackers@postgresql.org References: <20140221091759.GK6924@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140221091759.GK6924@localhost> User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I've just tested 9.3.3 and it is _also_ affected. Should I report the regression somewhere else ? --strk; On Fri, Feb 21, 2014 at 10:17:59AM +0100, Sandro Santilli wrote: > The following snippet reveals that 9.3.1 has a bug > in regexp_matches, which uninterruptably keeps CPU > spinning for minutes: > > -----8<--------------------------------------------------- > > \timing > SET statement_timeout = 2; > -- this is only to show statement_timeout is effective here > SELECT count(*) from generate_series(1, 100000); > -- this one is uninterruptable! > SELECT regexp_matches($INPUT$ > > > > > > > > > /a > $b$ > $c$d > ; > $INPUT$, > $REG$((?:[^'"$;]+|"[^"]*"|'(?:[^']*|'')*'|(\$[^$]*\$).*?\2)+)$REG$, 'g' ); > > -----8<--------------------------------------------------- > > The above has been tested to be harmless with PostgreSQL 9.1.11 > in that the regexp_matches call is interrupted, but it is NOT > with PostgreSQL 9.3.1. > > Is it a known bug ? > > Please include my address in replies as I don't get notified > of list activity. Thanks. > > --strk; > > ()  ASCII ribbon campaign -- Keep it simple ! > /\  http://strk.keybit.net/rants/ascii_mails.txt -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers