pgsql: Work around perl bug in SvPVutf8().

Lists: pgsql-committerspgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Work around perl bug in SvPVutf8().
Date: 2012-01-05 17:05:39
Message-ID: E1Riql1-0006yO-Vr@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Work around perl bug in SvPVutf8().

Certain things like typeglobs or readonly things like $^V cause
perl's SvPVutf8() to die nastily and crash the backend. To avoid
that bug we make a copy of the object, which will subsequently be
garbage collected.

Back patched to 9.1 where we first started using SvPVutf8().

Per -hackers discussion. Original problem reported by David Wheeler.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2abefd9a92f3c02ad4f6030ac1578bbf314db368

Modified Files
--------------
src/pl/plperl/plperl_helpers.h | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Work around perl bug in SvPVutf8().
Date: 2012-01-05 22:06:54
Message-ID: 4F061EFE.1070203@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 01/05/2012 12:05 PM, Andrew Dunstan wrote:
> Work around perl bug in SvPVutf8().
>
> Certain things like typeglobs or readonly things like $^V cause
> perl's SvPVutf8() to die nastily and crash the backend. To avoid
> that bug we make a copy of the object, which will subsequently be
> garbage collected.
>
> Back patched to 9.1 where we first started using SvPVutf8().
>
> Per -hackers discussion. Original problem reported by David Wheeler.
>

Ugh. This broke the regression tests. I'll get it fixed.

cheers

andrew


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Work around perl bug in SvPVutf8().
Date: 2012-01-05 22:30:09
Message-ID: 1325802590-sup-3427@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers


Excerpts from Andrew Dunstan's message of jue ene 05 19:06:54 -0300 2012:
>
> On 01/05/2012 12:05 PM, Andrew Dunstan wrote:
> > Work around perl bug in SvPVutf8().
> >
> > Certain things like typeglobs or readonly things like $^V cause
> > perl's SvPVutf8() to die nastily and crash the backend. To avoid
> > that bug we make a copy of the object, which will subsequently be
> > garbage collected.
> >
> > Back patched to 9.1 where we first started using SvPVutf8().
> >
> > Per -hackers discussion. Original problem reported by David Wheeler.
> >
>
> Ugh. This broke the regression tests. I'll get it fixed.

Yeah, notice that it's causing crashes, not just different results.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Work around perl bug in SvPVutf8().
Date: 2012-01-05 22:55:55
Message-ID: 4F062A7B.8090109@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 01/05/2012 05:30 PM, Alvaro Herrera wrote:
> Excerpts from Andrew Dunstan's message of jue ene 05 19:06:54 -0300 2012:
>> On 01/05/2012 12:05 PM, Andrew Dunstan wrote:
>>> Work around perl bug in SvPVutf8().
>>>
>>> Certain things like typeglobs or readonly things like $^V cause
>>> perl's SvPVutf8() to die nastily and crash the backend. To avoid
>>> that bug we make a copy of the object, which will subsequently be
>>> garbage collected.
>>>
>>> Back patched to 9.1 where we first started using SvPVutf8().
>>>
>>> Per -hackers discussion. Original problem reported by David Wheeler.
>>>
>> Ugh. This broke the regression tests. I'll get it fixed.
> Yeah, notice that it's causing crashes, not just different results.

Indeed. It looks like the garbage collection was a bit too eager, so I
have a fix where we control when it gets done.

cheers

andrew