Re: BUG #5323: plperl and plperlu interaction segfaults - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5323: plperl and plperlu interaction segfaults
Date
Msg-id 603c8f071002111947h263c61c6x61f5ddf62313d171@mail.gmail.com
Whole thread Raw
In response to Re: BUG #5323: plperl and plperlu interaction segfaults  (Alexey Klyukin <alexk@commandprompt.com>)
Responses Re: BUG #5323: plperl and plperlu interaction segfaults  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
On Thu, Feb 11, 2010 at 3:12 PM, Alexey Klyukin <alexk@commandprompt.com> wrote:
>> I think this might be the same problem previously discussed here:
>> http://archives.postgresql.org/pgsql-bugs/2010-01/msg00224.php
>
> Seems to be the same problem. Backtrace I'm getting on 8.4 is almost identical to the one at the end of this post:
> http://archives.postgresql.org/pgsql-bugs/2010-01/msg00144.php
>
>> Does that patch fix it?
> The problem doesn't appear on 9.0 alpha with that patch committed.

It looks like the plperl.c change applies cleanly back to 8.2, though
I haven't yet verified that it actually fixes the problem on all those
branches.  8.1 does nothing at all instead of decrementing the
reference count:

-                       /* need we delete old entry? */
+                       hash_search(plperl_proc_hash, internal_proname,
+                                               HASH_REMOVE, NULL);
+                       if (prodesc->reference)
+                               SvREFCNT_dec(prodesc->reference);
+                       free(prodesc->proname);
+                       free(prodesc);

I am not inclined to apply the additional regression tests, even on HEAD.

...Robert

pgsql-bugs by date:

Previous
From: Koichi Suzuki
Date:
Subject: Re: [GENERAL] [HACKERS] Bug on pg_lesslog
Next
From: Robert Haas
Date:
Subject: Re: BUG #5323: plperl and plperlu interaction segfaults