Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71355 - nasd Segmentation Fault
Summary: nasd Segmentation Fault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-15 21:36 UTC by Mark Wagner
Modified: 2004-12-06 12:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wagner 2004-11-15 21:36:30 UTC
nasd (of media-libs/nas) emerge works normally on a single-processor Opteron amd64 machine, but a segmentation fault is the only result of attempting to start the daemon.

Here is the gdb output:

(gdb) run
Starting program: /var/tmp/portage/nas-1.6c-r2/work/nas-1.6c/server/nasd

Program received signal SIGSEGV, Segmentation fault.
0x0000003e6936c3f0 in strlen () from /lib/tls/libc.so.6
(gdb) where
#0  0x0000003e6936c3f0 in strlen () from /lib/tls/libc.so.6
#1  0x0000003e6934127c in vfprintf () from /lib/tls/libc.so.6
#2  0x0000003e6935b295 in vsprintf () from /lib/tls/libc.so.6
#3  0x0000003e693477a8 in sprintf () from /lib/tls/libc.so.6
#4  0x000000000041789d in AuthAudit (client=1, letin=0, saddr=0x7fbffff310,
    len=16, proto_n=18, auth_proto=0x5400a0 "MIT-MAGIC-COOKIE-1")
    at connection.c:1352
#5  0x00000000004179f7 in ClientAuthorized (client=0x53fe00, proto_n=18,
    auth_proto=0x5400a0 "MIT-MAGIC-COOKIE-1", string_n=16,
    auth_string=0x5400b4 "\uffffH\uffff\uffff\uffff]\033\2140\uffffSy\233\214-i") at connection.c:1425
#6  0x0000000000412b90 in ProcEstablishConnection (client=0x53fe00)
    at dispatch.c:445
#7  0x00000000004124d2 in Dispatch () at dispatch.c:197
#8  0x0000000000402541 in main (argc=1, argv=0x7fbffff788) at main.c:185

Can be fixed by adding 

#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

to server/os/connection.c

Looking at bug #44070, I despair that the nas code is riddled with these forgotten includes.

Reproducible: Always
Steps to Reproduce:
1. Start nasd.
2. Set AUDIOSERVER to something that causes AF_INET to be used (rather than the default AF_UNIX) such as `hostname`:0
3. Run auinfo (or anything that uses nasd).

Actual Results:  
SEGV, as detailed above.

Expected Results:  
Info about sound capabilites.

Portage 2.0.51-r3 (default-linux/amd64/2004.3, gcc-3.4.3,
glibc-2.3.4.20041102-r0, 2.6.9-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.9-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.6
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe -frename-registers -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -frename-registers -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://www.lanfear.net/gentoo-portage"
USE="amd64 X Xaw3d aalib acl acpi adns alsa avi berkdb bitmap-fonts bmp bonobo
cddb cdparanoia cdr crypt cscope cups dga directfb divx4linux dmx dv dvd dvdread
edl emacs encode f77 faac faad fbcon flac fltk foomaticdb gd gdbm geoip gif gpm
graphviz gstreamer gtk gtk2 gtkhtml guile hal idea imagemagick imlib ipv6 jack
javascript jbig jikes jp2 jpeg junit libwww live lm_sensors lzo lzw lzw-tiff mad
mailwrapper matroska mbox mikmod milter mmap mng mozilla mpeg multilib nas
ncurses network nls nptl nvidia oggvorbis opengl oss pam pcre pdflib perl
perlsuid pic plotutils png portaudio ppds python quicktime readline rtc ruby sdl
silc slang slp sndfile snmp speex spell ssl svg tcltk tcpd tetex tga theora tiff
truetype unicode usb userlocales wmf xanim xml xml2 xmms xpm xprint xrandr xv
xvid xvmc yv12 zlib video_cards_nvidia"
Comment 1 Mark Wagner 2004-11-15 21:37:24 UTC
Damn, forgot to say I'm using 1.6c-r2 of nas.
Comment 2 Jeremy Huddleston (RETIRED) gentoo-dev 2004-11-16 16:33:43 UTC
could you test if this problem is corrected using nas-1.7?
Comment 3 Mark Wagner 2004-11-19 17:24:15 UTC
It isn't fixed in nas-1.7:

freddy ~ # export AUDIOSERVER=`hostname`:0
freddy ~ # auinfo 

 (gdb) run
Starting program: /var/tmp/portage/nas-1.7/work/nas-1.7/server/nasd 
@(#)Network Audio System Release 1.7

Program received signal SIGSEGV, Segmentation fault.
0x0000003e6936c3f0 in strlen () from /lib/tls/libc.so.6
(gdb) where
#0  0x0000003e6936c3f0 in strlen () from /lib/tls/libc.so.6
#1  0x0000003e6934127c in vfprintf () from /lib/tls/libc.so.6
#2  0x0000003e6935b295 in vsprintf () from /lib/tls/libc.so.6
#3  0x0000003e693477a8 in sprintf () from /lib/tls/libc.so.6
#4  0x0000000000410424 in AuthAudit ()
#5  0x0000000000410597 in ClientAuthorized ()
#6  0x000000000040c81e in ProcEstablishConnection ()
#7  0x000000000040c3ba in Dispatch ()
#8  0x00000000004021de in main ()

Adding the includes:

freddy ~ # export AUDIOSERVER=`hostname`:0
freddy ~ # auinfo 
auinfo:  unable to connect to audio server

(Which is normal due to invalid credentials.)

(gdb) run
Starting program: /var/tmp/portage/nas-1.7/work/nas-1.7/server/nasd 
@(#)Network Audio System Release 1.7
AUDIT: Fri Nov 19 17:21:15 2004: 22241 nasd: client 1 rejected from IP 10.0.0.1 port 48479

I was planning on using nas instead of the E sound daemon for remote sound. However, since nsa since to have major problems on AMD64 I think I'm just going to use esd.

Feel free to make this bug WONTFIX.
Comment 4 Jeremy Huddleston (RETIRED) gentoo-dev 2004-11-22 19:09:29 UTC
fixed in 1.7-r1... please confirm.
Comment 5 Mark Wagner 2004-12-06 12:27:38 UTC
Yes, that fixed it.