Re: ALTER TABLE ALTER COLUMN SET TYPE crash - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: ALTER TABLE ALTER COLUMN SET TYPE crash
Date
Msg-id 20200825060511.GF2017@paquier.xyz
Whole thread Raw
In response to ALTER TABLE ALTER COLUMN SET TYPE crash  (Robins Tharakan <tharakan@gmail.com>)
Responses Re: ALTER TABLE ALTER COLUMN SET TYPE crash  (Bruce Momjian <bruce@momjian.us>)
Re: ALTER TABLE ALTER COLUMN SET TYPE crash  (Robins Tharakan <tharakan@gmail.com>)
List pgsql-bugs
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).
>
> 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

Attachment

pgsql-bugs by date:

Previous
From: Robins Tharakan
Date:
Subject: ALTER TABLE ALTER COLUMN SET TYPE crash
Next
From: Peter Eisentraut
Date:
Subject: Re: invalid alloc size error possible in shm_mq