July 27, 2005 3:58 PM
I had set up Samba last week so that I could share files with my brand new Thinkpad1 T42 over wi-fi. I still haven't installed any sort of Linux on it. The wireless network was working great, I could get a response for ping and all. But WinXP on the Thinkpad kept on complaining about an incorrect pathname whenever I tried to access the Samba share. After the failed attempt at setting up Samba, Firefox simply wouldn't start.

I got the following error message while running Firefox:

/usr/lib/firefox-1.0.4/run-mozilla.sh: line 451:  5062 Segmentation fault
"$prog" ${1+"$@"}

All other applications which use the network including mozilla, yum, wget, etc. also began to give me segmentation faults. It was scary. Googling returned way too much information. To all those who do not know, I'm running Fedora Core 2 kernel version 2.6.10-1.771_FC2.

In the end, I decided to debug firefox using GDB. Simply running gdb firefox won't get the job done because /usr/lib/firefox-1.0.4/firefox is a shell script. Running gdb firefox-bin won't help either. Run the following commands to debug Firefox:

# change /usr/lib/firefox-1.0.4 to the path where firefox is installed
cd /usr/lib/firefox-1.0.4
./run-mozilla -g firefox-bin -d gdb

Single stepping using GDB showed that the segmentation fault occurs when _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2 is executed.

Similarly, running GDB on wget, yum etc showed the same thing. Apparently, this is a documented bug.

The solution is to edit /etc/nsswitch.conf and remove2 wins from the hosts line. According to the bug report, there should be no problem if your local network is up and running. Otherwise, you'll have to remove wins from nsswitch.conf.

CategoryLinux Comment(s)


[1] Woohoo!
[2] I had added wins while setting up Samba.

Copyright © 2004-2011 Anirudh Sasikumar. All rights reserved.
Last Updated: July 27, 2005 5:02 PM