Re: [PATCH] fix segfault with DO and plperl/plperlu - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] fix segfault with DO and plperl/plperlu
Date
Msg-id 25378.1271618259@sss.pgh.pa.us
Whole thread Raw
In response to [PATCH] fix segfault with DO and plperl/plperlu  (Alex Hunsaker <badalex@gmail.com>)
Responses Re: [PATCH] fix segfault with DO and plperl/plperlu  (Alex Hunsaker <badalex@gmail.com>)
List pgsql-hackers
Alex Hunsaker <badalex@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


pgsql-hackers by date:

Previous
From: Josh Kupershmidt
Date:
Subject: Re: patch: Distinguish between unique indexes and unique constraints
Next
From: David Fetter
Date:
Subject: Re: testing HS/SR - 1 vs 2 performance