Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wSEcQ-0033C2-39 for pgsql-bugs@arkaria.postgresql.org; Wed, 27 May 2026 13:48:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wSEcN-008NVY-14 for pgsql-bugs@arkaria.postgresql.org; Wed, 27 May 2026 13:48:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wS6lR-0078DD-2O for pgsql-bugs@lists.postgresql.org; Wed, 27 May 2026 05:25:10 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wS6lP-00000001dll-3IhR for pgsql-bugs@lists.postgresql.org; Wed, 27 May 2026 05:25:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=nUsVAI0rGf1xNY5+qNwarmS4+rjW4GtywwXrs1wzRME=; b=TJ6kg5CQGU4HVEr6Nrds18rCMz L4mBHRz6dY2syZ/y7k/64DzJ/7y+qh10+G/vwj1t+52fQRwTh8UxG/SoBFM1jMcteF/Beuz19TqHt Vwqg9yOA4HIkDsqUbka1oz06cDNgcF/rEPErhY9xrzCalV0i+1RMQcpRxeIWkA6Eg2C02FP9OqSWP zfhd9YF7+8mQvpuhwMuWsC5jErwhY43DwDILPD/CrtdXSq7EJJXts+sTVih9YmCZjcSp+DFVw+eVn r2q8IemrUd07gOEatasqUYYj3Yvgg6akEjrprA9CbfrJLa6vKmQiQ4WALe90j0JazMY9wxnJnF79+ n7hrACHg==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wS6lN-0033MN-0C for pgsql-bugs@lists.postgresql.org; Wed, 27 May 2026 05:25:06 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wS6lL-009f6y-1J for pgsql-bugs@lists.postgresql.org; Wed, 27 May 2026 05:25:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19496: Assert("ItemPointerIsValid(pointer)") when using pageinspect To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: s.lyubimov@postgrespro.ru Reply-To: s.lyubimov@postgrespro.ru, pgsql-bugs@lists.postgresql.org Date: Wed, 27 May 2026 05:24:37 +0000 Message-ID: <19496-3472e9cce4a93d76@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19496 Logged by: Sergey Lyubimov Email address: s.lyubimov@postgrespro.ru PostgreSQL version: 18.4 Operating system: Ubuntu 24.04 Description: =20 Hi, I found an assertion failure in pageinspect. SQL: CREATE EXTENSION IF NOT EXISTS pageinspect; WITH page AS ( SELECT set_byte( set_byte( set_byte( set_byte( set_byte( set_byte( set_byte( set_byte(decode(repeat('00', 8192), 'hex'), 12, 40), 14, 248), 15, 31), 16, 248), 17, 31), 18, 4), 19, 32), 8190, 131) AS p ) SELECT * FROM gin_leafpage_items((SELECT p FROM page)); Backtrace: #0 __pthread_kill_implementation (no_tid=3D0, signo=3D6, threadid=3D) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=3D6, threadid=3D) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=3D, signo=3Dsigno@entry=3D= 6) at ./nptl/pthread_kill.c:89 #3 0x000076adb2a4527e in __GI_raise (sig=3Dsig@entry=3D6) at ../sysdeps/posix/raise.c:26 #4 0x000076adb2a288ff in __GI_abort () at ./stdlib/abort.c:79 #5 0x00005e7e26d0ccac in ExceptionalCondition (conditionName=3DconditionName@entry=3D0x5e7e26d76143 "ItemPointerIsValid(pointer)", fileName=3DfileName@entry=3D0x5e7e26db1c58 "../../../../src/include/storage/itemptr.h", lineNumber=3DlineNumber@entry=3D126) at assert.c:65 #6 0x00005e7e267a0dd8 in ItemPointerGetOffsetNumber (pointer=3D0x5e7e377646b8) at ../../../../src/include/storage/itemptr.h:126 #7 ItemPointerGetOffsetNumber (pointer=3D0x5e7e377646b8) at ../../../../src/include/storage/itemptr.h:124 #8 ginPostingListDecodeAllSegments (segment=3D, segment@entry=3D0x5e7e377646b8, len=3D, ndecoded_out=3Dndecoded_out@entry=3D0x7ffd3fe41100) at ginpostinglist.c:324 #9 0x00005e7e267a100b in ginPostingListDecode (plist=3Dplist@entry=3D0x5e7e377646b8, ndecoded_out=3Dndecoded_out@entry=3D0x7ffd3fe41100) at ginpostinglist.c:286 #10 0x000076adb35630ed in gin_leafpage_items (fcinfo=3D0x5e7e3775e6c0) at ginfuncs.c:264 #11 0x00005e7e2699309d in ExecMakeTableFunctionResult (setexpr=3D0x5e7e3772e7f0, econtext=3D0x5e7e3772e690, argContext=3D, expectedDesc=3D0x5e7e3772f240, randomAccess=3Dfalse) at execSRF.c:235 #12 0x00005e7e269a7d7d in FunctionNext (node=3D0x5e7e3772e480) at nodeFunctionscan.c:95 #13 0x00005e7e26987a2b in ExecProcNode (node=3D0x5e7e3772e480) at ../../../src/include/executor/executor.h:327 #14 ExecutePlan (queryDesc=3D0x5e7e3762f480, operation=3DCMD_SELECT, sendTuples=3Dtrue, numberTuples=3D0, direction=3D, dest=3D0x5e7e3775b778) at execMain.c:1736 #15 standard_ExecutorRun (queryDesc=3D0x5e7e3762f480, direction=3D, count=3D0) at execMain.c:377 #16 0x00005e7e26ba1c58 in PortalRunSelect (portal=3Dportal@entry=3D0x5e7e376a55f0, forward=3Dforward@entry=3Dtrue, co= unt=3D0, count@entry=3D9223372036854775807, dest=3Ddest@entry=3D0x5e7e3775b778) at pquery.c:917 #17 0x00005e7e26ba3316 in PortalRun (portal=3Dportal@entry=3D0x5e7e376a55f0, count=3Dcount@entry=3D9223372036854775807, isTopLevel=3DisTopLevel@entry=3D= true, dest=3Ddest@entry=3D0x5e7e3775b778, altdest=3Daltdest@entry=3D0x5e7e3775b77= 8, qc=3Dqc@entry=3D0x7ffd3fe41500) at pquery.c:761 #18 0x00005e7e26b9eeaa in exec_simple_query ( query_string=3D0x5e7e37602450 "WITH page AS (\n SELECT set_byte(\n",= ' ' , "set_byte(\n", ' ' , "set_byte(\n", ' ' , "set_byte(\n", ' ' , "set_byte(\n", ' ' , "set_byte(\n", ' ' , "set_by"...) at postgres.c:1290 #19 0x00005e7e26ba0aa4 in PostgresMain (dbname=3D, username=3D) at postgres.c:4856 #20 0x00005e7e26b9aa53 in BackendMain (startup_data=3D, startup_data_len=3D) at backend_startup.c:124 #21 0x00005e7e26ad6371 in postmaster_child_launch (child_type=3D, child_slot=3D1, startup_data=3Dstartup_data@entry=3D0x7ffd3fe419b0, startup_data_len=3Dstartup_data_len@entry=3D24, client_sock=3Dclient_sock@entry=3D0x7ffd3fe419d0) at launch_backend.c:268 #22 0x00005e7e26ada052 in BackendStartup (client_sock=3D0x7ffd3fe419d0) at postmaster.c:3627 #23 ServerLoop () at postmaster.c:1728 #24 0x00005e7e26adbbc2 in PostmasterMain (argc=3Dargc@entry=3D3, argv=3Dargv@entry=3D0x5e7e375fc0b0) at postmaster.c:1415 #25 0x00005e7e2677232e in main (argc=3D3, argv=3D0x5e7e375fc0b0) at main.c:= 231 logfile: TRAP: failed Assert("ItemPointerIsValid(pointer)"), File: "../../../../src/include/storage/itemptr.h", Line: 126, PID: 1668693 postgres: packer postgres [local] SELECT(ExceptionalCondition+0x6d)[0x5d3ea15c813d] postgres: packer postgres [local] SELECT(ginPostingListDecodeAllSegments+0x1d8)[0x5d3ea10ac398] Branch: REL_18_STABLE (commit: 196b4b5) GCC version: 14.2.0 CONFIGURE =3D '--enable-debug' '--enable-cassert' postgres=3D# SELECT version(); version ---------------------------------------------------------------------------= --------------------------------- PostgreSQL 18.4 on x86_64-pc-linux-gnu, compiled by gcc-14 (Ubuntu 14.2.0-4ubuntu2~24.04.1) 14.2.0, 64-bit