Skip to main content

Problem:

When executing a database client application, an error about libpthread, or thread-local storage appears, such as :

* /usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage:

* OpenESQL Error: You must execute your application using  the threaded COBOL run-time.

* RTS198 (load failure)

Resolution:

Recent versions of database software are built using threaded C libraries. It's therefore imperative that user applications are compiled and executed with the threaded run-time, i.e. :

    * Compile, generate, and link the application using the -t cob flag

    * Ensure that you execute the app using cobrun_t, rather than cobrun

On some Operating Systems, such as HP-UX PA-RISC, if you attempt to execute a database application with the non-threaded COBOL run-time, you will see an error from the dynamic loader :

> cobrun myapp

/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1

/usr/lib/dld.sl: Exec format error

If you receive such an error, then you should ensure that you build and execute your application for use with the threaded COBOL run-time, e.g.

    * pass the -t flag to cob

    * Invoke your application with cobrun_t, rather than cobrun

> cobrun_t myapp

PASS

Old KB# 7168