Bug 71740 - apache2 drops core when sent HUP signal and /etc/nsswitch.conf file exists
Summary: apache2 drops core when sent HUP signal and /etc/nsswitch.conf file exists
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-14 20:20 UTC by satz
Modified: 2004-10-14 08:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description satz 2004-09-14 20:20:19 UTC
Whenever the httpd-error or httpd-access log fills up, newsyslog rotates the file. Afterwards, it sends httpd a HUP signal. httpd drops a core file in /usr/local/.

Server version: Apache/2.0.50
Server built:   Sep 14 2004 09:53:26
Server's Module Magic Number: 20020903:8
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/bin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="/var/run/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
 -D AP_TYPES_CONFIG_FILE="etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache2/httpd.conf"

(gdb) bt
#0  0x28614708 in ?? ()
#1  0x2840b62c in nsdispatch () from /lib/libc.so.5
#2  0x283e50c5 in getpwnam_r () from /lib/libc.so.5
#3  0x283e531b in getpwuid_r () from /lib/libc.so.5
#4  0x283e526b in getpwuid_r () from /lib/libc.so.5
#5  0x283e53e9 in getpwnam () from /lib/libc.so.5
#6  0x08070d58 in ap_uname2id ()
#7  0x08081683 in unixd_set_user ()
#8  0x080664b3 in invoke_cmd ()
#9  0x0806716d in ap_walk_config_sub ()
#10 0x080671f3 in ap_walk_config ()
#11 0x0806803f in ap_process_config_tree ()
#12 0x0806b10f in main ()
#13 0x0805cee2 in _start ()

The contents of the /etc/nsswitch.conf file:

group: files
group_compat: nis
hosts: files dns
networks: files
passwd: files
passwd_compat: nis
shells: files

Fix: 

rename or remove the /etc/nsswitch.conf file.
How-To-Repeat: Send httpd a HUP signal with an /etc/nsswitch.conf file present.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2004-09-14 22:05:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->apache

over to maintainer
Comment 2 Clement Laforet 2004-09-15 08:54:01 UTC
Hi Greg.

Can you please send me the list of your modules?
If you use PHP you should consider upgrading it, since I already have
this problem, and upgrading php fixes the problem.

regards,
clem
Comment 3 satz 2004-09-15 14:25:44 UTC
I am using the latest libphp from ports, version 4.3.8. Is there a 
newer version?

Looks like a reboot runs /etc/rc.d/nisdomain which generates a new 
/etc/nsswitch.conf causing the core dump.

Thanks,
Greg

