From: Justin Pryzby <pryzby@telsasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Ashutosh Sharma <ashu.coek88@gmail.com>
Cc: Maciek Sakrejda <m.sakrejda@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Date: Tue, 2 Aug 2022 17:04:16 -0500
Message-ID: <20220802220416.GC13682@telsasoft.com> (raw)
In-Reply-To: <2767668.1659476794@sss.pgh.pa.us>
References: <CAFiTN-uzLbV17OwcyJSLrEGEBF0YzMsRkobRD5Y_kE8M7xoAtw@mail.gmail.com>
<CA+TgmoZHDwEjPHO6RceWZZ5L1FeJ4_VEi0t39rnWFBAbnoq53w@mail.gmail.com>
<CAFiTN-sdxdSYObqO7-LYy=7tAB1zamT3trPq7ukfupKPMnjYdg@mail.gmail.com>
<CAFiTN-ujhw-ttQ9-1pdcXtSn3mxhKCBQYvQsq=hQHQZwSn4xjQ@mail.gmail.com>
<CAFiTN-tSUj56cyS6a88sgn3MWJBOA_VjEQfc7fZmWicKwijraA@mail.gmail.com>
<CA+TgmoYVDLtS0v6XNTk=xBVStjZu_XaS5FTY74neb_h8YOcF0w@mail.gmail.com>
<CA+TgmobUW9NQK7EJkV_0F87bqqq5BSHKiX2+wfthLcy4qA7YvQ@mail.gmail.com>
<20220802175043.GA13682@telsasoft.com>
<CA+TgmobZufK6PcCRpvjP6dJqOBO-woWZF0cqMHWGvzkbgeaBKw@mail.gmail.com>
<2767668.1659476794@sss.pgh.pa.us>
On Tue, Aug 02, 2022 at 05:46:34PM -0400, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > WARNING: problem in alloc set PortalContext: req size > alloc size for chunk 0x7f99508911f0 in block 0x7f9950890800
>
> This looks like nothing so much as the fallout from something scribbling
> past the end of an allocated palloc chunk, or perhaps writing on
> already-freed space. Perhaps running the test case under valgrind
> would help to finger the culprit.
Yeah but my test case is so poor that it's a chore ...
(Sorry for that, but it took me 2 days to be able to reproduce the problem so I
sent it sooner rather than looking for a better way ... )
I got this interesting looking thing.
==11628== Invalid write of size 8
==11628== at 0x1D12B3A: smgrsetowner (smgr.c:213)
==11628== by 0x1C7C224: RelationGetSmgr (rel.h:572)
==11628== by 0x1C7C224: RelationCopyStorageUsingBuffer (bufmgr.c:3725)
==11628== by 0x1C7C7A6: CreateAndCopyRelationData (bufmgr.c:3817)
==11628== by 0x14A4518: CreateDatabaseUsingWalLog (dbcommands.c:221)
==11628== by 0x14AB009: createdb (dbcommands.c:1393)
==11628== by 0x1D2B9AF: standard_ProcessUtility (utility.c:776)
==11628== by 0x1D2C46A: ProcessUtility (utility.c:530)
==11628== by 0x1D265F5: PortalRunUtility (pquery.c:1158)
==11628== by 0x1D27089: PortalRunMulti (pquery.c:1315)
==11628== by 0x1D27A7C: PortalRun (pquery.c:791)
==11628== by 0x1D1E33D: exec_simple_query (postgres.c:1243)
==11628== by 0x1D218BC: PostgresMain (postgres.c:4505)
==11628== Address 0x1025bc18 is 2,712 bytes inside a block of size 8,192 free'd
==11628== at 0x4033A3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==11628== by 0x217D7C2: AllocSetReset (aset.c:608)
==11628== by 0x219B57A: MemoryContextResetOnly (mcxt.c:181)
==11628== by 0x217DBD5: AllocSetDelete (aset.c:654)
==11628== by 0x219C1EC: MemoryContextDelete (mcxt.c:252)
==11628== by 0x21A109F: PortalDrop (portalmem.c:596)
==11628== by 0x21A269C: AtCleanup_Portals (portalmem.c:907)
==11628== by 0x11FEAB1: CleanupTransaction (xact.c:2890)
==11628== by 0x120A74C: AbortCurrentTransaction (xact.c:3328)
==11628== by 0x1D2158C: PostgresMain (postgres.c:4232)
==11628== by 0x1B15DB5: BackendRun (postmaster.c:4490)
==11628== by 0x1B1D799: BackendStartup (postmaster.c:4218)
==11628== Block was alloc'd at
==11628== at 0x40327F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==11628== by 0x217F0DC: AllocSetAlloc (aset.c:920)
==11628== by 0x219E4D2: palloc (mcxt.c:1082)
==11628== by 0x14A14BE: ScanSourceDatabasePgClassTuple (dbcommands.c:444)
==11628== by 0x14A1CD8: ScanSourceDatabasePgClassPage (dbcommands.c:384)
==11628== by 0x14A20BF: ScanSourceDatabasePgClass (dbcommands.c:322)
==11628== by 0x14A4348: CreateDatabaseUsingWalLog (dbcommands.c:177)
==11628== by 0x14AB009: createdb (dbcommands.c:1393)
==11628== by 0x1D2B9AF: standard_ProcessUtility (utility.c:776)
==11628== by 0x1D2C46A: ProcessUtility (utility.c:530)
==11628== by 0x1D265F5: PortalRunUtility (pquery.c:1158)
==11628== by 0x1D27089: PortalRunMulti (pquery.c:1315)
--
Justin
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: pryzby@telsasoft.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, dilipbalaut@gmail.com, andres@anarazel.de, ashu.coek88@gmail.com, m.sakrejda@gmail.com, bruce@momjian.us, alvherre@alvh.no-ip.org, andrew@dunslane.net, hlinnaka@iki.fi, pgsql-hackers@lists.postgresql.org
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
In-Reply-To: <20220802220416.GC13682@telsasoft.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