Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Perl segfaults and wont run. Something to do with libperl.so

by holpot (Initiate)
on Jul 11, 2017 at 14:49 UTC ( [id://1194823]=perlquestion: print w/replies, xml ) Need Help??

holpot has asked for the wisdom of the Perl Monks concerning the following question:

I'm using a 64 bit CentOS 6.8 and when I first tried to run Perl v5.10.1 it would say

/usr/bin/perl: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory

I found this library in /usr/lib64/perl5/CORE/libperl.so, but when I added /usr/lib64/perl5/CORE/ to LD_LIBRARY_PATH and tried running perl again I got a seg fault.

Then I tried moving the library into /lib64/ (where ldd shows it picked up all the other libraries it needs) but it still seg faults. I also checked the permissions on the library file and they are fine. This is just one host and perl runs fine on other identical hosts.

Please help, I'm out of ideas. Many thanks.

Replies are listed 'Best First'.
Re: Perl segfaults and wont run. Something to do with libperl.so
by shmem (Chancellor) on Jul 11, 2017 at 15:41 UTC

    Read man rpm. Via rpm, identify the rpm package /usr/bin/perl belongs to (rpm -qf /usr/bin/perl). Run rpm -ql $package to get at the location of libperl.so and check whether it is where expected. Run rpm -verify (or such, consult the manual page of rpm) to verify the integrity of libperl.so found in the output of the package list. If things are wrong (as I suppose they are) re-install the perl core package.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

      Thank you. I removed then reinstalled perl and that seem to fix it.

Re: Perl segfaults and wont run. Something to do with libperl.so
by sundialsvc4 (Abbot) on Jul 11, 2017 at 20:07 UTC

    Glad to know that this fixed it.

    In addition, you probably should know that Linux systems use a “loader cache,” which is re-populated by the sudo ldconfig command.   Installer packages normally run this command for you, but, should you be mucking-around with libraries yourself, you might need to run it.   Linux has a very flexible system by which applications (and libraries) can identify the libraries that they need, and the loader cache pre-calculates these answers so that a file-search does not have to ... and, indeed, does not ... occur.   When you “re-installed,” this undoubtedly caused this command to be run, possibly fixing the problem.   Anytime you see the loader saying that a library cannot be found when you know that it is there, rebuild the loader cache.

      This is a good advice, and I suspect people are downvoting this ad hominem, not ad posting.

      Cheers.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

        People might also be downvoting because it replies to the wrong node, as is a monk’s wont, and makes an odd artificial intelligence claim about Linux with its purported “system by which applications (and libraries) can identify the libraries that they need” and is also full “of” pointless, distracting, meaningless, misplaced—dare one® say, even, « Idiotic »—typesetting embellishments™. ˇΩ!

        The problem isn’t being always wrong as much as often being half right Thereby gaining some kind of credibility that is absolutely unearned. Even two-thirds right is a D- and an invitation to collect unemployment benefits.

        its off topic to discuss votes outside of pmdiscuss

        either way, spam should always be downvoted

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1194823]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-29 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found