From: Julien Demoor <jdemoor@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #5835: PL/Python crashes
Date: Thu, 13 Jan 2011 13:57:29 GMT
Message-ID: <201101131357.p0DDvT8E039516@wwwmaster.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 5835
Logged by: Julien Demoor
Email address: jdemoor@gmail.com
PostgreSQL version: 9.0.2
Operating system: Ubuntu Linux
Description: PL/Python crashes
Details:
Description of the system on which the problem occurs:
======================================================
$ psql --version
psql (PostgreSQL) 9.0.2
$ uname -a
Linux <hostname> 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC
2010 i686 GNU/Linux
PostgreSQL packages obtained through
https://launchpad.net/~pitti/+archive/postgresql and installed with Ubuntu's
package manager.
Reproduced on two machines, both running the same OS and Postgres version.
One of the two runs the stock postgresql.conf.
Steps to reproduce the problem:
===============================
In psql, create a database and install PL/Python:
CREATE DATABASE test2;
\c test2
CREATE LANGUAGE plpython2u;
Run the following in psql:
BEGIN;
CREATE OR REPLACE FUNCTION test_none_3(a numeric[]) RETURNS numeric(12,4) AS
$$
return 1;
$$ LANGUAGE plpython2u;
SELECT test_none_3('{NULL, NULL, NULL}'::numeric[]) FROM
generate_series(1,244) ORDER BY generate_series DESC LIMIT 1;
ROLLBACK;
Transcript of what happens:
===========================
Full transcript:
$ psql -d test2
psql (9.0.2)
Type "help" for help.
test2=# BEGIN;
BEGIN
test2=# CREATE OR REPLACE FUNCTION test_none_3(a numeric[]) RETURNS
numeric(12,4) AS $$
test2$# return 1;
test2$# $$ LANGUAGE plpython2u;
SELCREATE FUNCTION
test2=# SELECT test_none_3('{NULL, NULL, NULL}'::numeric[]) FROM
generate_series(1,244) ORDER BY generate_series DESC LIMIT 1;
BACK;
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.
!> ROLLBACK;
You are currently not connected to a database.
!> ^D\q
In the server logs:
===================
Fatal Python error: deallocating None
2011-01-13 14:20:10 CET LOG: server process (PID 27747) was terminated by
signal 6: Aborted
2011-01-13 14:20:10 CET LOG: terminating any other active server processes
2011-01-13 14:20:10 CET WARNING: terminating connection because of crash of
another server process
2011-01-13 14:20:10 CET DETAIL: The postmaster has commanded this server
process to roll back the current transaction and exit, because another
server process exited abnormally and possibly corrupted shared memory.
2011-01-13 14:20:10 CET HINT: In a moment you should be able to reconnect
to the database and repeat your command.
2011-01-13 14:20:10 CET FATAL: the database system is in recovery mode
More tests to reproduce:
========================
Changing the constant array and the second parameter given to
generate_series() we get:
-- {NULL, NULL, NULL}: Crashes at 244 and more, but not less
-- {NULL, 12, NULL}: Crashes 366 and more, but not less
-- {NULL, NULL}: Crashes 366 and more, but not less
-- {NULL, 12}: Crashes at 730 and more, but not less
-- {NULL}: Crashes at 730 and more, but not less
-- {}: Doesn't crash even at 1'000'000
-- {12}: Doesn't crash even at 1'000'000
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: jdemoor@gmail.com
Subject: Re: BUG #5835: PL/Python crashes
In-Reply-To: <201101131357.p0DDvT8E039516@wwwmaster.postgresql.org>
References: <201101131357.p0DDvT8E039516@wwwmaster.postgresql.org>
* 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