Re: [9.2] crash on regex - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [9.2] crash on regex
Date
Msg-id 21796.1337875737@sss.pgh.pa.us
Whole thread Raw
In response to Re: [9.2] crash on regex  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, May 24, 2012 at 10:16 AM, Marko Kreen <markokr@gmail.com> wrote:
>> Following query crashes backend on 9.2:
>> 
>> �select substring('asd TO foo' from ' TO (([a-z0-9._]+|"([^"]+|"")+")+)');

> I spent some time trying to reduce this to the simplest case that
> still causes a crash, and came up with this:

> select substring('a' from '((a))+');

Yeah, I'm looking at it.  Looks like I broke memory management somewhere
in the quantifier revisions --- it seems to be stomping the stack during
cleanup at the end of pg_regexec.  Possibly a multiple-free deal?
Haven't quite found it yet.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: [RFC] Interface of Row Level Security
Next
From: Heikki Linnakangas
Date:
Subject: Re: "could not open relation with OID" errors after promoting the standby to master