Apache 2.2 crashing after receiving SIGUSR1 (apachectl -k graceful) on FreeBSD 5

The other days I installed Apache 2.2.4 (compiled from source) on FreeBSD 5.3, and while everything seemingly worked fine, after apachectl -k graceful command (actually sending SIGUSR1 to httpd process), httpd crashed leaving core dump in ServerRoot, and

pid 21090 (httpd), uid 0: exited on signal 11 (core dumped)
pid 43276 (httpd), uid 0: exited on signal 11 (core dumped)
pid 44355 (httpd), uid 0: exited on signal 11 (core dumped)
pid 44458 (httpd), uid 0: exited on signal 11 (core dumped)

in dmesg. And since I have recently been on Solaris x86 crash dump analysis training by Frank Hofmann, I decided to practice learned and take a look into core file ...

[root@isis apache2-horus]# gdb /usr/local/httpd/apache2-horus/bin/httpd \\
/usr/local/httpd/apache2-horus/httpd.core
#0 0x283c1711 in engine_table_select () from /lib/libcrypto.so.3 (gdb) bt full #0 0x283c1711 in engine_table_select () from /lib/libcrypto.so.3 No symbol table info available. #1 0x283c11c1 in ENGINE_get_default_DH () from /lib/libcrypto.so.3 No symbol table info available. #2 0x283bbfc5 in DH_new_method () from /lib/libcrypto.so.3 No symbol table info available. #3 0x283bbf16 in DH_new () from /lib/libcrypto.so.3 No symbol table info available. #4 0x282d156a in ?? () from /usr/local/httpd/apache2-horus/modules/mod_ssl.so No symbol table info available. #5 0x282c1b6f in ?? () from /usr/local/httpd/apache2-horus/modules/mod_ssl.so No symbol table info available. #6 0x282c1c84 in ?? () from /usr/local/httpd/apache2-horus/modules/mod_ssl.so No symbol table info available. #7 0x282c3402 in ?? () from /usr/local/httpd/apache2-horus/modules/mod_ssl.so No symbol table info available. #8 0x080717f4 in ap_run_post_config (pconf=0x80ac018, plog=0x80da018,
ptemp=0x80eb018, s=0x80adeb8) at config.c:91 pHook = (ap_LINK_post_config_t \*) 0x9 n = 5 rv = 134849408 #9 0x08061b3a in main (argc=3, argv=0xbfbfeb18) at main.c:706 exit_status = 0 c = 0 '\\0' configtestonly = 0 confname = 0x808916f "conf/httpd.conf" def_server_root = 0x8088e8c "/usr/local/httpd/apache2-horus" temp_error_log = 0x0 error = 0x9 <address 0x9 out of bounds> server_conf = (server_rec \*) 0x80adeb8 pglobal = (apr_pool_t \*) 0x80aa018 pconf = (apr_pool_t \*) 0x80ac018 plog = (apr_pool_t \*) 0x80da018 ptemp = (apr_pool_t \*) 0x80eb018 pcommands = (apr_pool_t \*) 0x80ae018 opt = (apr_getopt_t \*) 0x80ae0b0 rv = 134930104 mod = (module \*\*) 0x80adeb8 optarg = 0xbfbfeae0 "(뿿�\\020\\006\\b" signal_server = (apr_OFN_ap_signal_server_t \*) 0x809a380

Looks like Apache and dso module mod_ssl were compiled against /lib/libcrypto.so.3 which doesn't provide functions which mod_ssl requires such as ENGINE_get_default_DH, DH_new_method, DH_new etc. Solution was to install new libcrypto.so (libcrypto.so.4) from openssl-0.9.8e_1 package and to recompile apache again (I was using same configure options as before installing openssl-0.9.8e_1, just this time configure found this new version of libcrypto.so library and generated Makefiles with -L /usr/local/lib

Running nm on libcrypto.so.4 for safety's sake:

[bilke@isis ~]% nm /usr/local/lib/libcrypto.so.4 | \\
egrep 'ENGINE_get_default_DH|DH_new_method|DH_new'

00089368 T DH_new
00089384 T DH_new_method
0008deb8 T ENGINE_get_default_DH
[bilke@isis ~]%

After installation of recompiled Apache 2.2 first thing was to check what version of libcrypto.so mod_ssl was compiled against

[bilke@isis ~]% ldd /usr/local/httpd/apache2-horus/modules/mod_ssl.so
/usr/local/httpd/apache2-horus/modules/mod_ssl.so:
libssl.so.4 => /usr/local/lib/libssl.so.4 (0x28179000)
libcrypto.so.4 => /usr/local/lib/libcrypto.so.4 (0x281b4000)
[bilke@isis ~]%

Everything looks good, and Apache is not crashing anymore on SIGUSR1 (apachectl -k graceful)

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

bilke

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today