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.96) (envelope-from ) id 1wArpZ-000U2e-0b for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 16:02:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wArpX-006XEI-07 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 16:02:07 +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.96) (envelope-from ) id 1wArpW-006XE8-2F for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 16:02:07 +0000 Received: from hst.kbt.io ([5.39.86.84]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wArpU-00000000CpS-2chk for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 16:02:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kbt.io; s=default; t=1775750522; bh=HzmS+sAm757f9DyXx9LsRXRVy0l6q7uBlLggEun2ygc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C7w6fJ1MVkB/bHF2iV0hTPYQjZ+3tBE367NuKG6fWJUnQbrc9kKnu5hyiIVb+pH0d 7U79l0ixgnkf5vZ+uMpKs8AFgRRupShlA+l48K3Aar477qcRcYY0BF2qOWXCOlKtqa kYbsKbfMSJXpMa17rdVkI8eENNbZ8gl/CbNirq0zvf9YnV0mC5hRNAQqg0dFbsO2MD r8EigZbjjyBh93EE3rqSVU5aMSSwiRlfM0/7SggF7tNG9o0Pnwrvm7kBhB5J27TN6+ Oj+FOr2IbStvoq8pbyZYI892q/JZW8vIqZEKZQEk4EYaLzblo9I8EIKnS0YJW4aQUV fpw1iK2jDC9hw== Received: from oli (unknown [IPv6:2a01:b600:68a6:1:5c0a:6c66:7404:3458]) by hst.kbt.io (Postfix) with ESMTPSA id 329583C00B3; Thu, 9 Apr 2026 18:02:02 +0200 (CEST) Date: Thu, 9 Apr 2026 18:01:58 +0200 From: Sandro Santilli To: Amit Langote Cc: Tomas Vondra , Junwang Zhao , Pavel Stehule , PostgreSQL-development Subject: Re: Eliminating SPI / SQL from some RI triggers - take 3 Message-ID: Mail-Followup-To: Sandro Santilli , Amit Langote , Tomas Vondra , Junwang Zhao , Pavel Stehule , PostgreSQL-development References: <43b56e3b-80d6-4a45-a313-cb1caa587b22@vondra.me> <1290fac7-8430-4d2c-bfcb-00c65adff5e5@vondra.me> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Jfwn5RvyJgNE3cPn" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Jfwn5RvyJgNE3cPn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 09, 2026 at 08:55:01PM +0900, Amit Langote wrote: > Hi Sandro, >=20 > On Thu, Apr 9, 2026 at 8:07=E2=80=AFPM Sandro Santilli wrot= e: > > On Mon, Mar 02, 2026 at 01:34:41PM +0100, Tomas Vondra wrote: > > > > > > TBH I haven't noticed the memory context issue myself, I only noticed > > > because the builds with index prefetch started crashing. > > > > We're getting a crash in PostGIS too, since that commit was merged into > > the master branch, see https://trac.osgeo.org/postgis/ticket/6066 > > > > The crash is triggered a C function using SPI. >=20 > Evan Montgomery-Recht posted a report of the same issue on this thread > a couple of days ago. I confirm the patch attached in Evan's email [1] fixes the crash for us. [1] https://www.postgresql.org/message-id/CAEg7pwcKf01FmDqFAf-Hzu_pYnMYScY_= Otid-pe9uw3BJ6gq9g%40mail.gmail.com > I have posted a patch to fix the issue, which I will commit tomorrow > after a bit more testing. I also confirm your patch v4-0001-Fix-RI-fast-path-crash-under-nested-C-lev= el-SPI.patch fixes the crash for us. Thank you ! Let me know when it is time to test again against master. --strk; --Jfwn5RvyJgNE3cPn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEyOAhc1XOBFGVnzBARwiVRt5AyacFAmnXzXUACgkQRwiVRt5A yadAigv8CWpciExzO24nJ0ngSPlx5ULJEj/qdbAOq+GAxcUk7QEEHSR3CVowbTbS 81rJId0zc2rgX8pOgUGbOnW/2P7z6vahWYdQotpHmDoJal/jbTCifkEfFglZjn5+ wRJ3VZ8reDbF2lEZkyEaPoakfngYdXtgqdxSmlCTQL3yUGTbzRLeudXH5LiktFwm /+wCbhXJzXTP5ajrl0giYQYm6xxSBkHG7+uTC90uNjN/btp573F++/TCPqElIijF KjT5KXS8cQdzsIkBxOM7d+hgxVQcNTPnCk4IqP+yrVnBh1ptC9Yv8xC37MO4dk95 ZaR3PwdEvhW7nEm0HlzRPsmr2n5Ia14i4ZAmSqgOLx+AOQ59JWSJkUHnXszLlc41 9dtZoCOtScj3b0kvsogeP4qw6rhwu0N7Xe1VDgIPKuG1ifqqDKGK7nerr69s4rnj ZQJPvqeoL0YNaJ48Q8WuShKQ5WV/DHAIJbAopj8qctfDfWDfCah8r+ldhZlWhyAR FMawkEo9 =iFUa -----END PGP SIGNATURE----- --Jfwn5RvyJgNE3cPn--