Re: create partition table caused server crashed with self-referencing foreign key

From: amul sul <sulamul(at)gmail(dot)com>
To: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create partition table caused server crashed with self-referencing foreign key
Date: 2020-04-22 08:10:50
Message-ID: CAAJ_b94e_tZTCj6mAdtYKq_SGAeTGQVA1oi+G=tz7HB8RF2HQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 22, 2020 at 1:21 PM Rajkumar Raghuwanshi <
rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com> wrote:

> Hi,
>
> Getting a server crash while creating partition table which have
> self-referencing foreign key
>
> postgres=# CREATE TABLE part1 (c1 int PRIMARY KEY, c2 int REFERENCES
> part1) PARTITION BY LIST (c1);
> CREATE TABLE
> postgres=# CREATE TABLE part1_p1 PARTITION OF part1 FOR VALUES IN (1);
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
>
> --stack-trace
> [edb(at)localhost bin]$ gdb -q -c data/core.16883 postgres
> Core was generated by `postgres: edb postgres [local] CREATE TABLE
> '.
> Program terminated with signal 6, Aborted.
> #0 0x00000039212324f5 in raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
> Missing separate debuginfos, use: debuginfo-install
> keyutils-libs-1.4-5.el6.x86_64 krb5-libs-1.10.3-65.el6.x86_64
> libcom_err-1.41.12-24.el6.x86_64 libgcc-4.4.7-23.el6.x86_64
> libselinux-2.0.94-7.el6.x86_64 openssl-1.0.1e-58.el6_10.x86_64
> zlib-1.2.3-29.el6.x86_64
> (gdb) bt
> #0 0x00000039212324f5 in raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #1 0x0000003921233cd5 in abort () at abort.c:92
> #2 0x0000000000acd16a in ExceptionalCondition (conditionName=0xc32310
> "numfks == attmap->maplen", errorType=0xc2ea23 "FailedAssertion",
> fileName=0xc2f0bf "tablecmds.c", lineNumber=9046) at assert.c:67
>

Looks like this assertion is incorrect, I guess it should have check
numfks <= attmap->maplen instead.

Regards,
Amul

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-04-22 08:57:34 Re: create partition table caused server crashed with self-referencing foreign key
Previous Message Rajkumar Raghuwanshi 2020-04-22 07:50:55 create partition table caused server crashed with self-referencing foreign key