Jump to content


p4perl on ubuntu - lookup symbol error for P4.so

p4perl linux p4api perl lookup symbol error

  • Please log in to reply
3 replies to this topic

#1 nomaed

nomaed

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 14 April 2015 - 02:57 PM

Hi.
I have Ubuntu 14.04 (64) installation on which I am trying to install p4perl, using perl v5.20.1 (built for x86_64-linux-gnu-thread-multi).
The reason for this is that I have a perl script that runs on another linux which depends RunAnnotate(), but it doesn't work on my device.


I downloaded the latest p4perl (2014.1/842847) and a matching p4api (2014.1/821990).
Creation of Makefile is fine, make and make install also look good. (make test fails however)

nomix:~$ perl -MP4 -e "print P4::Identify()"
.
.
.
Rev. P4PERL/LINUX32X86_64/2014.1/842847 (2014.1/821990 API) (2014/05/06).

However, when trying to init the P4 object I get errors:
nomix:~$ perl -MP4 -e 'use P4; my $p4 = new P4;'
*** Error in `perl': malloc(): memory corruption: 0x0000000001f877f0 ***
Aborted (core dumped)
nomix:~$ perl -MP4 -e 'use P4; my $p4 = P4->new'
perl: symbol lookup error: /usr/local/lib/x86_64-linux-gnu/perl/5.20.1/auto/P4/P4.so: undefined symbol: _ZN10CharSetApi6LookupEPKc

Now, if I build the same p4perl version with a newer p4api (2015.1/1028542), the build is fine even though there's a warning.
Rev. P4PERL/LINUX32X86_64/2014.1/842847 (2015.1/1028542 API) (2014/05/06).
But now, when trying to use $p4->Run('annotate', '-a', '-i', 'filename') on a file, I get absolutely nothing back from it. $p4->GetClient() and etc. do work and return a correct result.
Command line `p4 annotate` works fine, and also p4python's p4.run('annotate'...) with same p4api version works correctly.

test.pl:
#!/usr/bin/perl
use Data::Dumper;
use P4;
# print P4::Identify();
my $p4 = new P4;
$p4->Connect() or die("Unable to connect to perforce server");
my @annotate_lines = $p4->Run('annotate', '-a', '-i', 'find-line-origin');
print "Result:\n";
print Dumper(@annotate_lines);
print "---\n";

nomix:~$ ./test.pl
Result:
---

I have another linux with CentOS 6, and it has an old 2012.2 p4perl and p4api:
Rev. P4PERL/LINUX26X86_64/2012.2/525804 (2012.2/525804 API) (2012/09/19).
Everything works fine on that machine (perl v5.10.1).

So naturally I tried downloading and building 2012.2 p4perl and p4api on my Ubuntu, and it all worked, but then I get even worse result:
nomix:~$ perl -MP4 -e "print P4::Identify()"
Out of memory!


If anyone recognizes this problem, had similar issues, or might know what the hell is wrong, I would be very happy to get any help with it.
I'm not too good with either Perl or Linux systems (just started working on Linux recently) so I am very confused here.

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 15 April 2015 - 11:37 PM

Hello,

Thank you for the exact error messages you encountered along with version information. P4Perl must be built with the same compiler that was used to build Perl and P4Api (that also includes 32-bit vs 64-bit).

According to the release notes, P4Perl 2014.1 is not supported with the version of Perl 5.20 that you are using.

  http://www.perforce....p4perlnotes.txt
  The 2014.1 release of P4Perl is supported building from
  source with Perl 5.12, 5.14, and 5.16

  The P4Perl 32-bit Windows installer requires Perl 5.16 32-bit.
  The P4Perl 64-bit Windows installer requires Perl 5.16 64-bit.

The 2012.2 P4Perl/API compatibility is noted here in the release notes:

http://www.perforce....p4perlnotes.txt

API Compatibility

  The 2012.2 release of P4Perl supports the 2012.2 Perforce API.
  Older releases (down to 2008.2) might work but are not
  supported.

Perl Compatibility

  The 2012.2 release of P4Perl is supported building from
  source with Perl 5.12, 5.14, and 5.16

  The P4Perl 32-bit Windows installer requires Perl 5.14 32-bit.
  The P4Perl 64-bit Windows installer requires Perl 5.14 64-bit.


I also looked up bugs and we do not have any P4Perl bugs reporting any "out of memory" errors.

#3 nomaed

nomaed

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 16 April 2015 - 07:09 AM

Thank you P4Shimada for the reply.
I guess I totally missed that part where Perl 5.20 is not supported.
I'll switch to 5.16 and try again.

Thank you.

#4 nomaed

nomaed

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 16 April 2015 - 08:10 AM

I tried compiling with Perl 5.16.3 and Perl 5.14.1 and I got the same result.

with Perl 5.14.1 and p4api 2014.1
*** Error in `/usr/bin/perl': malloc(): memory corruption: 0x000000000247d730 ***
Aborted (core dumped)

with Perl 5.16.3 and p4api 2014.1
*** Error in `/usr/bin/perl': malloc(): memory corruption: 0x0000000002459f40 ***
Aborted (core dumped)

with Perl 5.16.3 and p4api 2014.2 or 2015.1:
Empty result from RunAnnotate()


Maybe, even though I had an older version of perl at the time, p4perl was still built using new perl libraries.
Is there a way for me to specify which perl libraries should be used?
For example, to use /usr/local/lib/perl5/5.16.3/ instead of /usr/local/lib/x86_64-linux-gnu/perl/5.20.1/ ?





Also tagged with one or more of these keywords: p4perl, linux, p4api, perl, lookup symbol error

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users