Re: BUG #16038: Alter table - SegFault

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: deathlock13(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: BUG #16038: Alter table - SegFault
Date: 2019-10-04 14:43:52
Message-ID: 20191004144352.GA15934@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2019-Oct-04, PG Bug reporting form wrote:

> alter table test.testa
> add column idb numeric(10,0) NOT NULL DEFAULT nextval('test.sq_testb'),
> add column fk_tmpb varchar(20);
>
> server process (PID 21884) was terminated by signal 11: Segmentation fault
> - empty table - alter goes ok , split alter into 2 add col - works too

Hmm, confirmed, here's the stack trace:

#0 0x0000561459590e9f in heap_compute_data_size (tupleDesc=tupleDesc(at)entry=0x7faa37b16618,
values=values(at)entry=0x56145b26ba30, isnull=isnull(at)entry=0x56145b26ba80)
at /pgsql/source/REL_12_STABLE/src/backend/access/common/heaptuple.c:138
#1 0x000056145959232b in heap_form_tuple (tupleDescriptor=0x7faa37b16618, values=0x56145b26ba30,
isnull=0x56145b26ba80) at /pgsql/source/REL_12_STABLE/src/backend/access/common/heaptuple.c:1061
#2 0x000056145975f881 in tts_buffer_heap_materialize (slot=0x56145b26b9c0)
at /pgsql/source/REL_12_STABLE/src/backend/executor/execTuples.c:713
#3 0x0000561459761083 in ExecFetchSlotHeapTuple (slot=0x56145b26b9c0, materialize=<optimized out>,
shouldFree=0x7ffffc491bbf) at /pgsql/source/REL_12_STABLE/src/backend/executor/execTuples.c:1618
#4 0x00005614595e09c4 in heapam_tuple_insert (relation=0x7faa37b159e0, slot=0x56145b26b9c0, cid=8,
options=2, bistate=0x56145b26bd68)
at /pgsql/source/REL_12_STABLE/src/backend/access/heap/heapam_handler.c:250
#5 0x0000561459715614 in table_tuple_insert (bistate=0x56145b26bd68, options=2, cid=8,
slot=0x56145b26b9c0, rel=0x7faa37b159e0)
at /pgsql/source/REL_12_STABLE/src/include/access/tableam.h:1126
#6 ATRewriteTable (tab=tab(at)entry=0x56145b25b5d8, OIDNewHeap=OIDNewHeap(at)entry=16396,
lockmode=lockmode(at)entry=8) at /pgsql/source/REL_12_STABLE/src/backend/commands/tablecmds.c:5039
#7 0x000056145972a9b8 in ATRewriteTables (lockmode=8, wqueue=0x7ffffc491d08,
parsetree=0x56145b24d7c0) at /pgsql/source/REL_12_STABLE/src/backend/commands/tablecmds.c:4641
#8 ATController (parsetree=parsetree(at)entry=0x56145b24d7c0, rel=<optimized out>,
cmds=<optimized out>, recurse=<optimized out>, lockmode=lockmode(at)entry=8)
at /pgsql/source/REL_12_STABLE/src/backend/commands/tablecmds.c:3848

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2019-10-04 15:26:24 Re: BUG #16038: Alter table - SegFault
Previous Message Merlin Moncure 2019-10-04 14:12:38 Re: [BUGS] bug or simply not enough stack space?