Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

How to obtain perl5/auto/IO/IO.so with global symbols?

by ek15 (Novice)
on Feb 21, 2018 at 23:25 UTC ( [id://1209703]=perlquestion: print w/replies, xml ) Need Help??

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

Hi all,

We have received two items from Company A relating to a piece of software: a source code package and an executable (created with PAR Packer). I have added to the source code and packaged everything with PAR Packer to create a new executable. Now, I am getting the error below. I have found that the IO.so in my PAR-Packed executable has no global symbols when I check it with 'nm -g IO.so'. On the other hand, the IO.so found in the executable from Company A does have global symbols (including the missing boot_IO symbol) when I check it with 'nm -g IO.so'.

The perl-5.16.3 RPM which I have installed through yum on my dev machine will only install IO.so without the global symbols. How can I get IO.so with global symbols?

Thanks, Erick

[root@ektest1 DarkEther-v1.15.3]# ./switchscan local/mlnx cfgfile=192. +168.20.141.cfg 192.168.20.141 Can't find 'boot_IO' symbol in /tmp/par-726f6f74/cache-b7a72e3a0413c42 +480d6dae1f533764a0bf93415/b1934410.so at /usr/local/share/perl5/PAR/Heavy.pm line 78. Compilation failed in require at /usr/lib64/perl5/IO/Handle.pm line 26 +6. BEGIN failed--compilation aborted at /usr/lib64/perl5/IO/Handle.pm lin +e 266. Compilation failed in require at /usr/lib64/perl5/IO/Seekable.pm line +101. BEGIN failed--compilation aborted at /usr/lib64/perl5/IO/Seekable.pm l +ine 101. Compilation failed in require at /usr/lib64/perl5/IO/File.pm line 133. BEGIN failed--compilation aborted at /usr/lib64/perl5/IO/File.pm line +133. Compilation failed in require at -e line 138.

Replies are listed 'Best First'.
Re: How to obtain perl5/auto/IO/IO.so with global symbols?
by stevieb (Canon) on Feb 22, 2018 at 01:12 UTC

    Are you testing the packaging/unpackaging on each destined system type you're wanting to run it on?

    What OS did you package it on (ie. OS info), and which one are you running it on?

    An overall explanation of your larger intentions would help here. If this is a case where you tested it once and hoped for the best and it failed, please let us know. Either way, you need to provide info on the deployment OS along with any other pertinent details.

      Hi, the build OS and the test OS are the same (Centos 7.2). Let me know what else you would consider pertinent info, I will be happy to provide it.

Re: How to obtain perl5/auto/IO/IO.so with global symbols?
by swl (Parson) on Feb 22, 2018 at 08:11 UTC

    Also, which version of PAR::Packer are you using and did they use?

    A packed executable is just a zip archive. If you unzip it you will find a META.yml file at the top directory that states both the PAR and the PAR::Packer versions.

    e.g.:

    build_requires: {} conflicts: {} dist_name: C:\some\path\where\the\file\was\built\parname.exe distribution_type: par dynamic_config: 0 generated_by: 'PAR::Packer version 1.039' license: unknown par: clean: 0 signature: '' verbatim: 0 version: 1.015

      Hi, I took the step you recommended. For the executable I built, Par Packer version is 1.041. Par version is 1.015.

        Thanks. Was this for both the version you were given and the one you built?

        Version difference might turn out to not be relevant, but it's still useful to know if they are or not.

        It's also possible that your packed version is missing a dependency, as already noted by beech in Re: How to obtain perl5/auto/IO/IO.so with global symbols?.

Re: How to obtain perl5/auto/IO/IO.so with global symbols?
by beech (Parson) on Feb 22, 2018 at 22:22 UTC

    Hi,

    What do you get if you run  ldd -v IO.so on each machine? (par/par/native)

    I think that error might really mean that some other library couldn't be found ( Assuming the PAR filters you're using arent mixing things up )

    Global symbols?? What global symbols? :)

    $ nm -g IO.dll nm: IO.dll: no symbols $ objdump -t IO.dll IO.dll: file format pei-i386 SYMBOL TABLE: no symbols $ objdump -T IO.dll IO.dll: file format pei-i386 objdump: IO.dll: not a dynamic object DYNAMIC SYMBOL TABLE: no symbols $ objdump -x IO.dll |grep -B22 boot_ There is an export table in .edata at 0x674c7000 The Export Tables (interpreted .edata section contents) Export Flags 0 Time/Date stamp 507ac67e Major/Minor 0/0 Name 00007028 dll.exp.dll Ordinal Base 1 Number in: Export Address Table 00000002 [Name Pointer/Ordinal] Table 00000002 Table Addresses Export Address Table 00007034 Name Pointer Table 0000703c Ordinal Table 00007044 Export Address Table -- Ordinal Base 1 [ 0] +base[ 1] 2670 Export RVA [ 1] +base[ 2] 2670 Export RVA [Ordinal/Name Pointer] Table [ 1] _boot_IO [ 0] boot_IO

    $ objdump -x IO.dll ... The Import Tables (interpreted .idata section contents) vma: Hint Time Forward DLL First Table Stamp Chain Name Thunk 00008000 00008050 00000000 00000000 000088e4 00008198 DLL Name: perl516.dll vma: Hint/Ord Member-Name Bound-To 82e0 4 PL_check 82ec 51 PL_ppaddr 82f8 132 PerlIO_getpos ... DLL Name: KERNEL32.dll DLL Name: msvcrt.dll

      edit: For your question "what global symbols?", this is what I mean (the directly delivered executable from Company A).

      [emk@ekdev2 IO]$ pwd /tmp/par-656d6b/cache-08da00fae2ebdaf6d8f69a0988dac72d0e1f3d62/inc/lib +/auto/IO [emk@ekdev2 IO]$ nm -g IO.so U PerlIO_getpos U PerlIO_setpos U PerlIO_tmpfile U PerlIO_ungetc U Perl_Isv_undef_ptr U Perl_Isv_yes_ptr U Perl_PerlIO_clearerr U Perl_PerlIO_error U Perl_PerlIO_fileno U Perl_PerlIO_flush ... 0000000000001760 T boot_IO U fcntl@@GLIBC_2.2.5 U fsync@@GLIBC_2.2.5 U poll@@GLIBC_2.2.5 U sockatmark@@GLIBC_2.2.5

      The following is what I get when I run ldd -v IO.so on each machine. The outputs are exactly the same, apart from the memory addresses. I ran ldd on the test machine's IO.so found in /tmp/par-..., and I ran ldd on the build machine's IO.so found in /usr/lib64/perl5/auto/IO.

      Just realized you probably meant to run ldd -v IO.so for the executable I got directly from Company A. I checked on that, and even that one has the same output for ldd -v.

      linux-vdso.so.1 => (0x00007fff091de000) libc.so.6 => /lib64/libc.so.6 (0x00007f1a0386b000) /lib64/ld-linux-x86-64.so.2 (0x00007f1a03e47000) Version information: ./IO.so: libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libc.so.6: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so. +2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64 +.so.2

        Hi,

        The outputs are exactly the same

        Are you really really sure?

        What is the output of  LD_DEBUG=help  ./switchscan ...?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-25 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found