Library file error while running command

I am running a command in Solaris non-global zone and it is complaining for a library file, while that is already preset in server.

mwcontrol: fatal: relocation error: file /usr/openwin/lib/locale/common/xlibi18n.so.2: symbol _XlcAddUtf8Converters: referenced symbol not found
  
 # ls -l /usr/openwin/lib/locale/common/xlibi18n.so.2
-rwxr-xr-x   1 root     bin        14536 Jan  5  2010 /usr/openwin/lib/locale/common/xlibi18n.so.2
 # $PATH
bash: /usr/bin:/opt/bin:/lib:/usr/bin:/usr/sbin:/ccq/apps/sunoneweb/SUNWwbsvr:/usr/platform/sun4u/sbin:/usr/ucb:/usr/local/bin:/usr/local/sbin:/usr/xpg4/bin:/etc:/lib:/bin:/sbin:/ccq/apps/jre1_6/jre1.6.0_25:/ccq/apps/oracle/product/11.2.0/client_1:/opt/IBM/ldap/V6.0/lib:/usr/openwin/bin:/ccq/apps/siebel81/sieb81/siebsrvr/bin:/var/adm:/var/adm/siebel:/ccq/apps/siebfs:/usr/openwin/lib/locale/common:/ccq/apps/oracle/product/11.2.0/client_1/bin:/ccq/apps/siebel81/sieb81/siebsrvr/bin:/ccq/apps/siebel81/sieb81/siebsrvr/mw/bin:/ccq/apps/siebel81/sieb81/siebsrvr/SYBSsa90/bin:/ccq/apps/oracle/product/11.2.0/client_1/bin: No such file or directory

Can somebody help me, what I am missing to fix it ?
I have to run it with non-root user.

Please show the output of:

ldd /usr/openwin/lib/locale/common/xlibi18n.so.2

It's likely your libs aren't from the same source.

#  ldd /usr/openwin/lib/locale/common/xlibi18n.so.2
        libX11.so.4 =>   /usr/lib/libX11.so.4
        libc.so.1 =>     /lib/libc.so.1
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libXext.so.0 =>  /usr/lib/libXext.so.0
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1
        libm.so.2 =>     /lib/libm.so.2
        /lib/libm/libm_hwcap1.so.2
        /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1

I've little experience with Solaris, but are there also different copies of libX11.so in /usr/openwin/lib perhaps? The way this was compiled, it seems that _XlcAddUtf8Converters should be in libX11, but your libX11 doesn't have it because those two libraries are either incompatible versions, or from different configurations whilst being compiled.

1 Like

I can find these files at these locations (I ran find command with root)-->

/usr/openwin/lib/locale/common/sparcv9/xlibi18n.so.2
/usr/openwin/lib/locale/common/xlibi18n.so.2
/usr/openwin/lib/locale/common.20081111/sparcv9/xlibi18n.so.2
/usr/openwin/lib/locale/common.20081111/xlibi18n.so.2
--------------------------------------------------------
/usr/lib/sparcv9/libX11.so
/usr/lib/libX11.so
/usr/openwin/lib/sparcv9/libX11.so
/usr/openwin/lib/libX11.so

Looks like you'd need to give /usr/openwin/lib preference in the dynamic linker.
I'd try setting LD_LIBRARY_PATH before executing mwcontrol, or it seems Solaris uses crle to permanently change it

How should I check/change it ?

Type crle at the command prompt. I'm curious the output.
I'd try running the command with the list of paths in LD_LIBRARY_PATH first.. something like:

 LD_LIBRARY_PATH=/usr/openwin/lib:/lib:/usr/lib mwcontrol
 

