Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-20 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > loose_embedding[] and strict_embedding[] have several lines in > common. Should the common elements be in a separate string or > macro so they can be maintained in one place? Definitely, assuming you can do it without too much violence to the readability

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-20 Thread Michael Fuhr
On Sat, Aug 20, 2005 at 12:22:05AM -0400, Tom Lane wrote: > Would anyone like to explain what ::_plperl_to_pg_array is for, and > why it's only created by loose_embedding[] and not strict_embedding[]? loose_embedding[] and strict_embedding[] have several lines in common. Should the common element

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Sat, Aug 20, 2005 at 01:59:59AM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > My test cases now succeed where they had been failing. But if > > that's the problem, why are your systems behaving differently? > > Damifino. I have just found out that the HPPA 5.8.7 no thr

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > You might be on to something there. I just changed line 683 in > plperl.c to the following: > count = perl_call_pv((trusted ? "::mksafefunc" : "::mkunsafefunc"), > My test cases now succeed where they had been failing. But if > that's the problem,

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Fri, Aug 19, 2005 at 11:16:25PM -0600, Michael Fuhr wrote: > But this example crashes the backend if plperl.use_strict is enabled :-( The PL/Perl regression tests also fail if use_strict is enabled, mostly due to not using "my" in a few places. I'll work on a patch. -- Michael Fuhr

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Sat, Aug 20, 2005 at 01:14:02AM -0400, Tom Lane wrote: > One thing I was kind of wondering about (this will betray the fact > that I haven't really studied Perl since it was Perl 4) is what are > the namespace issues for ::mksafefunc? In particular, could the > inner invocation of foo() be exec

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > But this example crashes the backend if plperl.use_strict is enabled :-( I suspect the croak() in plperl_convert_to_pg_array (the C function) ought to be an ereport(). It looks like that is not called from inside the Perl environment, and so croak is pro

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Sat, Aug 20, 2005 at 12:22:05AM -0400, Tom Lane wrote: > Would anyone like to explain what ::_plperl_to_pg_array is for, and > why it's only created by loose_embedding[] and not strict_embedding[]? It looks like plperl_convert_to_pg_array() calls that Perl function to convert a Perl list refere

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > I see that both of your Perl version strings have "thread-multi" > whereas neither of mine do. I don't know if that's relevant, but > it's something different about the Perl builds. Hm. I also have a 5.8.7-no-threads Perl build on HPPA. I hadn't tried

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Sat, Aug 20, 2005 at 12:03:46AM -0400, Tom Lane wrote: > I'm wondering if this is Perl version dependent. I've tried with > > Fedora Core 3: > This is perl, v5.8.5 built for i386-linux-thread-multi > Darwin 10.4.2: > This is perl, v5.8.6 built for darwin-thread-multi-2level > > with no failur

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Tom Lane
[ eyeing current plperl code... ] Would anyone like to explain what ::_plperl_to_pg_array is for, and why it's only created by loose_embedding[] and not strict_embedding[]? Not that this looks to have any immediate impact on the problem at hand, but it still looks a tad broken.

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Tom Lane
I'm wondering if this is Perl version dependent. I've tried with Fedora Core 3: This is perl, v5.8.5 built for i386-linux-thread-multi Darwin 10.4.2: This is perl, v5.8.6 built for darwin-thread-multi-2level with no failures observed... what are you guys using? regards,

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Fri, Aug 19, 2005 at 09:03:48PM -0600, Michael Fuhr wrote: > Here's a summary of what I see on both systems: I mentioned this before but forgot to include it in the summary: * If I execute "SELECT foo()" before I execute "SELECT bar()" then I don't get the error. Here's my current test case

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Wed, Aug 17, 2005 at 11:37:58PM -0600, Michael Fuhr wrote: > With HEAD on Solaris 9/sparc I don't have to reconnect before the > SELECT to get the error (I tested both ways, with and without a > reconnect, and it made no difference). > I get the same results on FreeBSD 4.11-STABLE/x86 but I hav

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Michael Fuhr
On Fri, Aug 19, 2005 at 01:56:39PM -, Greg Sabino Mullane wrote: > > Tom Lane once mentioned that "Valgrind is fairly useless for debugging > > postgres," but has anybody tried it for this problem? > > I've got valgrind working, but not sure exactly how to use it to debug > this problem. What'

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-19 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Tom Lane once mentioned that "Valgrind is fairly useless for debugging > postgres," but has anybody tried it for this problem? I tried using > the FreeBSD port but it's having trouble (first I had to hack in > support for a system call, now it's t

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-18 Thread Michael Fuhr
On Thu, Aug 18, 2005 at 02:52:02PM -, Greg Sabino Mullane wrote: > Tom Lane asked: > > I could not duplicate this in either 8.0 or HEAD branches. It looks > > a bit like an old bug that we had in plperl, though. Are you sure your > > plperl.so is up to date? > > Looks like Michael is already

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-18 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane asked: > I could not duplicate this in either 8.0 or HEAD branches. It looks > a bit like an old bug that we had in plperl, though. Are you sure your > plperl.so is up to date? Looks like Michael is already far along, but yes, my plperl.s

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-17 Thread Michael Fuhr
On Thu, Aug 18, 2005 at 12:26:28AM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > Could this be another "depends on the junk on your stack" bug? > > Looks that way --- but I've still had no success in reproducing it, > either on x86/Linux or PPC/Darwin. Anyone have some var

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-17 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > Could this be another "depends on the junk on your stack" bug? Looks that way --- but I've still had no success in reproducing it, either on x86/Linux or PPC/Darwin. Anyone have some variant test cases? regards, tom lane ---

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-17 Thread Michael Fuhr
On Wed, Aug 17, 2005 at 06:49:11PM -0600, Michael Fuhr wrote: > On Wed, Aug 17, 2005 at 06:46:20PM -0400, Tom Lane wrote: > > "Greg Sabino Mullane" <[EMAIL PROTECTED]> writes: > > > ERROR: error from Perl function: creation of Perl function failed: > > > (in cleanup) Undefined subroutine &m

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-17 Thread Michael Fuhr
On Wed, Aug 17, 2005 at 06:46:20PM -0400, Tom Lane wrote: > "Greg Sabino Mullane" <[EMAIL PROTECTED]> writes: > > ERROR: error from Perl function: creation of Perl function failed: > > (in cleanup) Undefined subroutine &main::mksafefunc called at (eval 4) line > > 2. at (eval 4) line 2. >

Re: [BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-17 Thread Tom Lane
"Greg Sabino Mullane" <[EMAIL PROTECTED]> writes: > ERROR: error from Perl function: creation of Perl function failed: > (in cleanup) Undefined subroutine &main::mksafefunc called at (eval 4) line > 2. at (eval 4) line 2. I could not duplicate this in either 8.0 or HEAD branches. It looks

[BUGS] BUG #1831: plperl gives error after reconnect.

2005-08-17 Thread Greg Sabino Mullane
The following bug has been logged online: Bug reference: 1831 Logged by: Greg Sabino Mullane Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0.3 Operating system: Linux Description:plperl gives error after reconnect. Details: Tested on 8.0.1 and in current cv