Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508 - Mailing list pgsql-hackers

From Erik Rijkers
Subject Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508
Date
Msg-id 45922d8c-9c9b-c704-5028-dab47ec9fcc4@xs4all.nl
Whole thread Raw
In response to Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508
List pgsql-hackers
Op 19-04-2022 om 02:15 schreef Kyotaro Horiguchi:
> At Mon, 18 Apr 2022 10:57:02 +0200, Erikjan Rijkers <er@xs4all.nl> wrote in
>> Hm.  Just now I've recompiled and retried and after 5 runs got the
>> same crash.  Then tried on another machine (also old, I'm afraid),
>> and built 1a8b11053 and ran the same thing.  That failed on the first
>> try, and made core dump from which I extracted:
> 
> Thanks!
> 
>> gdb ~/pg_stuff/pg_installations/pgsql.HEAD/bin/postgres
>> core-postgres-6-500-500-8289-1650269886 -ex bt -ex q
>>
>> #2 0x0000000000973fcb in ExceptionalCondition
>> #(conditionName=conditionName@entry=0xb20d76 "tabstat->trans == trans",
>> #errorType=errorType@entry=0x9c7c2b "FailedAssertion",
>>      fileName=fileName@entry=0xb20d0b "pgstat_relation.c",
>>      lineNumber=lineNumber@entry=508) at assert.c:69
>> #3 0x000000000086b77f in AtEOXact_PgStat_Relations
>> #(xact_state=xact_state@entry=0x26f0b50, isCommit=isCommit@entry=true)
>> #at pgstat_relation.c:508
> 
> Could you read tabstat, *tabstat, trans, *trans here?

To be honest I'm not sure how to, but I gave it a try:

GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from 
/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD/bin/postgres...done.
[New LWP 21839]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `postgres: logical replication worker for 
subscription 16411                   '.
Program terminated with signal 6, Aborted.
#0  0x000000357d6324f5 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x000000357d6324f5 in raise () from /lib64/libc.so.6
#1  0x000000357d633cd5 in abort () from /lib64/libc.so.6
#2  0x000000000097400b in ExceptionalCondition 
(conditionName=conditionName@entry=0xb20df6 "tabstat->trans == trans", 
errorType=errorType@entry=0x9c7cab "FailedAssertion",
     fileName=fileName@entry=0xb20d8b "pgstat_relation.c", 
lineNumber=lineNumber@entry=508) at assert.c:69
#3  0x000000000086b7bf in AtEOXact_PgStat_Relations 
(xact_state=xact_state@entry=0x2d9ab50, isCommit=isCommit@entry=true) at 
pgstat_relation.c:508
#4  0x000000000086ec4f in AtEOXact_PgStat (isCommit=isCommit@entry=true, 
parallel=parallel@entry=false) at pgstat_xact.c:54
#5  0x00000000005bd2a3 in CommitTransaction () at xact.c:2360
#6  0x00000000005be5d5 in CommitTransactionCommand () at xact.c:3048
#7  0x00000000007ee76b in apply_handle_commit_internal 
(commit_data=commit_data@entry=0x7fffb90aa8e0) at worker.c:1532
#8  0x00000000007efb09 in apply_handle_commit (s=0x7fffb90aaa80) at 
worker.c:845
#9  apply_dispatch () at worker.c:2473
#10 0x00000000007f11e7 in LogicalRepApplyLoop (last_received=74695984) 
at worker.c:2757
#11 start_apply () at worker.c:3526
#12 0x00000000007f179f in ApplyWorkerMain () at worker.c:3782
#13 0x00000000007bdbb3 in StartBackgroundWorker () at bgworker.c:858
#14 0x00000000007c3251 in do_start_bgworker (rw=<optimized out>) at 
postmaster.c:5802
#15 maybe_start_bgworkers () at postmaster.c:6026
#16 0x00000000007c3b75 in sigusr1_handler 
(postgres_signal_arg=<optimized out>) at postmaster.c:5191
#17 <signal handler called>
#18 0x000000357d6e1683 in __select_nocancel () from /lib64/libc.so.6
#19 0x00000000007c41e6 in ServerLoop () at postmaster.c:1757
#20 0x00000000007c5c4b in PostmasterMain () at postmaster.c:1465
#21 0x0000000000720d0e in main (argc=11, argv=0x2cbf590) at main.c:202
(gdb) f 3
#3  0x000000000086b7bf in AtEOXact_PgStat_Relations 
(xact_state=xact_state@entry=0x2d9ab50, isCommit=isCommit@entry=true) at 
pgstat_relation.c:508
508                     Assert(tabstat->trans == trans);
(gdb) p tabstat
$1 = <optimized out>
(gdb) p *tabstat
value has been optimized out
(gdb) p trans
$2 = <optimized out>
(gdb) p *trans
value has been optimized out
(gdb)


> 
>> #4 0x000000000086ec0f in AtEOXact_PgStat (isCommit=isCommit@entry=true,
>> #parallel=parallel@entry=false) at pgstat_xact.c:54
>> #5  0x00000000005bd2a3 in CommitTransaction () at xact.c:2360
>> #6  0x00000000005be5d5 in CommitTransactionCommand () at xact.c:3048
>> #7 0x00000000007ee72b in apply_handle_commit_internal
>> #(commit_data=commit_data@entry=0x7ffe4606a7a0) at worker.c:1532
>> #8 0x00000000007efac9 in apply_handle_commit (s=0x7ffe4606a940) at
>> #worker.c:845
>> #9  apply_dispatch () at worker.c:2473
>> #10 0x00000000007f11a7 in LogicalRepApplyLoop (last_received=74454600)
>> #at worker.c:2757
>> #11 start_apply () at worker.c:3526
>> #12 0x00000000007f175f in ApplyWorkerMain () at worker.c:3782
> 
> regards.
> 



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Column Filtering in Logical Replication
Next
From: Michael Paquier
Date:
Subject: Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory