pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: TupleDescAttr bounds checks
Date: Sat, 4 Apr 2026 17:00:00 +0300
Message-ID: <6f435023-8ab6-47c2-ba07-035d0c4212f9@gmail.com> (raw)
In-Reply-To: <CA+TgmoZgc1m5Z7RFf9U7s_DgXE8GqnOB95fEWurdKFMR_U2xpQ@mail.gmail.com>
References: <CA+TgmoacixUZVvi00hOjk_d9B4iYKswWP1gNqQ8Vfray-AcOCA@mail.gmail.com>
	<1628959.1774023745@sss.pgh.pa.us>
	<CA+TgmoaiPqnV2ePY-DyQUVGnK5sJ5ryPCDYpn_+1Ua4JwfoqRw@mail.gmail.com>
	<1631625.1774025167@sss.pgh.pa.us>
	<3429884.1774238081@sss.pgh.pa.us>
	<CA+TgmoZgc1m5Z7RFf9U7s_DgXE8GqnOB95fEWurdKFMR_U2xpQ@mail.gmail.com>

Hello Robert,

24.03.2026 12:45, Robert Haas wrote:
> On Sun, Mar 22, 2026 at 11:54 PM Tom Lane<tgl@sss.pgh.pa.us> wrote:
>>   Anyway, you should get this fix pushed.
> Done, and I'll plan to commit the other patches later today.

I've found a way to trigger the Assert added in c98ad086a:
CREATE TABLE t(i int);
COPY t FROM stdin WHERE tableoid > 0;
server closed the connection unexpectedly

(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007066d0e4527e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007066d0e288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x0000609680cc7fcf in ExceptionalCondition (
     conditionName=conditionName@entry=0x609680d2c104 "i >= 0 && i < tupdesc->natts",
     fileName=fileName@entry=0x609680d84568 "../../../src/include/access/tupdesc.h", lineNumber=lineNumber@entry=182)
     at assert.c:65
#6  0x00006096808c8f68 in TupleDescAttr (tupdesc=<optimized out>, i=<optimized out>)
     at ../../../src/include/access/tupdesc.h:182
#7  TupleDescAttr (i=<optimized out>, tupdesc=<optimized out>) at ../../../src/include/access/tupdesc.h:178
#8  DoCopy (pstate=0x6096a749dc90, stmt=0x6096a74ca120, stmt_location=0, stmt_len=40, processed=0x7ffd3b09b450) at 
copy.c:180
#9  0x0000609680b6b82a in standard_ProcessUtility (pstmt=0x6096a74ca1f0,
     queryString=0x6096a74c9520 "COPY t FROM stdin WHERE tableoid > 0;", readOnlyTree=<optimized out>,
     context=PROCESS_UTILITY_TOPLEVEL, params=0x0, queryEnv=0x0, dest=0x6096a74ca5b0, qc=0x7ffd3b09b6f0) at utility.c:743
#10 0x0000609680b6990c in PortalRunUtility (portal=portal@entry=0x6096a756a070, pstmt=pstmt@entry=0x6096a74ca1f0,
     isTopLevel=isTopLevel@entry=true, setHoldSnapshot=setHoldSnapshot@entry=false, dest=dest@entry=0x6096a74ca5b0,
     qc=qc@entry=0x7ffd3b09b6f0) at pquery.c:1148
...

Best regards,
Alexander

view thread (13+ messages)  latest in thread

Message-ID: <6f435023-8ab6-47c2-ba07-035d0c4212f9@gmail.com>
Permalink:  ../6f435023-8ab6-47c2-ba07-035d0c4212f9@gmail.com/
Also on:    postgresql.org/message-id/6f435023-8ab6-47c2-ba07-035d0c4212f9@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, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: TupleDescAttr bounds checks
  In-Reply-To: <6f435023-8ab6-47c2-ba07-035d0c4212f9@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