Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org,
Aleksander Alekseev <aleksander@timescale.com>, dhyan@nataraj.su
Date: 2024-11-16T16:02:58Z
Lists: pgsql-bugs
Alexander Lakhin <exclusion@gmail.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
Commits
-
Fix recently-exposed portability issue in regex optimization.
- df1a2633b11a 14.15 landed
- adb6dbc7f535 13.18 landed
- 6ab39c02747c 15.10 landed
-
Avoid assertion due to disconnected NFA sub-graphs in regex parsing.
- b69bdcee9c9c 18.0 landed
- b6312becc819 16.6 landed
- 5f28e6ba7fe1 17.2 landed
- 2bdd3b248924 14.15 landed
- 2496c3f6f1bf 15.10 landed
-
Fix recovery conflict SIGUSR1 handling.
- 0da096d78e1e 17.0 cited
-
Redesign interrupt/cancel API for regex engine.
- db4f21e4a34b 16.0 cited
-
Use MemoryContext API for regex memory management.
- bea3d7e3831f 16.0 cited
-
Invent "rainbow" arcs within the regex engine.
- 08c0d6ad65f7 14.0 cited