<font size=2 face="sans-serif">Hello list,</font>
<br>
<br><font size=2 face="sans-serif">As part of a customer case I'm working
on, I've been trying to set up the combination of Apache, mod_nss and our
own PKCS#11 provider.</font>
<br><font size=2 face="sans-serif">I've gotten the Apache server to start,
but the tasks spawned by Apache are dying left and right:</font>
<br>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:15 2013] [notice]
child pid 6649 exit signal Segmentation fault (11)</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:15 2013] [notice]
child pid 6650 exit signal Segmentation fault (11)</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:16 2013] [notice]
child pid 6645 exit signal Segmentation fault (11), possible coredump in
/tmp</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:16 2013] [notice]
child pid 6646 exit signal Segmentation fault (11), possible coredump in
/tmp</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:16 2013] [notice]
child pid 6647 exit signal Segmentation fault (11), possible coredump in
/tmp</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:16 2013] [notice]
child pid 6648 exit signal Segmentation fault (11), possible coredump in
/tmp</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:16 2013] [notice]
child pid 6651 exit signal Segmentation fault (11)</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:16 2013] [notice]
child pid 6653 exit signal Segmentation fault (11)</font>
<br><font size=2 face="sans-serif">[Thu Oct 31 15:48:18 2013] [notice]
child pid 6668 exit signal Segmentation fault (11), possible coredump in
/tmp</font>
<br>
<br><font size=2 face="sans-serif">and so on. My investigation points toward
NSS being shut down prematurely (by the main process?) while the incipient
worker processes continue to call it (heavily edited for brevity):</font>
<br>
<br><font size=2 face="sans-serif">[root@cccclab4 ~]# gdb --args httpd
-X -D FOREGROUND</font>
<br><font size=2 face="sans-serif">GNU gdb (GDB) Red Hat Enterprise Linux
(7.2-60.el6)</font>
<br><font size=2 face="sans-serif">[...]</font>
<br><font size=2 face="sans-serif">(gdb) break NSS_Initialize</font>
<br><font size=2 face="sans-serif">Breakpoint 1 (NSS_Initialize) pending.</font>
<br><font size=2 face="sans-serif">(gdb) run</font>
<br><font size=2 face="sans-serif">Starting program: /usr/sbin/httpd -X
-D FOREGROUND</font>
<br><font size=2 face="sans-serif">Breakpoint 1, NSS_Initialize (configdir=0x7ffff82bf0a0
"/root/y4nss/", </font>
<br><font size=2 face="sans-serif"> certPrefix=0x0, keyPrefix=0x0,
secmodName=0x7fffed87c9ae "secmod.db", </font>
<br><font size=2 face="sans-serif"> flags=1) at nssinit.c:817</font>
<br><font size=2 face="sans-serif">(gdb) watch g_default_trust_domain </font>
<br><font size=2 face="sans-serif">Hardware watchpoint 2: g_default_trust_domain</font>
<br><font size=2 face="sans-serif">(gdb) cont</font>
<br><font size=2 face="sans-serif">Continuing.</font>
<br><font size=2 face="sans-serif">Hardware watchpoint 2: g_default_trust_domain</font>
<br>
<br><font size=2 face="sans-serif">Old value = (NSSTrustDomain *) 0x0</font>
<br><font size=2 face="sans-serif">New value = (NSSTrustDomain *) 0x7ffff8426be0</font>
<br><font size=2 face="sans-serif">STAN_LoadDefaultNSS3TrustDomain () at
pki3hack.c:153</font>
<br><font size=2 face="sans-serif">153
return PR_SUCCESS;</font>
<br><font size=2 face="sans-serif">(gdb) cont</font>
<br><font size=2 face="sans-serif">Continuing.</font>
<br><font size=2 face="sans-serif">Please enter password for "TEST"
token:</font>
<br><font size=2 face="sans-serif">[Thread 0x7fffe3c37700 (LWP 10913) exited]</font>
<br><font size=2 face="sans-serif">(gdb) cont</font>
<br><font size=2 face="sans-serif">Hardware watchpoint 2: g_default_trust_domain</font>
<br>
<br><font size=2 face="sans-serif">Old value = (NSSTrustDomain *) 0x7ffff8426be0</font>
<br><font size=2 face="sans-serif">New value = (NSSTrustDomain *) 0x0</font>
<br><font size=2 face="sans-serif">0x00007ffff34a1828 in STAN_Shutdown
() at pki3hack.c:212</font>
<br><font size=2 face="sans-serif">212
g_default_trust_domain
= NULL;</font>
<br><font size=2 face="sans-serif">(gdb) cont</font>
<br><font size=2 face="sans-serif">Continuing.</font>
<br><font size=2 face="sans-serif">[New Thread 0x7fffe3c37700 (LWP 10916)]</font>
<br>
<br><font size=2 face="sans-serif">Program received signal SIGSEGV, Segmentation
fault.</font>
<br><font size=2 face="sans-serif">nssTrustDomain_GetCertsFromCache (td=0x0,
certListOpt=0x7ffff836a7e0)</font>
<br><font size=2 face="sans-serif"> at tdcache.c:1127</font>
<br><font size=2 face="sans-serif">1127
PZ_Lock(td->cache->lock);</font>
<br><font size=2 face="sans-serif">(gdb) print td</font>
<br><font size=2 face="sans-serif">$1 = (NSSTrustDomain *) 0x0</font>
<br><font size=2 face="sans-serif">(gdb) bt</font>
<br><font size=2 face="sans-serif">#0 nssTrustDomain_GetCertsFromCache
(td=0x0, certListOpt=0x7ffff836a7e0)</font>
<br><font size=2 face="sans-serif"> at tdcache.c:1127</font>
<br><font size=2 face="sans-serif">#1 0x00007ffff349b727 in NSSTrustDomain_TraverseCertificates
(td=0x0, </font>
<br><font size=2 face="sans-serif"> callback=0x7ffff34623e0
<pk11ListCertCallback>, arg=0x7fffffffdf20)</font>
<br><font size=2 face="sans-serif"> at trustdomain.c:1015</font>
<br><font size=2 face="sans-serif">#2 0x00007ffff34622fc in PK11_ListCerts
(type=PK11CertListUser, pwarg=0x0)</font>
<br><font size=2 face="sans-serif"> at pk11cert.c:2509</font>
<br><font size=2 face="sans-serif">#3 0x00007fffed872772 in nss_init_Child
(p=0x7ffff83d4c08, </font>
<br><font size=2 face="sans-serif"> base_server=0x7ffff8212880)
at nss_engine_init.c:1370</font>
<br><font size=2 face="sans-serif">#4 0x00007ffff7fd6b0c in ap_run_child_init
(pchild=0x7ffff83d4c08, </font>
<br><font size=2 face="sans-serif"> s=0x7ffff8212880) at /usr/src/debug/httpd-2.2.15/server/config.c:155</font>
<br><font size=2 face="sans-serif">#5 0x00007ffff7fea725 in child_main
(child_num_arg=<value optimized out>)</font>
<br><font size=2 face="sans-serif"> at /usr/src/debug/httpd-2.2.15/server/mpm/prefork/prefork.c:518</font>
<br><font size=2 face="sans-serif">#6 0x00007ffff7feac46 in make_child
(s=0x7ffff8212880, slot=0)</font>
<br><font size=2 face="sans-serif"> at /usr/src/debug/httpd-2.2.15/server/mpm/prefork/prefork.c:707</font>
<br><font size=2 face="sans-serif">#7 0x00007ffff7feb293 in ap_mpm_run
(_pconf=<value optimized out>, </font>
<br><font size=2 face="sans-serif"> plog=<value optimized
out>, s=<value optimized out>)</font>
<br><font size=2 face="sans-serif"> at /usr/src/debug/httpd-2.2.15/server/mpm/prefork/prefork.c:983</font>
<br><font size=2 face="sans-serif">#8 0x00007ffff7fc2900 in main
(argc=4, argv=0x7fffffffe408)</font>
<br><font size=2 face="sans-serif"> at /usr/src/debug/httpd-2.2.15/server/main.c:760</font>
<br>
<br><font size=2 face="sans-serif">The NULL pointer that is dereferenced
in the final steps comes from the global variable I watched. Is this a
known bug, or are there configuration problems that are known to cause
this?</font>
<br><font size=2 face="sans-serif">The versions of Apache and nss I am
using are these (they are the versions I got from our local RHN node):</font>
<br>
<br><font size=2 face="sans-serif">[root@cccclab4 ~]# rpm -qa nss httpd</font>
<br><font size=2 face="sans-serif">httpd-2.2.15-29.el6_4.x86_64</font>
<br><font size=2 face="sans-serif">nss-3.14.0.0-12.el6.x86_64</font>
<br><font size=2 face="sans-serif">[root@cccclab4 ~]#</font>
<br>
<br><font size=2 face="sans-serif">Any help you can give is greatly appreciated.</font>
<br>
<br><font size=2 face="sans-serif">Best regards,</font>
<br>
<br><font size=2 face="sans-serif">Lars<br>
<br>
Medmindre andet er angivet ovenfor: / Unless Otherwise Stated Above:<br>
IBM Danmark ApS<br>
Nymøllevej 91<br>
2800 Kongens Lyngby, Danmark<br>
CVR nr.: 65305216 </font>