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

From PG Bug reporting form
Subject BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Date
Msg-id 18708-f94f2599c9d2c005@postgresql.org
Whole thread Raw
Responses Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18708
Logged by:          Nikolay Shaplov (PostgresPro)
Email address:      dhyan@nataraj.su
PostgreSQL version: 16.4
Operating system:   Debian 12
Description:

Hi! 

We've found a bug: 

If you run 

SELECT '' ~ '(?:[^\d\D]){0}'; 

it will assert with  "lp->nouts == 0 && rp->nins == 0"

This behavior have been introduced in 2a0af7fe460 commit.

This bug have been found while fuzzing jsonpath_in function, and then
narrowed down to regex problem. Thanks to Andrey Bille for help with
narrowing sample down and finding commit that caused the problem.


pgsql-bugs by date:

Previous
From: Chirag Patel
Date:
Subject: Export PostgreSQL database into mysql database
Next
From: [3반]김민지_4904
Date:
Subject: Sorting Discrepancy in PostgreSQL 14.13