pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Assertion failure with 6-dimensional array in PL/python
Date: Thu, 1 Oct 2020 00:06:07 +0300
Message-ID: <61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi> (raw)


create extension plpythonu;

-- from 'plpython_types' regression test
CREATE FUNCTION test_type_conversion_array_int4(x int4[]) RETURNS int4[] 
AS $$
plpy.info(x, type(x))
return x
$$ LANGUAGE plpythonu;

postgres=# SELECT * FROM test_type_conversion_array_int4(ARRAY [[[[[[ 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.
!?>

TRAP: FailedAssertion("!(ndim < 6)", File: "plpy_typeio.c", Line: 686)

The assertion looks like this:

	if (ARR_NDIM(array) == 0)
		return PyList_New(0);

	/* Array dimensions and left bounds */
	ndim = ARR_NDIM(array);
	dims = ARR_DIMS(array);
	Assert(ndim < MAXDIM);     <-----

I believe that's wrong, it should be "ndim <= MAXDIM". Looks like I 
introduced this in commit 94aceed317, in v10.

I'll go fix that...

- Heikki





Message-ID: <61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi>
Permalink:  ../61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi/
Also on:    postgresql.org/message-id/61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnaka@iki.fi
  Subject: Re: Assertion failure with 6-dimensional array in PL/python
  In-Reply-To: <61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi>
  References: <61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi>

* 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