From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: adamguo@amazon.com
Subject: BUG #18912: TRAP: failed Assert("tag.spcOid != GLOBALTABLESPACE_OID"), File: "bufmgr.c", Line: 4165, PID: 2115
Date: Mon, 05 May 2025 22:01:15 +0000
Message-ID: <18912-a41c9bd0e0ad19b1@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18912
Logged by: Adam Guo
Email address: adamguo@amazon.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=...
[2]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f4ece891fc2f
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, adamguo@amazon.com
Subject: Re: BUG #18912: TRAP: failed Assert("tag.spcOid != GLOBALTABLESPACE_OID"), File: "bufmgr.c", Line: 4165, PID: 2115
In-Reply-To: <18912-a41c9bd0e0ad19b1@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox