Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does Perl 5.8.0 contain symbol Perl_sv_2pv?

0 views
Skip to first unread message

DirtyBear

unread,
Jul 14, 2008, 10:52:30 PM7/14/08
to
Hi friends,

Perl 5.8.0 seems a bit strange. I encounterred a trouble in my dynamic
library which uses this symbol of Perl:
ld.so.1: perl: fatal: relocation error: file /opt/mylib/libAPIPerl.so:
symbol Perl_sv_2pv: referenced symbol not found
Killed

Solaris 9/10
Perl was built from source code tar ball.

zcyds4d6-85> perl -v
This is perl, v5.8.0 built for sun4-solaris-64int
zcyds4d6-89> nm /bin/perl | grep -i Perl_sv_2pv
[2590] | 597800| 2980|FUNC |GLOB |0 |11 |
Perl_sv_2pv_flags
[2234] | 597504| 28|FUNC |GLOB |0 |11 |
Perl_sv_2pv_nolen
[2106] | 601164| 76|FUNC |GLOB |0 |11 |Perl_sv_2pvbyte
[921] | 601140| 24|FUNC |GLOB |0 |11 |
Perl_sv_2pvbyte_nolen
[1338] | 601264| 76|FUNC |GLOB |0 |11 |Perl_sv_2pvutf8
[1487] | 601240| 24|FUNC |GLOB |0 |11 |
Perl_sv_2pvutf8_nolen

But from perl5.6.1 to perl 5.8.8, I can find the reference in every
release except 5.8.0.
Perl5.8.4 sample:
nm /usr/local/bin/perl | grep -i Perl_sv_2pv
[1926] | 596152| 28|FUNC |GLOB |0 |9 |Perl_sv_2pv
[1540] | 596180| 2872|FUNC |GLOB |0 |9 |
Perl_sv_2pv_flags
[1677] | 595996| 28|FUNC |GLOB |0 |9 |
Perl_sv_2pv_nolen
[2571] | 599204| 132|FUNC |GLOB |0 |9 |Perl_sv_2pvbyte
[2454] | 599180| 24|FUNC |GLOB |0 |9 |
Perl_sv_2pvbyte_nolen
[2084] | 599360| 132|FUNC |GLOB |0 |9 |Perl_sv_2pvutf8
[2450] | 599336| 24|FUNC |GLOB |0 |9 |
Perl_sv_2pvutf8_nolen


The Perl 5.8.0 delta ( http://search.cpan.org/dist/perl/pod/perl58delta.pod#Perl_get_sv
) said that it that is no more the case. what does it mean?
Perl_get_sv
You may get errors like 'Undefined symbol "Perl_get_sv"' or "can't
resolve symbol 'Perl_get_sv'", or the symbol may be "Perl_sv_2pv".
This probably means that you are trying to use an older shared Perl
library (or extensions linked with such) with Perl 5.8.0 executable.
Perl used to have such a subroutine, but that is no more the case.
Check your shared library path, and any shared Perl libraries in those
directories.

Sometimes this problem may also indicate a partial Perl 5.8.0
installation, see "Mac OS X dyld undefined symbols"

I also found a link about this issue, but it did not say whether this
symbol was kept in Perl 5.8.0.
http://www.gossamer-threads.com/lists/engine?do=post_view_printable;post=6902;list=modperl

Why is Perl 5.8.0 so strange? How to resolve this problem?

Thanks in advance.

Ben Bullock

unread,
Jul 15, 2008, 8:55:11 AM7/15/08
to
On Mon, 14 Jul 2008 19:52:30 -0700, DirtyBear wrote:

> Why is Perl 5.8.0 so strange? How to resolve this problem?

Perhaps I'm making a stupid comment, because possibly you know that Perl
is now on 5.10 and the 5.8 version of Perl is at version 5.8.8. I know
that 5.8.0 had some bugs in it. If you want to build Perl from source, it
might be a wise idea to build a more recent version.

sisyphus

unread,
Jul 15, 2008, 9:09:13 AM7/15/08
to
On Jul 15, 12:52 pm, DirtyBear <zx.zhangxi...@gmail.com> wrote:
> Hi friends,
>
> Perl 5.8.0 seems a bit strange. I encounterred a trouble in my dynamic
> library which uses this symbol of Perl:
> ld.so.1: perl: fatal: relocation error: file /opt/mylib/libAPIPerl.so:
> symbol Perl_sv_2pv: referenced symbol not found
.
.

> Why is Perl 5.8.0 so strange? How to resolve this problem?
>

I find the same thing on Win32. Seems that Perl_sv_2pv was removed for
perl 5.8.0, and then reinstated for subsequent builds. (I don't know
why.)
If you need to have your code work on perl 5.8.0 then one way would be
to use something other than Perl_sv_2pv to do the job.

The perl 5.8.8 source file sv.h contains:

#define sv_2pv(sv, lp) sv_2pv_flags(sv, lp, SV_GMAGIC)

So you may just need to replace all of your "sv_2pv(sv, lp)" calls
with "sv_2pv_flags(sv, lp, SV_GMAGIC)". That's assuming that
sv_2pv_flags exists throughout the full range of perl versions that
you need to support. (I haven't checked to see whether that's the
case.)

Cheers,
Rob

Ben Morrow

unread,
Jul 15, 2008, 9:17:34 AM7/15/08
to

Quoth DirtyBear <zx.zha...@gmail.com>:

>
> Perl 5.8.0 seems a bit strange. I encounterred a trouble in my dynamic
> library which uses this symbol of Perl:
> ld.so.1: perl: fatal: relocation error: file /opt/mylib/libAPIPerl.so:
> symbol Perl_sv_2pv: referenced symbol not found
> Killed
>
<snip>

> But from perl5.6.1 to perl 5.8.8, I can find the reference in every
> release except 5.8.0.

From perl581delta:

| APIs obsoleted in Perl 5.8.0, like sv_2pv, sv_catpvn, sv_catsv,
| sv_setsv, are again available.

So it seems that removing these entry points, like a number of other
changes made in 5.8.0, was considered a bad idea and reverted for 5.8.1.
5.8.0 is well known to be quite buggy; it's a bad idea to use it. Unless
you have a strong reason not to, you should be using 5.8.8; otherwise,
use 5.8.1.

Ben

--
BEGIN{*(=sub{$,=*)=sub{print@_};local($#,$;,$/)=@_;for(keys%{ #b...@morrow.me.uk
$#}){/m/&&next;**=${$#}{$_};/(\w):/&&(&(($#.$_,$;.$+,$/),next);$/==\$*&&&)($;.$
_)}};*_=sub{for(@_){$|=(!$|||$_||&)(q) )));&((q:\:\::,q,,,\$_);$_&&&)("\n")}}}_
$J::u::s::t, $a::n::o::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $,

0 new messages