Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Aleksander Alekseev <aleksander(at)timescale(dot)com>, dhyan(at)nataraj(dot)su
Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Date: 2024-11-16 16:02:58
Message-ID: 2745175.1731772978@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alexander Lakhin <exclusion(at)gmail(dot)com> writes:
> Please look at the hornet's failure on processing a test query added here:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hornet&dt=2024-11-15%2023%3A49%3A38

Hmm... for the archives' sake, that looks like

select * from test_regex('[^\\d\\D]', '0123456789abc*', 'ILPE');
- test_regex
- --------------------------------------------------------
- {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE,REG_UIMPOSSIBLE}
- (1 row)
-
+ ERROR: invalid regular expression: out of memory
-- check char classes' handling of newlines

I'm not sure what to make of it. That regex shouldn't consume very
much memory. To confirm that, I stepped through it and found that
newstate() is reached 14 times and newarc() 35 times. That's a
pretty tiny amount of memory, and there are other regexps in the
tests that are far larger.

Moreover, no other animal has shown this, including hornet itself
on the v16 branch. (It's only run this test in v15 and v16 so far,
so that's not a lot of data points.)

I'm inclined to guess this was some weird momentary glitch. If it
reproduces then I'll look closer.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2024-11-16 18:34:59 Re: Today's Postgres Releases break login roles
Previous Message Tom Lane 2024-11-16 15:45:46 Re: Today's Postgres Releases break login roles