Greetings,
As part of /etc/cron.daily, msec is run. As part of msec, netstat -pvlA
inet is run and seg faults. The seg faults first occurred July 5 (while
I was on vacation) and have occurred every day since then.
Here're the first few lines of the email sent by Cron Daemon:
error running postrotate script
run-parts: /etc/cron.daily/logrotate exited with return code 1
/etc/cron.daily/msec: line 130: 14467 Segmentation fault netstat -pvlA
inet 2/dev/null ${OPEN_PORT_TODAY}
Running netstat -pvlA inet by hand gives the segmentation fault - right
after the last tcp line. Running under gdb, I've learned that the
problem is in strcpy().
To learn more about what is going on, I downloaded the
net-tools-1.60-2mdk.src.rpm and rebuilt the executable. Naturally this
works properly.
Anybody know what's going on?
Thanks.
David
P.S. Here are the outputs from the two versions of netstat:
## Running official Mandrake 8.2 version, i.e. /bin/netstat, under gdb
##
[root@nic /]# cd /bin
[root@nic bin]# ls -l netstat
-rwxr-xr-x1 root root89052 Jun 21 2001 /bin/netstat*
[root@nic bin]# gdb netstat
Current directory is /bin/
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB. Type show warranty for details.
This GDB was configured as i386-mandrake-linux...(no debugging symbols
found)...
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign
Address State PID/Program name
tcp0 0
*:login *:* LISTEN 31398/xinetd
tcp0 0
*:shell *:* LISTEN 31398/xinetd
tcp0 0
*:trivnet1 *:* LISTEN
20944/httpd-perl
tcp0 0 nic.osagesoftware.:5865
*:* LISTEN 10705/junkbuster
tcp0 0
*:netbios-ssn *:* LISTEN -
tcp0 0
*:pop3 *:* LISTEN 31398/xinetd
tcp0 0
*:sunrpc*:* LISTEN 677/portmap
tcp0 0
*:http *:* LISTEN 20961/httpd
tcp0 0 www-ext.osagesof:domain
*:* LISTEN 31294/named
tcp0 0 nic.osagesoftwar:domain
*:* LISTEN 31294/named
tcp0 0 localhost.osages:domain
*:* LISTEN 31294/named
tcp0 0
*:ftp *:* LISTEN 1283/proftpd
(accep
tcp0 0
*:ssh *:* LISTEN 5723/sshd
tcp0 0
*:telnet*:* LISTEN 31398/xinetd
tcp0 0
*:3128 *:* LISTEN 10786/(squid)
tcp0 0 localhost.osagesoft:953
*:* LISTEN 31294/named
tcp0 0
*:smtp *:* LISTEN 3903/master
tcp0 0
*:https *:* LISTEN 20961/httpd
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0804a020 in strcpy ()
(gdb) where
#0 0x0804a020 in strcpy ()
#1 0x in ?? ()
(gdb) q
The program is running. Exit anyway? (y or n) y
Debugger finished
## Running netstat, built from net-tools-1.60-2mdk.src.rpm ##
[root@nic /]# cd /usr/src/RPM/BUILD/net-tools-1.60/netstat
[root@nic net-tools-1.60]# ll netstat
-rwxr-x--x1 root root90380 Jul 14 09:42
/usr/src/RPM/BUILD/net-tools-1.60/netstat*
[root@nic net-tools-1.60]# ./netstat -pvlA inet
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign
Address State PID/Program name
tcp0 0
*:login *:* LISTEN 31398/xinetd
tcp0 0
*:shell *:* LISTEN 31398/xinetd
tcp0 0
*:trivnet1 *:* LISTEN
20944/httpd-perl
tcp0 0 nic.osagesoftware.:5865
*:* LISTEN 10705/junkbuster
tcp0 0
*:netbios-ssn *:* LISTEN -
tcp0 0
*:pop3 *:* LISTEN 31398/xinetd
tcp0 0
*:sunrpc*:* LISTEN 677/portmap
tcp0 0
*:http *:* LISTEN 20961/httpd
tcp0 0 www-ext.osagesof:domain
*:* LISTEN 31294/named
tcp