Operating System - HP-UX
1822158 Members
3519 Online
109640 Solutions
New Discussion юеВ

Re: Exec format error when loading a .so module into Apache

 
SOLVED
Go to solution
Patricia Cordeiro
Occasional Advisor

Exec format error when loading a .so module into Apache

Hi,
I'm installing SAP Content Server on a HP-UX server. SAP's Content Server requires 64-Bit Apache, so I downloaded Apache's source and compile it using 64-bit gcc as follows:

export PATH=$PATH:/usr/lib/pa20_64:/usr/local/pa64/bin
export CFLAGS="+DA2.0W -Ae"

./configure --prefix=/opt/sdccs/apache --enable-shared=max --enable-module=most
make
make install

After that, I installed SAP Content Server, wich altered Apache's original httpd.conf file with one wich would load a shared module called mod_sapcs.so (also a 64-bit shared object).

With Apache's original httpd.conf, httpd daemon starts without problem, but with the httpd.conf I get the error:

/usr/lib/pa20_64/dld.sl: Cannot dlopen load module '/usr/lib/pa20_64/libcl.2' be
cause it contains thread specific data.
Syntax error on line 205 of /opt/sdccs/apache/etc/httpd.conf:
Cannot load /opt/sdccs/apache/libexec/mod_sapcs.so into server: Exec format erro
r
./apachectl start: httpd could not be started

Any help would be appreciated.

Regards,
Patricia.
4 REPLIES 4
ranganath ramachandra
Esteemed Contributor
Solution

Re: Exec format error when loading a .so module into Apache

shared libraries which contain thread local storage cannot be dynamically loaded by programs (with dlopen/shl_load) - i guess that is documented in the dlopen/shl_load man pages.

a workaround is to either link the program with this shared library or to use LD_PRELOAD or LD_PRELOAD_ONCE so that this shared library is loaded at program startup.

the first approach requires that you modify the makefile (include -lcl in the link line) and relink httpd.

for the second approach, you can simply set LD_PRELOAD=/usr/lib/pa20_64/libcl.2 (or LD_PRELOAD_ONCE=/usr/lib/pa20_64/libcl.2) in the shell where the httpd is to be started. both are expected to contain a colon-delimited list of shared library paths, so if they are already set, you just need to add libcl.2 at the right position : e.g. if mod_sapcs.so is dlopen'ing libcl.2 and mod_sapcs.so is also being preloaded, you need libcl.2 before mod_sapcs.so in LD_PRELOAD. i guess you can arrive at the working sequence by trial and error.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Patricia Cordeiro
Occasional Advisor

Re: Exec format error when loading a .so module into Apache

Ranganath,
I tried the workaround, but still got the same results.
I had already tried to compile Apache with -lcl option, but gave it up due to some other problems, I will try this again. However, I thought that's what the "--enable-shared=max --enable-module=most" option on the configure was supposed to do.

Thanks for your assistance, I'll let you know if it works. In the meantime, if you have any other suggetions, I'd appreciate it.

Regards,
Patricia.
ranganath ramachandra
Esteemed Contributor

Re: Exec format error when loading a .so module into Apache

please make sure you have the latest linker/loader patches installed - PHSS_30965 (11.00) or PHSS_30966 (11.11).
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Patricia Cordeiro
Occasional Advisor

Re: Exec format error when loading a .so module into Apache

Hi,
I recompiled Apache (again) with the -lcl option, and it's working properly.

Thanks for your assistance.
Patricia