Re: Uninterruptable regexp_replace in 9.3.1 ? - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Uninterruptable regexp_replace in 9.3.1 ?
Date
Msg-id 530774E5.5040105@2ndquadrant.com
Whole thread Raw
In response to Uninterruptable regexp_replace in 9.3.1 ?  (Sandro Santilli <strk@keybit.net>)
Responses Re: Uninterruptable regexp_replace in 9.3.1 ?  (Florian Pflug <fgp@phlo.org>)
List pgsql-hackers
On 02/21/2014 05:17 PM, Sandro Santilli wrote:
> The following snippet reveals that 9.3.1 has a bug
> in regexp_matches, which uninterruptably keeps CPU
> spinning for minutes:

Huh. So it does. That's interesting.

(You should generally report things to pgsql-bugs@postgresql.org btw,
not -hackers)

Looks like it's busily looping within the regex.c code, never hitting a
CHECK_FOR_INTERRUPTS.

The real question IMO is why it's taking so long. It looks like
cfindloop(...) is being called multiple times, with each call taking a
couple of seconds.

A profile of the run is attached. I don't expect to have a chance to dig
into this right away, as I haven't touched the regexp code before and
would need to spend a bit of time studying it to achieve anything.
Hopefully the test, confirmation, and profile is useful.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Storing the password in .pgpass file in an encrypted format
Next
From: Christopher Browne
Date:
Subject: Re: Storing the password in .pgpass file in an encrypted format