total 2024
-rw-r--r--  1 root  wheel    8440 Sep 14 09:53 httpd.exp
-rwxr-xr-x  1 root  wheel  995417 Aug 26 00:00 libphp4.so
-rwxr-xr-x  1 root  wheel    9034 Sep 14 09:55 mod_access.so
-rwxr-xr-x  1 root  wheel    7718 Sep 14 09:55 mod_actions.so
-rwxr-xr-x  1 root  wheel   12645 Sep 14 09:55 mod_alias.so
-rwxr-xr-x  1 root  wheel    7438 Sep 14 09:55 mod_asis.so
-rwxr-xr-x  1 root  wheel   10346 Sep 14 09:55 mod_auth.so
-rwxr-xr-x  1 root  wheel    7664 Sep 14 09:55 mod_auth_anon.so
-rwxr-xr-x  1 root  wheel    9614 Sep 14 09:55 mod_auth_dbm.so
-rwxr-xr-x  1 root  wheel   35767 Sep 14 09:55 mod_auth_digest.so
-rwxr-xr-x  1 root  wheel   34026 Sep 14 09:55 mod_autoindex.so
-rwxr-xr-x  1 root  wheel   32048 Sep 14 09:55 mod_cache.so
-rwxr-xr-x  1 root  wheel    9207 Sep 14 09:55 mod_cern_meta.so
-rwxr-xr-x  1 root  wheel   26217 Sep 14 09:55 mod_cgi.so
-rwxr-xr-x  1 root  wheel   16342 Sep 14 09:55 mod_charset_lite.so
-rwxr-xr-x  1 root  wheel   96735 Sep 14 09:55 mod_dav.so
-rwxr-xr-x  1 root  wheel   49323 Sep 14 09:55 mod_dav_fs.so
-rwxr-xr-x  1 root  wheel   16459 Sep 14 09:55 mod_deflate.so
-rwxr-xr-x  1 root  wheel    7603 Sep 14 09:55 mod_dir.so
-rwxr-xr-x  1 root  wheel   18146 Sep 14 09:55 mod_disk_cache.so
-rwxr-xr-x  1 root  wheel    7685 Sep 14 09:55 mod_env.so
-rwxr-xr-x  1 root  wheel   11623 Sep 14 09:55 mod_expires.so
-rwxr-xr-x  1 root  wheel   11376 Sep 14 09:55 mod_file_cache.so
-rwxr-xr-x  1 root  wheel   13493 Sep 14 09:55 mod_headers.so
-rwxr-xr-x  1 root  wheel   15186 Sep 14 09:55 mod_imap.so
-rwxr-xr-x  1 root  wheel   43248 Sep 14 09:55 mod_include.so
-rwxr-xr-x  1 root  wheel   15761 Sep 14 09:55 mod_info.so
-rwxr-xr-x  1 root  wheel   23965 Sep 14 09:55 mod_log_config.so
-rwxr-xr-x  1 root  wheel    7950 Sep 14 09:55 mod_logio.so
-rwxr-xr-x  1 root  wheel   17333 Sep 14 09:55 mod_mime.so
-rwxr-xr-x  1 root  wheel   25121 Sep 14 09:55 mod_mime_magic.so
-rwxr-xr-x  1 root  wheel   32560 Sep 14 09:55 mod_negotiation.so
-rwxr-xr-x  1 root  wheel   63669 Sep 14 09:55 mod_rewrite.so
-rwxr-xr-x  1 root  wheel   11523 Sep 14 09:55 mod_setenvif.so
-rwxr-xr-x  1 root  wheel   12339 Sep 14 09:55 mod_speling.so
-rwxr-xr-x  1 root  wheel  196933 Sep 14 09:55 mod_ssl.so
-rwxr-xr-x  1 root  wheel   21833 Sep 14 09:55 mod_status.so
-rwxr-xr-x  1 root  wheel    9574 Sep 14 09:55 mod_unique_id.so
-rwxr-xr-x  1 root  wheel    8730 Sep 14 09:55 mod_userdir.so
-rwxr-xr-x  1 root  wheel   11439 Sep 14 09:55 mod_usertrack.so
-rwxr-xr-x  1 root  wheel    9919 Sep 14 09:55 mod_vhost_alias.so
[Wed Sep 15 01:00:00 2004] [notice] SIGHUP received.  Attempting to 
restart
[Wed Sep 15 01:00:00 2004] [notice] seg fault or similar nasty error 
detected in the parent process
[Wed Sep 15 07:17:43 2004] [warn] pid file /var/run/httpd.pid 
overwritten -- Unclean shutdown of previous Apache run?
[Wed Sep 15 07:17:43 2004] [notice] Apache/2.0.50 (FreeBSD) PHP/4.3.8 
configured -- resuming normal operations


On Sep 15, 2004, at 1:54 AM, Clement Laforet wrote:

> Hi Greg.
>
> Can you please send me the list of your modules?
> If you use PHP you should consider upgrading it, since I already have
> this problem, and upgrading php fixes the problem.
>
> regards,
> clem
Comment 4 satz 2004-10-14 06:06:43 UTC
The problem persisted regardless of whether there was a 
/etc/nsswitch.conf file so I spent some time and think I have it 
figured out. I have mail/squirrelmail installed which depends on 
lang/php4 which in turn depends on security/php4-mhash. mhash was 
trying to use the libpthread.so. At one point this machine ran CURRENT 
but I reverted back to 5.2.1. I had an old libpthread.so which mhash 
linked against. The crash was apparently confusion between the 
different threading libraries. I had to remove the libpthread and setup 
a libmap.conf to use libthr.so.

Now httpd survives a HUP signal like it was meant to.

Thanks,
Greg
Comment 5 Clement Laforet freebsd_committer freebsd_triage 2004-10-14 08:20:34 UTC
State Changed
From-To: open->closed

Submitter said that the problem in fact related to php-mhash 
extension.