BUG #17122: panic on prepare with subsequent pg_advisory_lock() and pg_advisory_xact_lock_shared()

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: a(dot)pyhalov(at)postgrespro(dot)ru
Subject: BUG #17122: panic on prepare with subsequent pg_advisory_lock() and pg_advisory_xact_lock_shared()
Date: 2021-07-23 14:17:25
Message-ID: 17122-04f3c32098a62233@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: 17122
Logged by: Alexander Pyhalov
Email address: a(dot)pyhalov(at)postgrespro(dot)ru
PostgreSQL version: 13.3
Operating system: Ubuntu 20.04
Description:

The issue is reproducible at least on on PG 13.3 and 14beta2

mkdir d;
initdb -D d;

Increase max_prepared_transactions in postgresql.conf (for example, set it
to 10).

The following statements lead to panic:
begin;
select pg_advisory_lock(1);
select pg_advisory_xact_lock_shared(1);
prepare transaction 'test';

2021-07-23 17:15:59.868 MSK [61851] PANIC: we seem to have dropped a bit
somewhere
2021-07-23 17:15:59.868 MSK [61851] STATEMENT: prepare transaction
'test';

(gdb) bt
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007fc72923c859 in __GI_abort () at abort.c:79
#2 0x000055f80d4facdd in errfinish (filename=0x55f80d6b53c3 "lock.c",
lineno=3466, funcname=0x55f80d6b6200 <__func__.13837> "PostPrepare_Locks")
at elog.c:592
#3 0x000055f80d340143 in PostPrepare_Locks (xid=485) at lock.c:3466
#4 0x000055f80cf50942 in PrepareTransaction () at xact.c:2519
#5 0x000055f80cf512b9 in CommitTransactionCommand () at xact.c:3034
#6 0x000055f80d35c487 in finish_xact_command () at postgres.c:2662
#7 0x000055f80d359edb in exec_simple_query (query_string=0x55f80f0890a0
"prepare transaction 'test';") at postgres.c:1264
#8 0x000055f80d35e587 in PostgresMain (argc=1, argv=0x55f80f0b38b0,
dbname=0x55f80f0856d8 "postgres", username=0x55f80f0b37d0 "leoric") at
postgres.c:4339
#9 0x000055f80d29ddf4 in BackendRun (port=0x55f80f0abc20) at
postmaster.c:4526
#10 0x000055f80d29d4f6 in BackendStartup (port=0x55f80f0abc20) at
postmaster.c:4210
#11 0x000055f80d2997ec in ServerLoop () at postmaster.c:1739
#12 0x000055f80d298f85 in PostmasterMain (argc=3, argv=0x55f80f083650) at
postmaster.c:1412
#13 0x000055f80d193dcd in main (argc=3, argv=0x55f80f083650) at main.c:210

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pawel Kudzia 2021-07-23 15:04:50 Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
Previous Message Heikki Linnakangas 2021-07-23 13:46:25 Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows