Re: [9.2] crash on regex

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [9.2] crash on regex
Date: 2012-05-24 16:08:57
Message-ID: 21796.1337875737@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, May 24, 2012 at 10:16 AM, Marko Kreen <markokr(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-05-24 16:35:06 Re: "could not open relation with OID" errors after promoting the standby to master
Previous Message Kohei KaiGai 2012-05-24 16:00:33 Re: [RFC] Interface of Row Level Security