BUG #19383: Server crash at getmissingattr

Started by PG Bug reporting form3 months ago3 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 19383
Logged by: Yuxiao Guo
Email address: dllggyx@outlook.com
PostgreSQL version: 17.7
Operating system: Ubuntu 20.04 x86-64, docker image postgres:17.7
Description:

Hi, I found a crash in PostgreSQL. Here are the details:

PoC:
create table foo(a int);
DROP TABLE IF EXISTS l_prijscomponent_eenheid CASCADE;
insert into foo values(1),(2),(3);
alter table foo add b int not null default 0;
update pg_attribute set attmissingval = NULL where attname = 'b';
select b from foo;
ANALYZE foo, foo;

Stacktrace:
#0 0x5882d3 (getmissingattr+0x163)
#1 0x9eb51d (compute_scalar_stats+0x3ad)
#2 0x9e76fd (do_analyze_rel+0x1d2d)
#3 0x9e48fd (analyze_rel+0x5dd)
#4 0xb9b644 (vacuum+0x1454)
#5 0xb999e9 (ExecVacuum+0xf79)
#6 0x1337c8e (standard_ProcessUtility+0x9ce)
#7 0x13372b4 (ProcessUtility+0x84)
#8 0x1336573 (PortalRunUtility+0x193)
#9 0x133485e (PortalRunMulti+0x3ce)
#10 0x133316d (PortalRun+0x46d)
#11 0x132f1de (exec_simple_query+0x146e)
#12 0x1328627 (PostgresMain+0x2c57)
#13 0x13192e4 (BackendMain+0xe4)
#14 0x10a26c3 (postmaster_child_launch+0x193)
#15 0x10adb91 (ServerLoop+0x4821)
#16 0x10a76ec (PostmasterMain+0x241c)
#17 0xd5c2b8 (main+0x458)
#18 0x7f87335ac083 (__libc_start_main+0xf3)
#19 0x4a9c6e (_start+0x2e)

#2Andrey Borodin
amborodin@acm.org
In reply to: PG Bug reporting form (#1)
Re: BUG #19383: Server crash at getmissingattr

Hi!

Thanks for the report.

On 20 Jan 2026, at 10:08, PG Bug reporting form <noreply@postgresql.org> wrote:

update pg_attribute set attmissingval = NULL where attname = 'b';

Is it possible to reproduce the problem without tampering catalog?

Best regards, Andrey Borodin.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: BUG #19383: Server crash at getmissingattr

PG Bug reporting form <noreply@postgresql.org> writes:

create table foo(a int);
DROP TABLE IF EXISTS l_prijscomponent_eenheid CASCADE;
insert into foo values(1),(2),(3);
alter table foo add b int not null default 0;
update pg_attribute set attmissingval = NULL where attname = 'b';
select b from foo;

This is not a bug. This is a superuser intentionally breaking
the system by corrupting the catalogs. There are any number
of ways to cause trouble with ill-advised manual updates to a
catalog table. Try, eg, "DELETE FROM pg_proc" (... but not in
a database you care about).

regards, tom lane