IBM Support

AIX Open Source: Examining and resolving module load errors

Question & Answer


Question

How can I resolve this Perl "Dependent module" error?
# perl test_xml.pl
Can't load '/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so' for module XML::LibXML:  
  
0509-022 Cannot load module /opt/freeware/lib/libxml2.a(libxml2.so.2).
        0509-150   Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
        0509-152   Member libiconv.so.2 is not found in archive
        0509-022 Cannot load module /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so.
        0509-150   Dependent module /opt/freeware/lib/libxml2.a(libxml2.so.2) could not be loaded. at /usr/opt/perl5/lib/5.28.1/aix-thread-multi/DynaLoader.pm line 193.
at /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/XML/LibXML.pm line 156.

BEGIN failed--compilation aborted at /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/XML/LibXML.pm line 156.

Compilation failed in require at test_xml.pl line 2.
BEGIN failed--compilation aborted at test_xml.pl line 2.

Answer

A) An overview of the files:
The LibXML module (an interface to libxml2), is provided by the AIX perl.rte file set.
# lslpp -w  /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so
  File                                        Fileset               Type
  ----------------------------------------------------------------------------
  /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so
    perl.rte        File
The libxml2.a library, an Open Source file, is provided by the libxml2 rpm.
# rpm -q --whatprovides /opt/freeware/lib/libxml2.a

  libxml2-2.9.10-1.ppc
B) An explanation of the errors:
LibXML.so cannot load /opt/freeware/lib/libxml2.a(libxml2.so.2).
Can't load '/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so' for module XML::LibXML:    
0509-022 Cannot load module /opt/freeware/lib/libxml2.a(libxml2.so.2).
The libxml2.a cannot load its dependent module, libiconv.so.2
 
0509-150   Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
0509-152   Member libiconv.so.2 is not found in archive
C) Resolving the errors:
Examine the libxml2.a:
# dump -Hv  /opt/freeware/lib/libxml2.a

/opt/freeware/lib/libxml2.a[libxml2.so.2]:
                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER
0      /opt/freeware/lib:/usr/lib:/lib
1                                    libgcc_s.a          shr.o
2                                    liblzma.a           liblzma.so.5
-->3      /opt/freeware/lib             libiconv.a          libiconv.so.2
4                                    libc.a              shr.o
5                                    libz.a              libz.so.1
6                                    libpthread.a        shr_xpg5.o
Examine the current dynamic dependencies:
# ldd /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so
/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so needs:
         /usr/lib/libpthreads.a(shr_xpg5.o)
         /usr/lib/libc.a(shr.o)
         /usr/lib/libxml2.a(libxml2.so.2)
         /unix
         /usr/lib/libpthreads.a(shr_comm.o)
         /usr/lib/libcrypt.a(shr.o)
         /usr/lib/libpthread.a(shr_xpg5.o)
      -->/usr/lib/libiconv.a(shr4.o)
Check the current LIBPATH:
# echo $LIBPATH

/usr/lib:/opt/freeware/lib
  • Unset the LIBPATH:
# unset LIBPATH
Examine the new dynamic dependencies:
# ldd /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so

/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/LibXML/LibXML.so needs:
         /usr/lib/libpthreads.a(shr_xpg5.o)
         /usr/lib/libc.a(shr.o)
         /opt/freeware/lib/libxml2.a(libxml2.so.2)
         /unix
         /usr/lib/libpthreads.a(shr_comm.o)
         /usr/lib/libcrypt.a(shr.o)
         /opt/freeware/lib/libgcc_s.a(shr.o)
         /opt/freeware/lib/liblzma.a(liblzma.so.5)

-->    /opt/freeware/lib/libiconv.a(libiconv.so.2)
         /opt/freeware/lib/libz.a(libz.so.1)
         /usr/lib/libpthread.a(shr_xpg5.o)
Now the XML::LibXML module can be loaded:
# perl test_xml.pl
D) Root cause explanation:
In this example, the /usr/lib/libiconv.a from AIX fileset bos.rte.iconv was loaded before the expected /opt/freeware/lib/libiconv.a from the Open Source libiconv rpm.
  • AIX Open Source is built against the Open Source packages, so the LIBPATH should not be set.
  • Users can examine their application errors, and determine the correct LIBPATH based on errors, and the 'dump' and 'ldd' commands.
  • See more libiconv details in AIX Open Source: Member libiconv.so.2 is not found in archive
SUPPORT

A) For all questions or issues with AIX Toolbox for Linux Applications ("AIX Toolbox") packages, the support is handled by the AIX Open Source Team in the forum:

The AIX Open Source Team provides support through the forum, only. They answer questions, if possible, but they don't own the packages, or formally support them. For true expertise in usage of each package, users should consult the community for each respective package.  For Perl communities, see the Perl Community page (Perl Monks is a popular community for Perl usage discussions).

** Cases opened to address AIX Toolbox problems will be canceled and users will be referred to the Open Source Forum.
 
If you experience technical issues accessing the AIX Open Source community or forum, refer to the footer of the IBM Community forum page.
There is email, and "Contact Us" information for community support

B) If there is a problem with installing or updating perl.rte, or loading a perl.rte executable file, you can open an AIX Case (See C) for assistance.

Examples of perl.rte issues supported through AIX Support:
- Errors updating or migrating the perl.rte fileset
- Commands from the perl.rte fileset do not run, or core dump

Example of a perl.rte loading issue:

# perl -v
exec(): 0509-036 Cannot load program perl because of the following errors:
        0509-150   Dependent module libperl.a(libperl.o) could not be loaded.
        0509-022 Cannot load module libperl.a(libperl.o).
        0509-026 System error: A file or directory in the path name does not exist.

 
This example would be handled through an IBM AIX Support case, and the support team would help resolve the missing modules.
To learn what is provided and supported by the perl.rte fileset:

#  lslpp -f perl.rte

C) Opening an AIX Support Case

If additional assistance is required due to issues with the perl.rte file set (see preceding B section), use the following step-by-step instructions to contact IBM to open a case for software with an active and valid support contract.  

1.  Document (or collect screen captures of) all symptoms, errors, and messages related to your issue.

2.  Capture any logs or data relevant to the situation.

3.  Contact IBM to open a case:

   -For electronic support, see the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, see the web page:
      https://www.ibm.com/planetwide/

[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z000000cw3dAAA","label":"RPMS: AIX Toolbox for Linux"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
03 June 2021

UID

ibm16458245