pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sandro Santilli <strk@keybit.net>
To: pgsql-hackers@postgresql.org
Subject: Re: Uninterruptable regexp_replace in 9.3.1 ?
Date: Fri, 21 Feb 2014 11:27:13 +0100
Message-ID: <20140221102713.GN6924@localhost> (raw)
In-Reply-To: <20140221091759.GK6924@localhost>
References: <20140221091759.GK6924@localhost>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (9+ messages)  latest in thread

Message-ID: <20140221102713.GN6924@localhost>
Permalink:  ../20140221102713.GN6924@localhost/
Also on:    postgresql.org/message-id/20140221102713.GN6924@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: strk@keybit.net, pgsql-hackers@postgresql.org
  Subject: Re: Uninterruptable regexp_replace in 9.3.1 ?
  In-Reply-To: <20140221102713.GN6924@localhost>
  References: <20140221091759.GK6924@localhost> <20140221102713.GN6924@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox