Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-22 Thread Alvaro Herrera
David E. Wheeler wrote: > On Dec 21, 2009, at 9:04 PM, Andrew Dunstan wrote: > > > I cannot reproduce this. I tested with perl 5.10.1 which is the latest > > reported stable release at , on an > > 8.4.2 UTF8 database, and with the same Safe and Encode module

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-22 Thread David E. Wheeler
On Dec 21, 2009, at 9:04 PM, Andrew Dunstan wrote: > I cannot reproduce this. I tested with perl 5.10.1 which is the latest > reported stable release at , on an 8.4.2 > UTF8 database, and with the same Safe and Encode module versions as above. I've replicat

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread Andrew Dunstan
David E. Wheeler wrote: On Dec 21, 2009, at 2:34 PM, David E. Wheeler wrote: On Dec 21, 2009, at 2:13 PM, Tim Bunce wrote: You're using 5.8.8. In 5.10.0 $^V was changed to be an object. I'm working in that area. I'll look into it. While you're at it, I have a new problem:

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread David E . Wheeler
On Dec 21, 2009, at 2:34 PM, David E. Wheeler wrote: > On Dec 21, 2009, at 2:13 PM, Tim Bunce wrote: > >> You're using 5.8.8. In 5.10.0 $^V was changed to be an object. >> >> I'm working in that area. I'll look into it. > > While you're at it, I have a new problem: > >CREATE OR REPLACE FUN

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread David E. Wheeler
On Dec 21, 2009, at 2:13 PM, Tim Bunce wrote: > You're using 5.8.8. In 5.10.0 $^V was changed to be an object. > > I'm working in that area. I'll look into it. While you're at it, I have a new problem: CREATE OR REPLACE FUNCTION wtf( expression text ) RETURNS text LANGUAGE plpe

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread Tim Bunce
On Mon, Dec 21, 2009 at 02:46:17PM -0500, Andrew Dunstan wrote: > > > David E. Wheeler wrote: >> At least I think it's a segfault. This function returns a vstring: >> >> CREATE OR REPLACE FUNCTION wtf( >> ) RETURNS text LANGUAGE plperl IMMUTABLE STRICT AS $X$ >> return $^V; >> $X$; >> >> Here's

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread Andrew Dunstan
Peter Eisentraut wrote: On mån, 2009-12-21 at 14:46 -0500, Andrew Dunstan wrote: BTW, this should arguably not be an immutable function. You could replace the perl library, so it's not solely dependent on the input for the result. By this logic, no function could be immutable, becau

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread Peter Eisentraut
On mån, 2009-12-21 at 14:46 -0500, Andrew Dunstan wrote: > BTW, this should arguably not be an immutable function. You could > replace the perl library, so it's not solely dependent on the input > for > the result. By this logic, no function could be immutable, because you could replace the C l

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread David E. Wheeler
On Dec 21, 2009, at 11:46 AM, Andrew Dunstan wrote: > It's not doing that for me. Odd. > The plperl code has no way at all of knowing that the bytes you are returning > come from $^V. If you really want the version back, do what the perl docs > tell you and sprintf the value: It works fine if

Re: [HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread Andrew Dunstan
David E. Wheeler wrote: At least I think it's a segfault. This function returns a vstring: CREATE OR REPLACE FUNCTION wtf( ) RETURNS text LANGUAGE plperl IMMUTABLE STRICT AS $X$ return $^V; $X$; Here's what happens when I call it: try=# select wtf(); server closed the connection unexpect

[HACKERS] Segfault from PL/Perl Returning vstring

2009-12-21 Thread David E. Wheeler
At least I think it's a segfault. This function returns a vstring: CREATE OR REPLACE FUNCTION wtf( ) RETURNS text LANGUAGE plperl IMMUTABLE STRICT AS $X$ return $^V; $X$; Here's what happens when I call it: try=# select wtf(); server closed the connection unexpectedly This probably m