pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Andrey Borodin <amborodin86@gmail.com>
Cc: Michail Nikolaev <michail.nikolaev@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Jakub Wartak <jakub.wartak@enterprisedb.com>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>
Subject: Re: BUG: Postgres 14 + vacuum_defer_cleanup_age + FOR UPDATE + UPDATE
Date: Fri, 5 Jul 2024 13:00:01 +0300
Message-ID: <2b319458-63f4-1396-f23e-b8353acfa2aa@gmail.com> (raw)
In-Reply-To: <20230311234121.qnlxuzijeqdxmzu2@awork3.anarazel.de>
References: <CANtu0ojS07ptbePVENX9xfb_O8q08AZ64Y3mLCjrx3Gh1+aF5Q@mail.gmail.com>
	<20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de>
	<20230108030956.5q6ptk3boeisibjq@awork3.anarazel.de>
	<20230204105703.gt2j47vdn3s2gylt@alap3.anarazel.de>
	<CAH2-Wzkrh1OmRy=xNQbx4Yb708j152tZ-oPKS1S7fNURVxKTOg@mail.gmail.com>
	<20230206210205.uaaoe2l26fv256hs@awork3.anarazel.de>
	<20230309001558.b7shzvio645ebdta@awork3.anarazel.de>
	<E244808B-83A5-4E50-93BF-DF8D5544505A@enterprisedb.com>
	<20230311232226.fm442j4odhixy75p@awork3.anarazel.de>
	<ED5BB5D4-4C4D-4838-8D42-3A03CFB16791@enterprisedb.com>
	<20230311234121.qnlxuzijeqdxmzu2@awork3.anarazel.de>

Hello Andres,

12.03.2023 02:41, Andres Freund wrote:
> CI now finished the tests as well:
> https://cirrus-ci.com/build/6675457702100992
>
> So I'll go ahead and push that.

As I mentioned at [1], `meson test` fails on Windows x86 platform during
the test pg_amcheck/004_verify_heapam (I'm using VS 2022 Version 17.9.7):
meson setup build --wipe -Dcassert=true
cd build & ninja & meson test

... postgresql:pg_amcheck / pg_amcheck/004_verify_heapam ERROR             6.95s   exit status 25

004_verify_heapam_test.log contains:
TRAP: failed Assert("FullTransactionIdIsNormal(fxid)"), File: "../contrib/amcheck/verify_heapam.c", Line: 1915, PID: 2560
2024-07-04 20:56:54.592 PDT [9780] LOG:  server process (PID 2560) was terminated by exception 0xC0000409
2024-07-04 20:56:54.592 PDT [9780] DETAIL:  Failed process was running: SELECT v.blkno, v.offnum, v.attnum, v.msg FROM 
pg_catalog.pg_class c, "public".verify_heapam(
     relation := c.oid, on_error_stop := false, check_toast := true, skip := 'none'
     ) v WHERE c.oid = 16438 AND c.relpersistence != 't'

`git bisect` for this anomaly pointed at 4f5d461e0.
(I couldn't compile Postgres on that commit, but with
`git show 53ea2b7ad | git apply` (see also [2]) it's possible.)

The Assert in question is:
     else
         fxid = FullTransactionIdFromU64(nextfxid_i - diff);

     Assert(FullTransactionIdIsNormal(fxid));

It was not clear to me how it comes out that fxid is not normal, until I
looked at the disassembly:
     else
         fxid = FullTransactionIdFromU64(nextfxid_i - diff);
751812D2  sub         ebx,eax
751812D4  sbb         edi,edx

     Assert(FullTransactionIdIsNormal(fxid));
751812D6  jne         FullTransactionIdFromXidAndCtx+0E6h (751812F6h)
751812D8  jb          FullTransactionIdFromXidAndCtx+0CFh (751812DFh)
751812DA  cmp         ebx,3
751812DD  jae         FullTransactionIdFromXidAndCtx+0E6h (751812F6h)
751812DF  push        77Bh
751812E4  push        offset string "../contrib/amcheck/verify_heapa@"... (7518C4A4h)
751812E9  push        offset string "FullTransactionIdIsNormal(fxid)" (7518DB04h)
751812EE  call        _ExceptionalCondition (75189FFEh)

The same code fragment for your convenience:
https://ideone.com/8wiGRY

Could you please look at this?

[1] https://www.postgresql.org/message-id/72705e42-42d1-ac6e-e7d5-4baec8a0d2af%40gmail.com
[2] https://postgr.es/m/17967-cd21e34a314141b2@postgresql.org

Best regards,
Alexander

view thread (38+ messages)

Message-ID: <2b319458-63f4-1396-f23e-b8353acfa2aa@gmail.com>
Permalink:  ../2b319458-63f4-1396-f23e-b8353acfa2aa@gmail.com/
Also on:    postgresql.org/message-id/2b319458-63f4-1396-f23e-b8353acfa2aa@gmail.com

 · 

reply

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-hackers@postgresql.org
  Cc: exclusion@gmail.com, andres@anarazel.de, hlinnaka@iki.fi, amborodin86@gmail.com, michail.nikolaev@gmail.com, thomas.munro@gmail.com, boekewurm+postgres@gmail.com, jakub.wartak@enterprisedb.com, mark.dilger@enterprisedb.com
  Subject: Re: BUG: Postgres 14 + vacuum_defer_cleanup_age + FOR UPDATE + UPDATE
  In-Reply-To: <2b319458-63f4-1396-f23e-b8353acfa2aa@gmail.com>

* 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