pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: BUG #17076: Server crashes on composing an error message about invalid modulus for a new table partition
Date: Mon, 28 Jun 2021 17:08:09 -0400
Message-ID: <342122.1624914489@sss.pgh.pa.us> (raw)
In-Reply-To: <17076-89a16ae835d329b9@postgresql.org>
References: <17076-89a16ae835d329b9@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> When executing the following query (based on create_table.sql):
> CREATE TABLE hash_parted (a int) PARTITION BY HASH (a);
> CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10,
> REMAINDER 0);
> CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200,
> REMAINDER 2);
> CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS
> 150, REMAINDER 3);

> Server crashes with the following stack:

So this is evidently the fault of efbfb6424, which isn't accounting
for the possibility that the next remainder has no associated partition.
That results in boundinfo->indexes[offset + 1] being -1, whereupon we
pass garbage to get_rel_name() and get back a NULL.

I think the patch has got more problems than that too, as it's far
from clear why the next remainder would have anything to do with the
next larger modulus.  IOW I suspect that when it does manage to print
a partition name without crashing, it's very likely to print the
wrong partition.

I'm inclined to think we should just revert efbfb6424, and maybe
try again some other time.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <342122.1624914489@sss.pgh.pa.us>
Permalink:  ../342122.1624914489@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/342122.1624914489@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, peter.eisentraut@enterprisedb.com
  Subject: Re: BUG #17076: Server crashes on composing an error message about invalid modulus for a new table partition
  In-Reply-To: <342122.1624914489@sss.pgh.pa.us>

* 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