"Symbol lookup error: undefined symbol: Perl_Gthr_key_ptr" error on perl

Asked 1 years ago, Updated 1 years ago, 71 views

The perl script that used to work normally now produces the following error:

perl:symbol lookup error: /usr/local/lib64/perl5/auto/JSON/XS/XS.so:undefined symbol:Perl_Gthr_key_ptr

Therefore, when I try to install the library written in the error in CPAN, I get the following error:

cpan[1]>install JSON::XS       
CPAN: Storable loaded ok (v2.45)
Reading '/root/.cpan/Metadata'
  Database was generated on Fr, 09 Jan 2015 08:53:28 GMT
CPAN:LWP::UserAgent loaded ok (v6.06)
/usr/bin/perl:symbol lookup error: /usr/local/lib64/perl5/auto/Time/HiRes/HiRes.so:undefined symbol:Perl_Istack_sp_ptr

I don't know when this symptom started to appear even though it worked fine until the other day.
The server is AWS EC2 and the operating system is Linux.

Does anyone know the cause?

linux perl aws

2022-09-29 21:32

3 Answers

Look at the .so file with the error in the ldd command on Linux.
There should be a line inside that says not found.

I think the reason is probably Perl's different version library or common version library, so I can't find the symbol.
If you reinstall the library or header that says not found in ldd to match the version of Perl you are using, it will heal.

[March 18, 2015 EDIT]
It seems that the thread already exists in the AWS forum.
https://forums.aws.amazon.com/message.jspa?messageID=532885
Time:: It seems that you can fix it by forcing HiRes, but I think it's worth a try.

The Google search keyword was AWS s3fs perl symbol lookup error, and the above thread topped the list.


2022-09-29 21:32

Just like @SazaE, I encountered the problem of "perl scripts that used to work normally fail."The environment was the same, and I was using Amazon Linux from AWS.

In my case, the error displayed was as follows:

/usr/bin/perl:symbol lookup error:/usr/local/lib64/perl5/auto/version/vxs/vxs.so:undefined symbol:Perl_Gthr_key_ptr

The solution was found in the AWS Forum thread provided by @LainZero.

 sudo env PERL5 LIB=/usr/lib64/perl5/vendor_perl cpan-r

(Recompile all dynamically loaded modules)

The reason for the error is not known, as it may have been delayed in noticing that the error was occurring.

At the beginning of the script that was causing the error, we declared the use of the module as follows:

use Jcode;
use File::Basename;
use Data::Dumper;
use LWP::UserAgent;
use Archive:: Extract;
use Cwd;
use Cwd'abs_path';
use DBI;

I hope this information will help.Anyway, thank you very much!


2022-09-29 21:32

First of all, I strongly recommend that you back up immediately.
If it's EBS, I think you can take a snapshot from the management console.
For snapshots, see AWS Document for more information.

How about force install... when installing CPAN failed?
Note: http://jtes.net/2011/12/03/perl-perl_gthr_key_ptr-problems/

If the above doesn't work, restore it to EBS from the first snapshot you took and it will return to its original state.

Now, if you assume that s3fs is the cause, you can infer that the effect of the package with yum in front of it, so why don't you cancel yum when s3fs is put in sudo yum history undoid?

For id, enter a number of ID that appears when you run yum history list.

 ID | Command line | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
    32 | install xxxxx | 2014-10-0101:34 | Install | 5
    31 | update | 2014-09-1002:33 | Update | 22

In the above example, if you want to revoke ID 32, it is sudo yum history undo32.

If that doesn't work, please restore it from the snapshot again.(It's not a solution, but…)


2022-09-29 21:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.