[Bug Report]

-----------------------------
Category:  Other
Package:   nam ns-allinone-2.30
OS:        GNU/Linux (Fedora core, both version 6 and 7) 
Environment Variables:
KDE_MULTIHEAD=false
SSH_AGENT_PID=3183
HOSTNAME=blinky
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
KDE_NO_IPV6=1
GS_LIB=/home/russell/.fonts
WINDOWID=48234503
KDE_FULL_SESSION=true
USER=russell
LD_LIBRARY_PATH=, /home/russell/ns-2/ns-allinone-2.30/otcl-1.12, 
/home/russell/ns-2/ns-allinone-2.30/lib
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
TCL_LIBRARY=, /home/russell/ns-2/ns-allinone-2.30/tcl8.4.13/library
SSH_AUTH_SOCK=/tmp/ssh-SPqkYw3135/agent.3135
KDEDIR=/usr
SESSION_MANAGER=local/blinky:/tmp/.ICE-unix/3255
USERNAME=russell
XDG_CONFIG_DIRS=/etc/kde/xdg:/etc/xdg
KONSOLE_DCOP=DCOPRef(konsole-2009,konsole)
PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/russell/bin:/home/russell/ns-2/ns-allinone-2.30/bin:/home/russell/ns-2/ns-allinone-2.30/tcl8.4.13/unix:/home/russell/ns-2/ns-allinone-2.30/tk8.4.13/unix
DESKTOP_SESSION=default
MAIL=/var/spool/mail/russell
GDM_XSERVER_LOCATION=local
KONSOLE_DCOP_SESSION=DCOPRef(konsole-2009,session-1)
PWD=/home/russell
INPUTRC=/etc/inputrc
[EMAIL PROTECTED]
LANG=en_US.UTF-8
KDE_IS_PRELINKED=1
GDMSESSION=default
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=3
HOME=/home/russell
LOGNAME=russell
CVS_RSH=ssh
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YA16wocG6a,guid=5e6d55f3b34088d49b768000460bd777
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0
G_BROKEN_FILENAMES=1
COLORTERM=
XAUTHORITY=/tmp/.gdmUL4WPT
_=/usr/bin/env



-----------------------------
Description:


Description of Problem:

Using Fedora Core 5 and 6, with the smb service running and system setup for 
network name resolution using wins (ie /etc/nsswitch.conf contains the line 
"hosts: wins files dns"), then when nam is run the application *sometimes* 
quits with the error reported in "actual results" section below.


How Easily Reproducible:
Once the problem starts to occur, then it is highly reproducible.

In my case, removing the "wins" entry from the hosts line in /etc/nsswitch.conf 
seems to cure the problem everytime, (see comments in the "addition 
information" section for the association of this problem with name resolution 
using wins)

However, reinserting "wins" back into the hosts line of nsswitch.conf, after a 
succesful run, does not always result in the problem re-occuring immediately.



Steps to Reproduce:
(describe the minimal set of steps necessary to trigger the bug)
1. GNU/Linux Fedora Core 5 or 6
2. Set hosts line in /etc/nsswitch.conf to be "hosts: wins files dns" (i.e. 
network name resolution using wins is enabled)
3. ensure that smb service is installed and running
4. run nam (with or without arguments)


Actual Results:
(describe what the application did after performing the above steps)

> random() called in nam.
> Random is not portable, please use Random::uniform() instead.
> Aborted

Expected Results:
(describe what the application should have done, were the bug not present)

The program should run, without errors or otherwise failing. 


Additional Information:

The error message is generated by the random() function in 
s-allinone-2.30/nam-1.12/random.cc

Recompiling nam with -g option, debugging in gdb and running a backtrace gives 
the following: 

(gdb) backtrace 14
#0  0x001e9402 in __kernel_vsyscall ()
#1  0x006f8d40 in raise () from /lib/libc.so.6
#2  0x006fa591 in abort () from /lib/libc.so.6
#3  0x08071dc7 in random ()
#4  0x00257297 in sys_random () from /lib/libnss_wins.so.2
#5  0x0024b2f3 in startlmhosts () from /lib/libnss_wins.so.2
#6  0x0024b475 in name_query () from /lib/libnss_wins.so.2
#7  0x0024bc37 in resolve_wins () from /lib/libnss_wins.so.2
#8  0x0020500e in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
#9  0x007b3d87 in gethostbyname_r@@GLIBC_2.1.2 () from /lib/libc.so.6
#10 0x007b36df in gethostbyname () from /lib/libc.so.6
#11 0x081ac9c1 in CreateSocketAddress ()
#12 0x081aca51 in CreateSocket ()
#13 0x081ad07e in Tcl_OpenTcpClient ()
(More stack frames follow...)

>From the backtrace, it is apparently that the problematic random() function is 
>called from libnss_wins.so.2.  WTF!!!  Changing the hosts line in 
>/etc/nsswitch.conf to "hosts: file dns" (i.e. stop libnss_wins.so.2 from being 
>called) seems to fix the problem everytime.

However, once the application has successfully run following the removal of the 
wins entry, then reinsterting the wins entry back into nsswitch.conf does not 
immediately/always result in the problem re-occuring (without a reboot???).




Reply via email to