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 1kAS5S-0007Aq-B6 for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Aug 2020 06:05:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAS5P-0007wP-Q3 for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Aug 2020 06:05:35 +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 1kAS5P-0007wH-8Z for pgsql-bugs@lists.postgresql.org; Tue, 25 Aug 2020 06:05:35 +0000 Received: from [66.111.4.29] (helo=out5-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAS5H-0002Um-7W for pgsql-bugs@postgresql.org; Tue, 25 Aug 2020 06:05:34 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D6E375C00C4; Tue, 25 Aug 2020 02:05:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 25 Aug 2020 02:05:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=f1exY3htgVDFqr/WGKWZOybotQt hfpjw+cjGUXrEdVE=; b=U2mURm1/l7bPC2lO+YRR1q+2YfpOiKBKThdzVlb/TKx Qw2MHqmW6mES4f6OrcSub9rrhpsqwVXhkEOMgjXlwrvFpl/65KNYkqORTyjF3rJW MpJSqSCa27Ejngg0roT713KdWbzNh9rTMION+xAHKh7XjJwbR7jecCGyYIsNDCTa Art28SssKhLO+j4S8b26GA1qtxqgB77IWnTaZTKYuf8xONJbss0bArUKDwlNtxWa +Q7hVYC8iov+L3aVtNwAwr/I2y8wBWexSgYzJebnMuneIurfSmvqigwTRQmqaTih V7uRhAhy+nNySOX0AL26E4/xWcKHpEhM6fEVG6gPO3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=f1exY3 htgVDFqr/WGKWZOybotQthfpjw+cjGUXrEdVE=; b=QX0SXCqWq3wUURXKvxvevp G3OZDf0cXy3lJAR7EyhIZy39O8yvIBtOX7oWmMw5rctMGPStJ+vSAPiMm+yUxl0y YhzTsDgWiU73kuXw3zaRrTYKtrQLAi3pb6km3FjMxNKl6bGBvFEYqALUmiXTxzAO dI6/Tc+vFhxSDYUWDD5NJ8t/8f08REVzICMCgqU7TeDV2UBsehJelkmjOSxPHRYD q3DmQKdWLkXq+eXUnAmmHGvwRSeGXRkmSIGsDKlFnrNS3tGOObNFSohvp3BQh5tu Qpwu6MY/i0/mNisUPB0+Vx1iuH2JuD8jYO+JP/vCFuuvgW7+8G9OLuVNZTlBWYqg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudduledguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveej heehieevueeigeelteegleejleeiueeiheegvefhnecukfhppeduuddurddutddvrdduke dtrddukeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 7BA7030600A3; Tue, 25 Aug 2020 02:05:14 -0400 (EDT) Date: Tue, 25 Aug 2020 15:05:11 +0900 From: Michael Paquier To: Robins Tharakan Cc: pgsql-bugs@postgresql.org Subject: Re: ALTER TABLE ALTER COLUMN SET TYPE crash Message-ID: <20200825060511.GF2017@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iAL9S67WQOXgEPD9" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.29 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --iAL9S67WQOXgEPD9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 25, 2020 at 02:14:06PM +1000, Robins Tharakan wrote: > Unlike a recently reported similar issue, executing the following ALTER > TABLE on the regression database crashes Postgres (master). >=20 > Admittedly it doesn't do anything constructive (and am new to the tool), > but do let me know if such reports are interesting and / or if you need > more details for reproduction. Such reports are constructive! I can reproduce the crash here down to 9.5. From what I can see, the problem comes from ATRewriteTable() -> ExecEvalExpr() when we evaluate expressions with inputs coming from the old tuple. It looks like a memory corruption issue or a context issue at quick glance, and I cannot get a clean backtrace. -- Michael --iAL9S67WQOXgEPD9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl9EqhcACgkQnvQgOdby QH2MmQ/+LyGtb+UfKl4jSq40bFHkXLcpILhdNM9voOuLHW4zgirGPcEPrPtbCFjY PDLe+dGUa/2iw1FR6ej0KX/lDZa3+yFoSDT28Sbx88uYmcvmTJDmOEvAZJrQ5mKi 0ZggvHt24LD+5gfjevV1J4peqGIvXSdxtz+PnnXlCE6GqKtBMDpLOIvE0di6zAZU UDOuy6i1sfj0BuignJh4poQ46YkizPf+0bLHjVR7707XiNOCY+sSRCDzbDk45yt/ tLPSlOikePs3yp1bPI5JALae64SrJvTnGAHOYvYKZeryza/JgRtcxe1GlIefve+s u+Q3KLfMejtDEy/iHfZIBUoyqCG8aTSXwzWWjDB6RDvhM7x2X4KB7CJJLtWiFeNb 5Tl+bCAnykRDvcR02jaipOIdvVab9xel0ou+mjgnj+J7Yq2f9/zwozgqoXkHomPv 6Labz0x8rqnEw+9KMymXtunHHgMOcZRVuwLpg/L4VjjAaCieBAcrwXuAq4KOPhlv lTMyzmTZKiqZx/i5ZOe0QBA/xdkYmQp2838d1mqcge2zr6cgMPBYVRRey571IlCW oyNQuH8+9ISbWrNRCKxHrN3w5b1YSpKaziLGmOzXZ4AEguUjbmO7tYReEwaj+L96 iCJoni9N1f4FTUW3HyOK+jY8S9IeOwnmqSnS50yA3UG7AMm484s= =f+rJ -----END PGP SIGNATURE----- --iAL9S67WQOXgEPD9--