Re: Death by regexp_replace - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Death by regexp_replace
Date
Msg-id CA+TgmoZG54upWdxL2zTog0seQXiqpxRYOAskZcadezTu+21zyA@mail.gmail.com
Whole thread Raw
In response to Death by regexp_replace  (Benedikt Grundmann <bgrundmann@janestreet.com>)
Responses Re: Death by regexp_replace  (Jan de Visser <jan@de-visser.net>)
List pgsql-hackers
On Fri, Jan 15, 2016 at 10:12 AM, Benedikt Grundmann
<bgrundmann@janestreet.com> wrote:
> Today we discovered that we had a backend whose client had gone away, the
> automatic query watching process had send both pg_cancel and
> pg_terminate_backend but nevertheless the process was sitting there
> consuming resources and had been for over 1 day...
>
> gdb revealed that we were sitting in pg_regexec  (we forced it to return 16
> aka invalid regex to return our system into a good state).
>
> Here is the regular expression and the text to run on:
>
> WARNING DO NOT DO THIS ON A PRODUCTION BOX
>
> select regexp_replace('VODI GR,VOD LN,VOD LN,VODN MM,VODPF US,VOD US,VZC
> LN', '([^,]+)(,*\1)+', '\1');
>
> This was in postgres 9.2

9.2.what?  Tom just fixed a whole bunch of bugs in this area, so if
you're running less than 9.2.14, please test whether this can be
reproduced with that version.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Truncating/vacuuming relations on full tablespaces
Next
From: Jan de Visser
Date:
Subject: Re: Death by regexp_replace