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

From Alexey Klyukin
Subject Re: BUG #5323: plperl and plperlu interaction segfaults
Date
Msg-id F5179A8D-B591-41A7-8F55-B3C1D2FEF127@commandprompt.com
Whole thread Raw
In response to Re: BUG #5323: plperl and plperlu interaction segfaults  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: BUG #5323: plperl and plperlu interaction segfaults  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
On Feb 12, 2010, at 6:21 AM, Robert Haas wrote:

> On Thu, Feb 11, 2010 at 10:47 PM, Robert Haas <robertmhaas@gmail.com> wro=
te:
>> 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
>>>=20
>>> Seems to be the same problem. Backtrace I'm getting on 8.4 is almost id=
entical to the one at the end of this post:
>>> http://archives.postgresql.org/pgsql-bugs/2010-01/msg00144.php
>>>=20
>>>> Does that patch fix it?
>>> The problem doesn't appear on 9.0 alpha with that patch committed.
>>=20
>> 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.
>=20
>=20
> Not sure where to go from here.  The prerequisite patch ("Various
> small improvements and cleanups for PL/Perl") is not suitable for
> backpatching, so I think someone needs to prepare a cut-down patch
> that addresses this issue in a more surgical fashion.  Also, would
> like to understand why the test case fails to fail on CVS HEAD.
>=20

Andrew Dunstan backpatched all versions down to 8.2 yesterday:
http://archives.postgresql.org/message-id/20100212043203.08C6E7541C6@cvs.po=
stgresql.org

This eliminated the bug on my system (checked on 8.4).
The problem appeared due to the context mismatch between the interpreter th=
at created the reference
to the compiled subroutine and the one that tried to decrement the referenc=
e count. Setting a correct context fixed the problem.

--
Alexey Klyukin                    http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc

pgsql-bugs by date:

Previous
From: "sourabh bansal"
Date:
Subject: BUG #5324: Server not starting
Next
From: Robert Haas
Date:
Subject: Re: BUG #5323: plperl and plperlu interaction segfaults