XDOMOpen() fails on RedHat

The Issue

The default installation of UniVerse 10.3.x on RedHat does not correctly setup the server so that UniVerse can find it’s shared libraries.

This shows up when code attempts to use the XDOMOpen() function by generating the error:

Program "xyz": Line nn, Can't load "/usr/ibm/uv/bin/libxml.so": libxslt4c.so.111:
cannot open shared object file: No such file or directory

Once a UV session has generated this error, it will not generate it again, which is sort of nice. Except that the XDOMOpen() function continues to fail!

There are a couple of technotes on the Rocket Software website that explain this issue, but their suggested solution is to assign the environment variable LD_LIBRARY_PATH with the path to the bin directory in the uv installation directory (i.e. LD_LIBRARY_PATH=”`cat /.uvhome`/bin”) prior to using uv.

Whilst this solution does work, it is not recommended for production environments (at least that is the feedback I get from reearching this environment variable). Add to that the effort needed to setup the assignment of the variable for all logins that use uv. Now you are getting a messy install & configuration effort just to be able to use the XML functionality in UV.

The Solution

There is a more robust alternative to setting the environment variable. It is a cache of links to the most recent shared libraries found on a system, which is used by ld.so – the RH run-time linker. This cache is built and maintained by the ldconfig command.

To update the shared library cache with UniVerse libraries perform the following as user ‘root’:

      echo `cat /.uvhome`/bin > /etc/ld.so.conf.d/UniVerse.conf
      ldconfig

To check that the cache has been updated, run the  following and confirm there are files in the UV installatin directory:

      ldconfig -p|grep "/uv/"

Now that this is done, every time you start UniVerse it will be able to load the necessary shared library modules needed to support the XML functionality.

HEX conversion limit

There is a limit to the HEX value that can be correctly processed by the MCDX conversion within UniVerse.

Conversion Result Expected  
OCONV(‘15849015887′,’MCDX’) B0ACCA4F 3B0ACCA4F Error
OCONV(‘2147483648′,’MCDX’) 80000000 80000000 ok
ICONV(‘80000000′,’MCDX’) -2147483648 80000000 Error
OCONV(‘2147483647′,’MCDX’) 7FFFFFFF 7FFFFFFF ok
ICONV(‘7FFFFFFF’,’MCDX’) 2147483647 2147483647 ok

This is because the HEX conversion uses a single signed 32-bit integer. These have a maximum value of 2,147,483,647.

Just in case you were wondering why 2147483648 would not convert to HEX correctly!