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 1ubpjd-005qug-Em for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Jul 2025 00:10:57 +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 1ubpjb-006enb-GQ for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Jul 2025 00:10:56 +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 1ubpjb-006enT-8B for pgsql-bugs@lists.postgresql.org; Wed, 16 Jul 2025 00:10:55 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ubpjZ-007xz3-18 for pgsql-bugs@lists.postgresql.org; Wed, 16 Jul 2025 00:10:55 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 40D0414000BD; Tue, 15 Jul 2025 20:10:51 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 15 Jul 2025 20:10:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1752624651; x=1752711051; bh=c4lbIZ9mUR Yibqf30IYHpVqx1TnZHYu3J1PIGUL2Zi0=; b=deoUAK02J2XAAT5Ws07imZ9oD8 gkr0RwcfgxS4zbhpdPVJfn2j5PIBFhKUL8T01Wobgxcl8QZrVeZDrgRfPl7K6YVU gnwhzlMElw/QfHAwK6g8DzVEAA8JlS9Oh2JEjcqH7oT/wnKlhNHEfG6fjrNlV+Nu XwuCI3jeVh0CURlTAAiLhZspljMYVc6Yhh6ky0KUkJqfQBgqTryC+6nAWj++8f3R HxeBKtkAjb2+04B5eg+SnQM7b79yH+9PLI32Mw13DLXZFh190Zss0Hb/JzDbY3tU 7YIPvRICJBnSkTT+o8btiCoxicTiYMT28VxFCkdk+tvnTa2kr+jNbNbzBT6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1752624651; x=1752711051; bh=c4lbIZ9mURYibqf30IYHpVqx1TnZHYu3J1P IGUL2Zi0=; b=CbtoEEe0MFg2pLInTQJWWp7H1Hi5ieXdl1Q8SPR0dAtIQVSUWCP /PL+wcqOG4bKDO5RNZYe5m4sTOXv6FvFQ5JW+yxYIqSZ/MJzcij2bf8bSw8N5Csj s0CQ0/bDOxYMZVugZySkGMrNZDr008jCh2JOmL7+F7+YauWusBNMPDeBSyvqe7bH tfLa0mWqMncKGRIW0q2xBoUbNxV89gk5+BKYdttF2KO5s3OEGImwb8bv0zya2O1G mQYkL32xVs7KFwKMinGoaaueJUQo2+U42jBAXya0N8w26saU8KOr8kNlMFSVAR5+ mg6ivDU/sy4zixop4S0Jv2KYbDZ3tMMOjrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdehiedvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecufghrlhcuvffnffculddvfedmnecujfgurhepfffhvfevuf fkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgv rhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpe ejjedtleelgeegleffudfhjedtuedvkeektefhhfeuvddvueduueegfeduvedtieenucff ohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgs pghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthhglhessh hsshdrphhghhdrphgrrdhushdprhgtphhtthhopeihsehllhhlrdhgugdprhgtphhtthho pehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jul 2025 20:10:49 -0400 (EDT) Date: Wed, 16 Jul 2025 09:10:36 +0900 From: Michael Paquier To: Tom Lane Cc: y@lll.gd, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18986: SIGSEGV in nodeModifyTable.c during Parallel Execution Message-ID: References: <18986-e7a8aac3d339fa47@postgresql.org> <937261.1752603233@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LnmlRRc/G+JjeyCV" Content-Disposition: inline In-Reply-To: <937261.1752603233@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --LnmlRRc/G+JjeyCV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 15, 2025 at 02:13:53PM -0400, Tom Lane wrote: > PG Bug reporting form writes: > > During testing a flow in an app, I encountered a segfault that only hap= pens > > during parallel execution: > > https://gist.github.com/joy4eg/708458e204f52129a8e54a13534586b7 >=20 > This report isn't terribly helpful, since you have not explained > how to trigger the crash. If we can't duplicate it, it's hard > to decide what is the appropriate fix. =09 For the sake of visibility if the information on github gets lost, the change can be summarized by this query pattern, but we don't have any information about the end of the query: WITH replaced AS ( DELETE FROM replaceable_events_before_update WHERE replaced_by_id =3D ANY($1) RETURNING attr_list_1, [...] ), source_data (attr_list_2) AS ( SELECT * from replaced UNION ALL VALUES (attr_list_3 ... That's most likely generated a MERGE by an ORM to have these many parameters and columns listed. Without the full pattern or an idea of the schema as this includes triggers, what we can do is limited, as Tom says. And the relevant portion of the backtrace: #7 ExecGetUpdateNewTuple (oldSlot=3D0x55b0842d0288, #planSlot=3D0x55b084249d68, relinfo=3D0x55b0836a9b88) at #executor/./build/../src/backend/executor/nodeModifyTable.c:752 #8 ExecBRUpdateTriggers (estate=3D0x55b08369a708, #epqstate=3D0x55b0836a9a68, relinfo=3D0x55b0836a9b88, #tupleid=3D0x7fffc373628a, fdw_trigtuple=3D0x0, newslot=3D0x55b083720eb0, #tmresult=3D0x7fffc37361d0, tmfd=3D0x7fffc37362e0) at #commands/./build/../src/backend/commands/trigger.c:2979 #9 0x000055b08158628e in ExecUpdatePrologue #(context=3Dcontext@entry=3D0x7fffc37362c0, #resultRelInfo=3DresultRelInfo@entry=3D0x55b0836a9b88, #tupleid=3Dtupleid@entry=3D0x7fffc373628a, oldtuple=3Doldtuple@entry=3D0x0, #slot=3Dslot@entry=3D0x55b083720eb0, result=3Dresult@entry=3D0x7fffc37361d0) #at executor/./build/../src/backend/executor/nodeModifyTable.c:1949 #10 0x000055b081587e75 in ExecMergeMatched (context=3D, #resultRelInfo=3D, tupleid=3D0x7fffc373628a, oldtuple=3D0x0, #canSetTag=3Dfalse, matched=3D0x7fffc3736290) at #executor/./build/../src/backend/executor/nodeModifyTable.c:3023=20 If you could extract the query string from the backtrace, that would be one piece of information. With triggers and MERGE in mind, it may be possible to reproduce something. -- Michael --LnmlRRc/G+JjeyCV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmh27fwACgkQnvQgOdby QH2vIQ/+Kq+BF+m2inaXAJjmIhb5tuSW/KdVZ7rU0UdYX71fDa8stkowLjOCT9cI ntrvgngEcbh2bt63sKlToxUxHjuImJ8ESz1WcRJpq+2q3ratL+qtE8xbwRKIOvLK 3F9ZbzED0SGH/500+szSggWw4n6CGUAPVQFA0/6Y1fNqDamREOX6lkOUgRPCxzZw FjC9VP2a/BS2MQPyxWC3y2sWXzMBe6BOxOuIa4QvhkLeXFezptrH1Mmio+TI17Wk vhWDLLeZcQa4fVoSUH+qA+Jh1iVcIDZwWP3emW8pVpxQbV9+G+QuI11MLdA7M4P/ WT/bugcvbnvNtccq6R2sXks33T6RlTjcs00FLLght18HCMtiOa5+LBqzTjnC3ydK hMwkP/RNgdCEr3/SIPJfHVdOKtheuOnp/dJz54eKfz2vE9uGLeOuUumXBsjZv23e qWOSbngL0oXWxfGFMbF4A9rdtSholuP5VDGU3KEGmO5NCtOaYV6sw0kRPE5tdxN2 +pHRts7Uj/jx1Ez3xCR0isfZYsoi8N6xcg/B5UfAm7AGHj8GAF9PrQlOH0rb+Qow XKf3+xDF2nbXNWD9GPWPwdFw/2HC8tKNnegCNCx7gK3rRdd8dfC9YLc44yj21NAJ Ndql6Nj8r9oS27dngvWkonudGsN9P0o2DZSpLdVcyO0jGuF4e48= =95xn -----END PGP SIGNATURE----- --LnmlRRc/G+JjeyCV--