Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 201431336FA7 for ; Sun, 16 Jan 2011 09:02:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 50311-07 for ; Sun, 16 Jan 2011 13:02:28 +0000 (UTC) X-Greylist: delayed 00:06:39.324563 by SQLgrey-1.7.6 Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [91.121.27.225]) by mail.postgresql.org (Postfix) with SMTP id 7D96013364DE for ; Sun, 16 Jan 2011 09:02:26 -0400 (AST) Received: (qmail 31297 invoked by uid 503); 16 Jan 2011 12:59:21 -0000 Received: from b9.ovh.net (HELO mail615.ha.ovh.net) (213.186.33.59) by 26.mail-out.ovh.net with SMTP; 16 Jan 2011 12:59:21 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 16 Jan 2011 14:55:44 +0200 Received: from ax113-1-87-88-167-164.dsl.club-internet.fr (HELO vostro1520) (87.88.167.164) by ns0.ovh.net with SMTP; 16 Jan 2011 14:55:42 +0200 From: "Julien Demoor" To: References: <201101131357.p0DDvT8E039516@wwwmaster.postgresql.org> In-Reply-To: Subject: Re: BUG #5835: PL/Python crashes Date: Sun, 16 Jan 2011 13:55:43 +0100 Message-ID: <001301cbb57c$b018ab50$104a01f0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuztQCOkRHfwcbkQ5iwtvT5hdqIFgBx4Mfg Content-Language: fr X-Ovh-Tracer-Id: 16919460850993622448 X-Ovh-Remote: 87.88.167.164 (ax113-1-87-88-167-164.dsl.club-internet.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.03 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1.929, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201101/117 X-Sequence-Number: 29139 I just tried and it works. Thank you very much. -----Message d'origine----- De : Alex Hunsaker [mailto:badalex@gmail.com]=20 Envoy=C3=A9 : vendredi 14 janvier 2011 07:33 =C3=80 : Julien Demoor Cc : pgsql-bugs@postgresql.org Objet : Re: [BUGS] BUG #5835: PL/Python crashes On Thu, Jan 13, 2011 at 06:57, Julien Demoor wrote: > > 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: > BEGIN; > CREATE OR REPLACE FUNCTION test_none_3(a numeric[]) RETURNS=20 > 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;=20 > ROLLBACK; 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?