Dave Page wrote:
On Wed, Jun 3, 2009 at 11:54 PM, Andrew Dunstan <and...@dunslane.net> wrote:
Update: the problem is apparently occurring during the call to perl_parse()
in plperl_init_interp().
Not sure if you saw the previous thread on this, but here's a
backtrace that gives some more detail:
http://archives.postgresql.org/pgsql-bugs/2009-05/msg00198.php
Well, that's not too easy to read, but anyway, I got to the bottom of
it. Turns out there's a change in the Perl embedding API that nobody
noticed. The attached patch worked for me on Windows. We'll need
something like this on other platforms I believe. I see via Google that
Debian is objecting to packages that call perl_parse without calling
PERL_SYS_INIT (or PERL_SYS_INIT3). I'm even wondering if we should
backpatch it.
Of course, that leaves the issue of the library name to be fixed, but
sufficient unto the day ...
cheers
andrew
Index: plperl.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plperl/plperl.c,v
retrieving revision 1.146
diff -c -r1.146 plperl.c
*** plperl.c 20 Feb 2009 10:39:19 -0000 1.146
--- plperl.c 3 Jun 2009 23:34:30 -0000
***************
*** 399,404 ****
--- 399,406 ----
"", "-e", PERLBOOT
};
+ int nargs = 3;
+
#ifdef WIN32
/*
***************
*** 447,454 ****
elog(ERROR, "could not allocate Perl interpreter");
perl_construct(plperl_held_interp);
perl_parse(plperl_held_interp, plperl_init_shared_libs,
! 3, embedding, NULL);
perl_run(plperl_held_interp);
if (interp_state == INTERP_NONE)
--- 449,459 ----
elog(ERROR, "could not allocate Perl interpreter");
perl_construct(plperl_held_interp);
+ #ifdef PERL_SYS_INIT
+ PERL_SYS_INIT(&nargs, (char ***) &embedding);
+ #endif;
perl_parse(plperl_held_interp, plperl_init_shared_libs,
! nargs, embedding, NULL);
perl_run(plperl_held_interp);
if (interp_state == INTERP_NONE)
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers