Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCLGR-00GmBb-Fe for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Nov 2024 16:03:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tCLGO-00EsBy-Bh for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Nov 2024 16:03:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCLGO-00EsBp-3H for pgsql-bugs@lists.postgresql.org; Sat, 16 Nov 2024 16:03:08 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCLGG-002HO9-NX for pgsql-bugs@lists.postgresql.org; Sat, 16 Nov 2024 16:03:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4AGG2w8B2745176; Sat, 16 Nov 2024 11:02:58 -0500 From: Tom Lane To: Alexander Lakhin cc: pgsql-bugs@lists.postgresql.org, Aleksander Alekseev , dhyan@nataraj.su Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0" In-reply-to: <661fd81b-f069-8f30-1a41-e195c57449b4@gmail.com> References: <18708-f94f2599c9d2c005@postgresql.org> <2242483.1731627374@sss.pgh.pa.us> <2344149.1731636867@sss.pgh.pa.us> <2631851.1731715737@sss.pgh.pa.us> <661fd81b-f069-8f30-1a41-e195c57449b4@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Sat, 16 Nov 2024 14:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2745174.1731772978.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 16 Nov 2024 11:02:58 -0500 Message-ID: <2745175.1731772978@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > Please look at the hornet's failure on processing a test query added her= e: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dhornet&dt=3D20= 24-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