Re: Regex with > 32k different chars causes a backend crash

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regex with > 32k different chars causes a backend crash
Date: 2013-04-03 15:24:26
Message-ID: 515C49AA.7070709@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.04.2013 18:21, Tom Lane wrote:
> Heikki Linnakangas<hlinnakangas(at)vmware(dot)com> writes:
>> A regex with that many different colors is an extreme case, so I think
>> it's enough to turn the assertion in newcolor() into a run-time check,
>> and throw a "too many colors in regexp" error. Alternatively, we could
>> expand 'color' from short to int, but that would double the memory usage
>> of sane regexps with less different characters.
>
> Obviously Henry didn't think that far ahead. I agree that throwing
> an error is the best solution, and that widening "color" is probably
> not what we want to do. You want to fix that, or shall I?

I can do it. I assume that Tcl has the same bug, so I'll submit a report
there, too.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rodrigo Barboza 2013-04-03 15:26:05 c language functions
Previous Message Tom Lane 2013-04-03 15:21:27 Re: Regex with > 32k different chars causes a backend crash