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.
#!/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.