Before bothering to change it permanently (which you'll want to read man crle as to how)

Please run the following diagnostic commands:

uname -sr
pkginfo -l SUNWxi18n
nm /usr/openwin/lib/locale/common/xlibi18n.so.2 | grep XlcAddUtf8
showrev -p | grep -w SUNWxi18n
/# uname -sr
SunOS 5.10
/# pkginfo -l SUNWxi18n
   PKGINST:  SUNWxi18n
      NAME:  X Window System Internationalization Common Package
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  4.2,REV=2.0.73
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Run time library loaded by libX11.so, and  provides input and output capability for internationalized X Window applications.
    PSTAMP:  sparc-build20041129101917
  INSTDATE:  Aug 29 2011 00:14
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       10 installed pathnames
                   8 partially installed pathnames
                   5 shared pathnames
                   6 directories
                   8 executables
                1940 blocks used (approx)
 /# nm /usr/openwin/lib/locale/common/xlibi18n.so.2 | grep XlcAddUtf8
[84]    |         0|       0|FUNC |GLOB |0    |UNDEF  |_XlcAddUtf8Converters
/# showrev -p | grep -w SUNWxi18n
Patch: 120410-28 Obsoletes:  Requires: 119254-13, 121975-01, 119059-24 Incompatibles:  Packages: SUNWxi18n, SUNWxim, SUNWiiimr, SUNWiiimu
Patch: 120410-30 Obsoletes:  Requires: 119254-13, 121975-01, 119059-24 Incompatibles:  Packages: SUNWxi18n, SUNWxim, SUNWiiimr, SUNWiiimu
Patch: 120410-33 Obsoletes:  Requires: 119254-13, 121975-01, 119059-24 Incompatibles:  Packages: SUNWxi18n, SUNWxim, SUNWiiimr, SUNWiiimu
/#

That's okay.
neutronscott said it already: the Solaris-10 /usr/openwin/lib/locale/common/xlibi18n.so.2
needs the correct libX11.so to resolve the symbol.
Ensure that these are linked (share the same inode), and that it contains the symbol

ls -lLi /usr/openwin/lib/libX11* /usr/lib/libX11*
nm /usr/lib/libX11.so.4 | grep XlcAddUtf8

Further check your application to not set LD_LIBRARY_PATH (often done in a start script) to a directory with a libX11.so that does not contain the symbol.

# : > LD_LIBRARY_PATH=/usr/openwin/lib:/lib:/usr/lib mwcontrol
ld.so.1: mwcontrol: fatal: libmwfolder.so: open failed: No such file or directory
Killed
# : > ls -lLi /usr/openwin/lib/libX11* /usr/lib/libX11*
      9341 -rwxr-xr-x   1 root     bin      1471036 Jan 19  2011 /usr/lib/libX11.so
      9341 -rwxr-xr-x   1 root     bin      1471036 Jan 19  2011 /usr/lib/libX11.so.4
      9341 -rwxr-xr-x   1 root     bin      1471036 Jan 19  2011 /usr/lib/libX11.so.5
      9341 -rwxr-xr-x   1 root     bin      1471036 Jan 19  2011 /usr/openwin/lib/libX11.so
      9341 -rwxr-xr-x   1 root     bin      1471036 Jan 19  2011 /usr/openwin/lib/libX11.so.4
# : > nm /usr/lib/libX11.so.4 | grep XlcAddUtf8
[4040]  |    597028|     100|FUNC |GLOB |0    |10     |_XlcAddUtf8Converters
# : > 

Before running this mwcontrol, there is a environment script which runs while login. Here is what if I grep LD_LIBRARY

# : >  cat siebenv.sh | grep LD_LIBRARY
if [ a${LD_LIBRARY_PATH} = ${LD_LIBRARY_PATH}a ]
then LD_LIBRARY_PATH=${SIEBEL_ROOT}/lib:${SIEBEL_ROOT}/lib/odbc/merant:${MWHOME}/lib:${SQLANY}/lib:/usr/lib:/ccq/apps/oracle/product/11.2.0/client_1/lib:/opt/IBM/ldap/V6.0/lib
else LD_LIBRARY_PATH=${SIEBEL_ROOT}/lib:${SIEBEL_ROOT}/lib/odbc/merant:${MWHOME}/lib:${SQLANY}/lib:/usr/lib:${LD_LIBRARY_PATH}:/ccq/apps/oracle/product/11.2.0/client_1/lib:/opt/IBM/ldap/V6.0/lib
export LD_LIBRARY_PATH
# : > 

Your Solaris 10 box is okay.
The "siebenv.sh" sets own application directories before the system /usr/lib/.
Application libraries will replace system libraries with the same name, that is a risk for the application and especially several other applications that run with this LD_LIBRARY_PATH.
Please do

. siebenv.sh
ldd /usr/openwin/lib/locale/common/xlibi18n.so.2

Is a library (e.g. libX11.so) redirected to an application library?

Yes, there is different. if I run with application user -->

# : > . ./siebenv.sh
# : > ldd /usr/openwin/lib/locale/common/xlibi18n.so.2
        libX11.so.4 =>   /ccq/apps/siebel81/sieb81/siebsrvr/mw/lib/libX11.so.4
        libc.so.1 =>     /usr/lib/libc.so.1
        libXext.so.0 =>  /ccq/apps/siebel81/sieb81/siebsrvr/mw/lib/libXext.so.0
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libdga.so.1 =>   /usr/openwin/lib/libdga.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libmd.so.1 =>    /usr/lib/libmd.so.1
        libscf.so.1 =>   /usr/lib/libscf.so.1
        libdoor.so.1 =>  /usr/lib/libdoor.so.1
        libuutil.so.1 =>         /usr/lib/libuutil.so.1
        libgen.so.1 =>   /usr/lib/libgen.so.1
        libm.so.2 =>     /usr/lib/libm.so.2
        /lib/libm/libm_hwcap1.so.2
        /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
# : >

If I do it with root (without setting env with siebenv.sh)

# : > ldd /usr/openwin/lib/locale/common/xlibi18n.so.2
        libX11.so.4 =>   /usr/openwin/lib/libX11.so.4
        libc.so.1 =>     /lib/libc.so.1
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libXext.so.0 =>  /usr/openwin/lib/libXext.so.0
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1
        libm.so.2 =>     /lib/libm.so.2
        /lib/libm/libm_hwcap1.so.2
        /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1

... and there is the problem.
Two approaches:
rewrite the siebenv.sh to set LD_LIBRARY_PATH with /usr/lib first (and use a more efficient coding)

# commented out - libX11.so breaks Solaris 10 ...
#if [ a${LD_LIBRARY_PATH} = ${LD_LIBRARY_PATH}a ]
#then LD_LIBRARY_PATH=${SIEBEL_ROOT}/lib:${SIEBEL_ROOT}/lib/odbc/merant:${MWHOME}/lib:${SQLANY}/lib:/usr/lib:/ccq/apps/oracle/product/11.2.0/client_1/lib:/opt/IBM/ldap/V6.0/lib
#else LD_LIBRARY_PATH=${SIEBEL_ROOT}/lib:${SIEBEL_ROOT}/lib/odbc/merant:${MWHOME}/lib:${SQLANY}/lib:/usr/lib:${LD_LIBRARY_PATH}:/ccq/apps/oracle/product/11.2.0/client_1/lib:/opt/IBM/ldap/V6.0/lib
#fi
# ... and replaced by the following line
LD_LIBRARY_PATH=/usr/lib:${SIEBEL_ROOT}/lib:${SIEBEL_ROOT}/lib/odbc/merant:${MWHOME}/lib:${SQLANY}/lib:${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/ccq/apps/oracle/product/11.2.0/client_1/lib:/opt/IBM/ldap/V6.0/lib
export LD_LIBRARY_PATH

Or rename the conflicting libraries to

/ccq/apps/siebel81/sieb81/siebsrvr/mw/lib/libX11_breaks_Solaris_10.so.4
/ccq/apps/siebel81/sieb81/siebsrvr/mw/lib/libXext_breaks_Solaris_10.so.0

Thanks. I will check it with apps teams.