Skip site navigation (1) Skip section navigation (2)

Re: BUG #5835: PL/Python crashes

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Julien Demoor <jdemoor(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5835: PL/Python crashes
Date: 2011-01-14 06:33:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Thu, Jan 13, 2011 at 06:57, Julien Demoor <jdemoor(at)gmail(dot)com> wrote:
> The following bug has been logged online:
> Bug reference:      5835
> Logged by:          Julien Demoor
> Email address:      jdemoor(at)gmail(dot)com
> PostgreSQL version: 9.0.2
> Operating system:   Ubuntu Linux
> Description:        PL/Python crashes
> Details:

> 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;

It looks like we are not incrementing a reference count for NULL
entries in an array.  The attached fixes it for me.  I did look for
other places where we might have missed this and did not find any.  (
the PyDict_SetItemString() that use Py_None look fishy, but apparently
work ).

Can you see if it fixes it for you?

Attachment: plpython.patch
Description: text/x-patch (396 bytes)

In response to


pgsql-bugs by date

Next:From: Tyler KellenDate: 2011-01-14 08:07:25
Subject: BUG #5838: tables of the same name in different schemas
Previous:From: Craig RingerDate: 2011-01-14 06:23:23
Subject: Re: BUG #5829: No buffer Space Available(maximum connection reached?) from postgres edb driver

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group