-   Linux - Newbie (
-   -   "netstat -l" gives "segmentation fault" (

Earwig 03-30-2010 01:39 PM

"netstat -l" gives "segmentation fault"

I typed "netstat -l" to see what ports are in use. The commands works fine on all the other CentOS systems I have. But on this one, it just replies "Segmentation fault".

I just could not think what might cause that and eventually wondered if it was a memory problem. I ran "memtest" but the memory was fine. I then decided to upgrade the firmware, which I did. I know that was a bit drastic, but I really could not think of anything better to do! It did NOT fix the problem.

Does anyone have a better idea I could try?
Many thanks!

paulsm4 03-30-2010 02:03 PM,15011543

Because version 1.60 netstat segmentation faults on more than one of our boxes, and the way I fix it is to edit netstat.c and change "int inode" to "unsigned int inode" in the three places that is used, and recompile.

It coredumps because the hash function hashes a negative inode number to a negative hash array number.
There's a few patches out there that distros are applying though. Some for 2.6 systems, gcc3.4 and some others.

Earwig 03-31-2010 04:12 PM

That is an excellent answer. Glad I posted my question, it is the first one I have ever actually posted! The solution is a little advanced for me, but it will be interesting trying to do this as you say. I will let you know how it goes, and let you know if I need to ask any further details. Just thought I would write this as an intermediate reply, so you know I have read the response.

All times are GMT -5. The time now is 07:15 PM.