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 1sMY5m-002xK2-8q for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 19:14:06 +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 1sMY5j-0068mN-23 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 19:14:03 +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 1sMY5i-0068m9-Om for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2024 19:14:03 +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 1sMY5g-003hC1-IH for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2024 19:14:02 +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 45QJDxkY1572311 for ; Wed, 26 Jun 2024 15:13:59 -0400 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: Re: JIT causes core dump during error recovery In-reply-to: <1565654.1719425368@sss.pgh.pa.us> References: <1565654.1719425368@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 26 Jun 2024 14:09:28 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1572292.1719429226.0@sss.pgh.pa.us> Date: Wed, 26 Jun 2024 15:13:59 -0400 Message-ID: <1572310.1719429239@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1572292.1719429226.1@sss.pgh.pa.us> I wrote: > It gets a SIGSEGV in plpgsql_transaction.sql's > cursor_fail_during_commit test. Here's a simpler way to reproduce: just run the attached script in a --with-llvm build. (This is merely extracting the troublesome regression case for convenience.) Interesting, if you take out any one of the three "set" commands, it doesn't crash. This probably explains why, for example, buildfarm member urutu hasn't shown this --- it's only reducing one of the three costs to zero. I don't have any idea what to make of that result, except that it suggests the problem might be at least partly LLVM's fault. Surely, if we are prematurely unmapping a compiled code segment, that behavior wouldn't depend on whether we had asked for inlining? regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="jiterrorcrash.sql"; charset="us-ascii" Content-ID: <1572292.1719429226.2@sss.pgh.pa.us> Content-Description: jiterrorcrash.sql drop table if exists test1; create table test1 (x int); CREATE OR REPLACE PROCEDURE cursor_fail_during_commit() LANGUAGE plpgsql AS $$ DECLARE id int; BEGIN FOR id IN SELECT 1/(x-1000) FROM generate_series(1,1000) x LOOP INSERT INTO test1 VALUES(id); COMMIT; END LOOP; END; $$; set jit_above_cost=0; set jit_optimize_above_cost=0; set jit_inline_above_cost=0; CALL cursor_fail_during_commit(); ------- =_aaaaaaaaaa0--