Re: BUG #19078: Segfaults in tts_minimal_store_tuple() following pg_upgrade
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Yuri Zamyatin <yuri@yrz.am>
Cc: Jeff Davis <pgsql@j-davis.com>, Amit Langote <amitlangote09@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2025-10-17T21:45:06Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix reset of incorrect hash iterator in GROUPING SETS queries
- 0b6a02f0355c 18.1 landed
- 5c0a20003b43 19 (unreleased) landed
-
Fix EPQ crash from missing partition directory in EState
- 1296dcf18b1c 18.1 landed
- 905e932f0922 19 (unreleased) landed
On Sat, 18 Oct 2025 at 10:25, David Rowley <dgrowleyml@gmail.com> wrote: > If this fails then maybe we're using the wrong iterator somewhere in > nodeAgg.c. I can't see any other way for the iterator's 'end' field to > be bigger than the table's size. I started looking for places that this could happen and quickly found the following code: /* * Switch to next grouping set, reinitialize, and restart the * loop. */ select_current_set(aggstate, nextset, true); perhash = &aggstate->perhash[aggstate->current_set]; ResetTupleHashIterator(hashtable, &perhash->hashiter); The hash table and the iterator for each set are meant to be in the same AggStatePerHash, but the above code moves to the next set, changes the "perhash" then resets the next iterator using the previous hash table. I think that line needs to be: ResetTupleHashIterator(perhash->hashtable, &perhash->hashiter); David