LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "netstat -l" gives "segmentation fault" (http://www.linuxquestions.org/questions/linux-newbie-8/netstat-l-gives-segmentation-fault-798944/)

Earwig 03-30-2010 02:39 PM

"netstat -l" gives "segmentation fault"
 
Hi!

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 03:03 PM

http://www.dslreports.com/forum/remark,15011543
Quote:

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 05: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 03:37 PM.