Re: [Cooker] Problem with netstat
Some more info about my problems with netstat: Program received signal SIGSEGV, Segmentation fault. 0x08049941 in prg_cache_get (inode=-979118814) at netstat.c:281 281 if (pn-inode==inode) return(pn-name); (gdb) print pn $1 = (struct prg_node *) 0x68 (gdb) print hi $2 = 4294967185 (gdb) up #1 0x0804ca82 in unix_do_one (nr=15, line=0xbfffd420 f3c0a0e0: 000D 0002 01 -979118814 /dev/log\n) at netstat.c:1215 1215printf(%- PROGNAME_WIDTHs s,(has HAS_INODE?prg_cache_get(inode):-)); (gdb) print inode $4 = -979118814 That's a very strange inode, especially since ls disagrees: $ ls --inode /dev/log 5195 /dev/log= It gets that info from #2 0x0804cc82 in unix_info () at netstat.c:1237 1237INFO_GUTS(_PATH_PROCNET_UNIX, AF UNIX, unix_do_one); now, _PATH_PROCNET_UNIX is /proc/net/unix, and lo and behold: $ cat /proc/net/unix | grep /dev/log f3c0a0e0: 000D 0002 01 -979118814 /dev/log In fact, all the inodes in /proc/net/unix are messed up. If I do # service syslog restart then I get # cat /proc/net/unix | grep /dev/log c7b460c0: 0003 0002 01 -757341101 /dev/log The inode is still messed up. Now I have: # rpm -q sysklogd sysklogd-1.4.1-4mdk which is the latest version I believe. How can I get the entries in /proc/net/unix to be correct without a reboot? -- Ryan T. Sammartino http://members.shaw.ca/ryants/ A general leading the State Department resembles a dragon commanding ducks. -- New York Times, Jan. 20, 1981
Re: [Cooker] Problem with netstat
On Mon, Dec 16, 2002 at 10:05:14PM -0800, Ryan T. Sammartino wrote: Some more info about my problems with netstat: Program received signal SIGSEGV, Segmentation fault. 0x08049941 in prg_cache_get (inode=-979118814) at netstat.c:281 281 if (pn-inode==inode) return(pn-name); Here is a patch that works around the problem: --- netstat.c.orig 2002-12-16 22:15:10.0 -0800 +++ netstat.c 2002-12-16 22:17:09.0 -0800 @@ -277,6 +277,10 @@ unsigned hi=PRG_HASHIT(inode); struct prg_node *pn; +/* Sanity check - if inode 0, bad things happen. */ +if (hi = PRG_HASH_SIZE) + return(-); + for (pn=prg_hash[hi];pn;pn=pn-next) if (pn-inode==inode) return(pn-name); return(-); Here is a patch for the spec file: --- net-tools.spec.orig 2002-12-16 22:25:26.0 -0800 +++ net-tools.spec 2002-12-16 22:26:16.0 -0800 @@ -1,5 +1,5 @@ %define version 1.60 -%define release 5mdk +%define release 6mdk %define url http://www.tazenda.demon.co.uk/phil/net-tools/ Summary: The basic tools for setting up networking. @@ -19,6 +19,7 @@ Patch2: net-tools-1.57-bug22040.patch.bz2 Patch3: net-tools-1.60-manydevs.patch.bz2 Patch4: net-tools-1.60-virtualname.patch.bz2 +Patch5: net-tools-1.60-negative-inode.patch.bz2 %description The net-tools package contains the basic tools needed for setting up @@ -30,6 +31,7 @@ %patch2 -p1 -b .bug22040 %patch3 -p0 -b .manydevs %patch4 -p1 -b .virtualname +%patch5 -p0 -b .negative-inode bzcat %SOURCE1 ./config.h bzcat %SOURCE2 ./config.make @@ -69,6 +71,9 @@ %lang(pt_BR) %{_mandir}/pt_BR/man[158]/* %changelog +* Mon Dec 16 2002 Ryan T. Sammartino [EMAIL PROTECTED] 1.60-6mdk +- work around crash with netstat -p and negative inode numbers + * Wed Aug 21 2002 Frederic Lepied [EMAIL PROTECTED] 1.60-5mdk - merged with rh -- Ryan T. Sammartino http://members.shaw.ca/ryants/ Life can be so tragic -- you're here today and here tomorrow.
Re: [Cooker] Problem with netstat
On Tue, Dec 03, 2002 at 11:13:05PM -0800, Todd Lyons wrote: Ryan T. Sammartino wrote on Tue, Dec 03, 2002 at 11:07:44PM -0800 : ps -aux doesn't reveal any obvious processes that might be touching /dev/log, besides devfsd. [todd@trip ~]$ vdir /dev/log srw-rw-rw-1 root root0 Dec 3 17:20 /dev/log [root@trip ~]# lsof | grep '/dev/log' syslogd 802root0u unix 0xcec03a80 2887 /dev/log How does yours compare to that? # vdir /dev/log srw-rw-rw-1 root root0 Nov 29 20:29 /dev/log # lsof | grep '/dev/log' syslogd 13935root0u unix 0xf3c0a0e0 3315848482 /dev/log Not sure what to make of that -- Ryan T. Sammartino http://members.shaw.ca/ryants/ Q: What do you call a half-dozen Indians with Asian flu? A: Six sick Sikhs (sic).
Re: [Cooker] Problem with netstat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ryan T. Sammartino wrote on Mon, Dec 02, 2002 at 05:43:05PM -0800 : You have the exact same rpm versions that I do. Mine works. Try renaming netstat and then rpm -ivh --force to install the netstat rpm (which makes it write a new binary). Did not help. Any other info I can provide that might narrow this down? What I would do is bring it down to runlevel 1. This should stop all services and you should have basically nothing when you do a netstat. Verify that. Then start one service at a time and see if you can narrow down any particular service that seems to trigger it. Also, try tell it not to resolve hostnames (netstat -pn). Maybe an overly large dns response is creating some kind of havoc (we're reduced to the SWAG method now :) Blue skies... Todd - -- Todd Lyons -- MandrakeSoft, Inc. http://www.mandrakesoft.com/ UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn Cooker Version mandrake-release-9.1-0.1mdk Kernel 2.4.20-0.4mdk -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE97aXolp7v05cW2woRAnikAJ4uWK5jPTch5+jlUjBCzcM6Bl/erwCdGBWb FHDSPc7YrwU08tCasZv+O1c= =whrk -END PGP SIGNATURE-
Re: [Cooker] Problem with netstat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ryan T. Sammartino wrote on Sun, Dec 01, 2002 at 09:32:16PM -0800 : I now get # netstat -p Segmentation fault #0 0x0804dd60 in strcpy () #1 0x0805a3d0 in _IO_stdin_used () #2 0x0804b46d in strcpy () #3 0x08049f28 in strcpy () #4 0x400423e2 in __libc_start_main () from /lib/i686/libc.so.6 Still using strcpy, this could be bad. I would check the version of the program first: [root@fiji /home/todd]# vdir /bin/netstat - -rwxr-xr-x1 root root95916 Aug 21 03:07 /bin/netstat [root@fiji /home/todd]# rpm -qf /bin/netstat net-tools-1.60-5mdk Blue skies... Todd - -- Never take no as an answer from someone who's not authorized to say yes. --Ben Reser on Cooker ML Cooker Version mandrake-release-9.1-0.1mdk Kernel 2.4.20-0.4mdk -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE968lTlp7v05cW2woRAiBvAKCD9ILkydIrG/NsegR8dFczK2KjjACfemqo 0DtbvNTXuL+rfTGF2Yr7AOI= =iNdg -END PGP SIGNATURE-
Re: [Cooker] Problem with netstat
On Mon, Dec 02, 2002 at 12:57:55PM -0800, Todd Lyons wrote: Ryan T. Sammartino wrote on Sun, Dec 01, 2002 at 09:32:16PM -0800 : I now get # netstat -p Segmentation fault #0 0x0804dd60 in strcpy () #1 0x0805a3d0 in _IO_stdin_used () #2 0x0804b46d in strcpy () #3 0x08049f28 in strcpy () #4 0x400423e2 in __libc_start_main () from /lib/i686/libc.so.6 Still using strcpy, this could be bad. I would check the version of the program first: [root@fiji /home/todd]# vdir /bin/netstat -rwxr-xr-x1 root root95916 Aug 21 03:07 /bin/netstat [root@fiji /home/todd]# rpm -qf /bin/netstat net-tools-1.60-5mdk See previous e-mail. To recapitulate: $ rpm -qf /bin/netstat net-tools-1.60-5mdk $ vdir /bin/netstat -rwxr-xr-x1 root root95916 Aug 21 03:07 /bin/netstat $ rpm --verify net-tools $ And, in case it matters: $ rpm -q glibc glibc-2.2.5-20mdk -- Ryan T. Sammartino http://members.shaw.ca/ryants/ Get forgiveness now -- tomorrow you may no longer feel guilty.
Re: [Cooker] Problem with netstat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ryan T. Sammartino wrote on Mon, Dec 02, 2002 at 01:35:33PM -0800 : And, in case it matters: $ rpm -q glibc glibc-2.2.5-20mdk You have the exact same rpm versions that I do. Mine works. Try renaming netstat and then rpm -ivh --force to install the netstat rpm (which makes it write a new binary). Blue skies... Todd - -- MandrakeSoft USA http://www.mandrakesoft.com Easy things should be easy, and hard things should be possible. --Larry Wall Cooker Version mandrake-release-9.1-0.1mdk Kernel 2.4.20-0.4mdk -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE97Agvlp7v05cW2woRAjJFAJwK9toFZUMkUdsBABBt+b/Dv8i6HwCcC3XY 3V3h6LbJYBziBH0EYItOnvY= =mRSN -END PGP SIGNATURE-
Re: [Cooker] Problem with netstat
On Mon, Dec 02, 2002 at 05:26:07PM -0800, Todd Lyons wrote: Ryan T. Sammartino wrote on Mon, Dec 02, 2002 at 01:35:33PM -0800 : And, in case it matters: $ rpm -q glibc glibc-2.2.5-20mdk You have the exact same rpm versions that I do. Mine works. Try renaming netstat and then rpm -ivh --force to install the netstat rpm (which makes it write a new binary). Did not help. Any other info I can provide that might narrow this down? -- Ryan T. Sammartino http://members.shaw.ca/ryants/ Win98 is called Win98 because you need 98 MB RAM to install it.
Re: [Cooker] Problem with netstat
On Wed, Nov 27, 2002 at 08:59:08AM -0800, Ryan T. Sammartino wrote: I now get # netstat -p ... Segmentation fault Here is some more info: (gdb) run -p Starting program: /bin/netstat -p Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp0 0 x.x.x.x:x x.x.x.x:x ESTABLISHED - tcp0 0 x.x.x.x:x x.x.:x ESTABLISHED - Active UNIX domain sockets (w/o servers) Proto RefCnt Flags Type State I-Node PID/Program namePath (no debugging symbols found)... Program received signal SIGSEGV, Segmentation fault. 0x0804dd60 in strcpy () (gdb) bt #0 0x0804dd60 in strcpy () #1 0x0805a3d0 in _IO_stdin_used () #2 0x0804b46d in strcpy () #3 0x08049f28 in strcpy () #4 0x400423e2 in __libc_start_main () from /lib/i686/libc.so.6 Here are the last few lines of strace /bin/netstat -p: write(1, Proto RefCnt Flags Type ..., 82Proto RefCnt Flags Type State I-Node PID/Program namePath ) = 82 open(/proc/net/unix, O_RDONLY)= 3 fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40023000 read(3, Num RefCount Protocol Flag..., 4096) = 4096 --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ -- Ryan T. Sammartino http://members.shaw.ca/ryants/ Never put off until tomorrow what you can do today. There might be a law against it by that time.