BUG #18912: TRAP: failed Assert("tag.spcOid != GLOBALTABLESPACE_OID"), File: "bufmgr.c", Line: 4165, PID: 2115

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: adamguo(at)amazon(dot)com
Subject: BUG #18912: TRAP: failed Assert("tag.spcOid != GLOBALTABLESPACE_OID"), File: "bufmgr.c", Line: 4165, PID: 2115
Date: 2025-05-05 22:01:15
Message-ID: 18912-a41c9bd0e0ad19b1@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18912
Logged by: Adam Guo
Email address: adamguo(at)amazon(dot)com
PostgreSQL version: Unsupported/Unknown
Operating system: Amazon Linux 2
Description:

Hi team,
I noticed an assert failure in PG18beta1. I can reproduce it by running the
following:
```
CREATE USER myuser;
REINDEX SCHEMA pg_catalog;
SET SESSION AUTHORIZATION myuser;
GRANT ALTER SYSTEM ON PARAMETER log_filename TO myuser;
GRANT ALTER SYSTEM ON PARAMETER log_filename TO myuser WITH GRANT OPTION;
```
From what I can tell, all of these statements are necessary to reproduce the
error. On the last one, the backend aborts at buffer/bufmgr.c:4165 [1].
This
assert was introduced in f4ece891 [2]. Seems like something is holding onto
an
LW_EXCLUSIVE lock on a system catalog?
According to gdb, the relation in question is not a system catalog but does
live
in the pg_global tablespace. I can't find it in pg_class.
```
(gdb) up 3
#3 0x00000000009e1f48 in AssertNotCatalogBufferLock (lock=0x7f8ab5782c30,
mode=LW_EXCLUSIVE,
unused_context=0x0) at bufmgr.c:4165
4165 Assert(tag.spcOid != GLOBALTABLESPACE_OID);
(gdb) p tag.spcOid
$1 = 1664
(gdb) p relid
$2 = 16526
```
Regards,
Adam Guo
[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/storage/buffer/bufmgr.c;hb=HEAD#l4165
[2]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f4ece891fc2f

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2025-05-06 00:31:01 Re: BUG #18912: TRAP: failed Assert("tag.spcOid != GLOBALTABLESPACE_OID"), File: "bufmgr.c", Line: 4165, PID: 2115
Previous Message David G. Johnston 2025-05-05 15:30:06 Re: BUG #18911: Bug in the command INHERITS.