Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBk8z-0007Xa-My for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Aug 2021 20:39:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mBk8x-00011d-Iv for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Aug 2021 20:39:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBk8w-00011V-U6 for pgsql-hackers@lists.postgresql.org; Thu, 05 Aug 2021 20:39:07 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mBk8s-0007pm-PG for pgsql-hackers@postgresql.org; Thu, 05 Aug 2021 20:39:05 +0000 Received: by mail-pj1-x102b.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so17821897pjr.1 for ; Thu, 05 Aug 2021 13:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=from:content-transfer-encoding:mime-version:subject:message-id:date :cc:to; bh=6FSvZDYZT9A9nOWKNei1ue/4ehWAjue0EXpOcGfxn0I=; b=a72sJCMgWRnLUEwCVcJ66qs7AqiltuLOekufARMLpCyqPIJeT/xSg0mVfgGS5VrNM0 WvqfkydGRrx83lxaNNdczFIipM84dijQsqjGdHRz/zYeDtpQMLOvBFbOOLTR0mgzis1n wEm8aK1VNoBcaB89aQEgvm2DCYU2pCorvXFzKom61WxgwsNKsYvLGPXNYRBden7iPPvJ 5P9mE0Lz+PHYIAQ0tXgxjJCgePIAU0MA7/M2+sbpGgljNZJUm75GnCQ+RkQPF2yEnI5H 2t4dUBieNleLix4EL9X47iFNiT17aykehlv5hFjHp+5V1F625MYanwaFA/Km3geRXhiD BN1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:cc:to; bh=6FSvZDYZT9A9nOWKNei1ue/4ehWAjue0EXpOcGfxn0I=; b=Yn7ND2Gz23HiqpkYJF9G821ofoqRnYmBoEz1k/wCd7xF9s2djNRDgCeb8UXgBy2lLA hsi+fjtfEdTFDesp44jj/BGKDgW5c7MDjxRVlRRuNNGrAQgu+y/U6w5EInEaKd4nH3gC CPv0WbuI5gcpwZszLlzMdKD18y1IhoiFHutGASZzVyoRZ6Mkknn37H0rflNbKj3sPafE jNsXXQ78y9HED+kGSpA5LKIfB63/SeevYVBgBjkx+l3RFHcSPqeQqo3XBjDMqMC7kYia lviE7NiJ4nuFdW0RQ11Z+/XOzPzahsIGZPPLRgbpAllEVXaSAx3yZXqean0r0o7d9XLX kR+A== X-Gm-Message-State: AOAM532sl+CoOaCm1JJcAHFH0zRrAPFZFa9fSrntGKqxN/px9OnpqXsb SkqtJnif8hW8ODTeMpmK9vPdmx7C0aR65q/SlH7Uv3sLlecUY5btQPMnEezvbLyjFGONjJQeZwQ wfAcQNEASF43Rhx1nNoDUhfqmk1npF2Kl9JPeyAiscCdE/pxyLI1VLJAg1+8cQGT1f+BY1ojNV5 gXT8/0OktLpXn3cxNlSvaLEFCKTlsEZwcoqD99xwYRocre X-Google-Smtp-Source: ABdhPJxZ3or8CKNSbqWGW90ZVUbaDcHTodIl156yTjNRpf0mK/ThHJS606PPtl7fd6g4TPA5gR64uQ== X-Received: by 2002:a63:4e51:: with SMTP id o17mr1274365pgl.126.1628195940220; Thu, 05 Aug 2021 13:39:00 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id t8sm10263045pja.41.2021.08.05.13.38.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Aug 2021 13:38:59 -0700 (PDT) From: Mark Dilger Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Assert triggered during RE_compile_and_cache Message-Id: <0203588E-E609-43AF-9F4F-902854231EE7@enterprisedb.com> Date: Thu, 5 Aug 2021 13:38:58 -0700 Cc: PostgreSQL-development To: Tom Lane X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom, while testing your patch in [1], I stumbled upon the following assert in = master, without your patch applied: +select 'vyrlvyrlwvqko' ~ '(?:(?:((.))))((\2)\1.){0,0}?'; +server closed the connection unexpectedly + This probably means the server terminated abnormally + before or while processing the request. +connection to server was lost The assert itself dates back to a commit of yours from 2003. I don't = think you did anything wrong here, but I wonder if you might understand = the code better than anyone else? The relevant bit of the stack trace is: frame #3: 0x00000001020eff7d = postgres`ExceptionalCondition(conditionName=3D, = errorType=3D, fileName=3D, = lineNumber=3D) at assert.c:69:2 [opt] frame #4: 0x0000000101e2c682 postgres`delsub(nfa=3D0x00007fc7e8407360,= lp=3D0x00007fc7e8831010, rp=3D0x00007fc7e8827328) at regc_nfa.c:1265:2 = [opt] frame #5: 0x0000000101e28dd8 postgres`parsebranch [inlined] = parseqatom(v=3D, stopper=3D101, type=3D112, = lp=3D, rp=3D0x00007fc7e8827328, top=3D) at = regcomp.c:1084:3 [opt] frame #6: 0x0000000101e27de9 = postgres`parsebranch(v=3D0x00007ffeee0a80b8, stopper=3D101, = type=3D, left=3D, right=3D, = partial=3D) at regcomp.c:759 [opt] frame #7: 0x0000000101e29719 postgres`parsebranch [inlined] = parseqatom(v=3D, stopper=3D101, type=3D112, = lp=3D, rp=3D0x00007fc7e8827328, top=3D) at = regcomp.c:1282:23 [opt] frame #8: 0x0000000101e29639 = postgres`parsebranch(v=3D0x00007ffeee0a80b8, stopper=3D101, = type=3D, left=3D, right=3D, = partial=3D) at regcomp.c:759 [opt] frame #9: 0x0000000101e2457b postgres`parse(v=3D0x00007ffeee0a80b8, = stopper=3D101, type=3D112, init=3D0x00007fc7e8827280, = final=3D0x00007fc7e88272b8) at regcomp.c:691:12 [opt] frame #10: 0x0000000101e234d2 = postgres`pg_regcomp(re=3D0x00007ffeee0a8208, string=3D, = len=3D, flags=3D, collation=3D) = at regcomp.c:418:12 [opt] frame #11: 0x0000000101f75790 = postgres`RE_compile_and_cache(text_re=3D, = cflags=3D, collation=3D100) at regexp.c:186:19 [opt] frame #12: 0x0000000101f75b90 postgres`textregexeq [inlined] = RE_compile_and_execute(text_re=3D, dat=3D, = dat_len=3D13, cflags=3D3, collation=3D, nmatch=3D0, = pmatch=3D) at regexp.c:351:7 [opt] [1] = https://www.postgresql.org/message-id/2219936.1628115334%40sss.pgh.pa.us =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company