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


Hello,

while running a perl script in SUN Solaris OS, i faced the following error:

"ld.so.1: perl: fatal: relocation error: file /usr/perl5/5.8.4/bin/perl: symbol PL_sigfpe_saved: referenced symbol not found"

I am trying to run a perl script with perl 5.6.1 . It contains some shell commands with it.

1. when i run the same shell script commands in another test.pl script, with perl 5.8.4, there is no problem and it is running fine and giving the correct output.

2. When i executed the test.pl with 5.6.1 version of perl, it gave the correct answer. Only in this main perl script it is not working.
@INC = /usr/bin:/usr/sbin:/opt/csw/bin:/opt/csw/sbin:/usr/local/bin:/o +pt/nsr:/opt/nsr:/usr/atria/bin ./modules ./xerces/lib ./modules ./xerces/lib ./modules ./modules /ts +p/tqa/tools/5.6.1/lib/sun4-solaris-64int /tsp/tqa/tools/5.6.1/lib /us +r/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/ +site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/pe +rl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/pe +rl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl
Could you tell me what can be the error ??

Replies are listed 'Best First'.
Re: Perl version problem during execution of a script
by dave_the_m (Monsignor) on Oct 14, 2008 at 10:58 UTC
    what is your $LD_LIBRARY_PATH environment variable set to?

    Dave.

      There is no value set to his environment variable. Could you tell me what value to set fro this??
      -in_trouble
        It is correct that this variable has no value set.

        Can you show us exactly how you start (with perl 5.6.1) the two scripts: the test.pl that works, and the other that gives the startup error?

        Dave.

Re: Perl version problem during execution of a script
by rovf (Priest) on Oct 14, 2008 at 11:36 UTC

    The relocation error points to /usr/perl5/5.8.4/bin/perl, and it occurs only if you run it with perl 5.6.1. It looks like you are mixing the Perl of one version with something from 5.8.4. It could be that your environment is "broken" (LD_LIBRARY_PATH was already mentioned), or maybe the installation of Perl 5.6.1 is already flawed - see for example here.

    -- 
    Ronald Fischer <ynnor@mm.st>

      I understand that there can be a mixing of the versions. But, this is slightly unconvincing because, my perl script already populates @INC variable in the start of the script. Thus, the execution has to go with 5.6.1 now. The prolem here is when i do the same in a small test script and execute it with 5.6.1 it works. but not in the actual perl script. How can that be???

      Also, there are other perl scripts, containing shell commands and getting executed with perl 5.6.1. SO, i wouldn't say that the installation of 5.6.1 is flawed.

      Can there be any other reason???

        Well, if there is no "mixing of versions", we could not see an error message mentioning perl 5.8 when running in a 5.6.1 environment, can it?

        The fact that the error only occurs in a one script, but not in others, could have several reasons. First, as it seems to be a problem with a shared lib, maybe the library is only located at run time (for instance, when your script dynamically loads a module which only *then* needs that symbol, or if you shell out from your script using system, and accidentally call an external perl program using perl 5.8, but now from within a 5.6.1 environment.

        Can you located the statement(s) in the code where the error occurs?

        -- 
        Ronald Fischer <ynnor@mm.st>