public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alexander Lakhin <[email protected]>
To: Robert Haas <[email protected]>
To: Tom Lane <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: TupleDescAttr bounds checks
Date: Sat, 4 Apr 2026 17:00:00 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoZgc1m5Z7RFf9U7s_DgXE8GqnOB95fEWurdKFMR_U2xpQ@mail.gmail.com>
References: <CA+TgmoacixUZVvi00hOjk_d9B4iYKswWP1gNqQ8Vfray-AcOCA@mail.gmail.com>
	<[email protected]>
	<CA+TgmoaiPqnV2ePY-DyQUVGnK5sJ5ryPCDYpn_+1Ua4JwfoqRw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<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<[email protected]> 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 (10+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: TupleDescAttr bounds checks
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox