Click here to get back home

Does Perl 5.8.0 contain symbol Perl_sv_2pv?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Does Perl 5.8.0 contain symbol Perl_sv_2pv? DirtyBear 07-14-2008
Posted by DirtyBear on July 14, 2008, 10:52 pm
Please log in for more thread options
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.

Posted by Ben Bullock on July 15, 2008, 8:55 am
Please log in for more thread options
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.

Posted by sisyphus on July 15, 2008, 9:09 am
Please log in for more thread options
> 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
=2E
=2E
> 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

Posted by Ben Morrow on July 15, 2008, 9:17 am
Please log in for more thread options

>
> 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;local($#,$;,$/)=@_;for(keys%{ #ben@morrow.me.uk
$#});/(\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, $,

Similar ThreadsPosted
perl extension promblem Can't find 'boot_' symbol in .so February 12, 2005, 11:02 am
Embeded Perl, Dynaloader, relocation error: undefined symbol: Perl_Tstack_sp_ptr June 24, 2005, 12:35 pm
"Undefined symbol" error in Perl module that loads other shared libs January 10, 2006, 10:29 pm
perl DB (pgsql)I: problems searching text strings with ' symbol (es d'ambrose) April 7, 2007, 7:30 pm
Global symbol "%Config" requires explicit package at at C:/Perl/lib/Time/Local .pm line 27. January 27, 2005, 9:33 pm
DBI and symbol table August 20, 2005, 3:12 pm
Can't locate Symbol.pm in @INC August 22, 2005, 10:26 am
Symbol tables August 23, 2005, 8:41 am
symbol table question June 7, 2005, 11:36 am
Symbol Table and References June 13, 2006, 10:34 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap