From: Tom Lane on
Alex Hunsaker <badalex(a)gmail.com> writes:
> If you do:
> # DO $do$ 1; $do$ LANGUAGE plperlu;
> # DO $do$ 1; $do$ LANGUAGE plperl;

> You get a segfault as we try to SvREFCNT_dec(...); for the wrong
> interpreter. To fix push down the restore_context() so that we do the
> above on the correct perl interpreter.

Hmm. I don't see a segfault on my machine, but I agree that this looks
bogus. I changed it to this order instead:

if (desc.reference)
SvREFCNT_dec(desc.reference);
current_call_data = save_call_data;
restore_context(oldcontext);

so as to keep the "state restore" operations together.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Alex Hunsaker on
On Sun, Apr 18, 2010 at 13:17, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
> Alex Hunsaker <badalex(a)gmail.com> writes:
>> You get a segfault as we try to SvREFCNT_dec(...);
>
> Hmm.  I don't see a segfault on my machine, but I agree that this looks
> bogus.  I changed it to this order instead:
> [ ... ]
> so as to keep the "state restore" operations together.

Even better Thanks!

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers