Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 80413 - "Broken pipe" with useradd/userdel from shadow w/nscd
Summary: "Broken pipe" with useradd/userdel from shadow w/nscd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: Highest major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 81927 92650 93234 93458 95760 97268 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-01 19:44 UTC by Derek Dolney
Modified: 2005-08-11 02:51 UTC (History)
10 users (show)

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


Attachments
strace output (trace.txt,22.66 KB, text/plain)
2005-02-10 10:29 UTC, Derek Dolney
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Dolney 2005-02-01 19:44:47 UTC
Both the useradd and userdel utilities are broken for me when using shadow-4.0.6-r1. They both just say "Broken pipe" and fail to add or delete the user.

shadow-4.0.5 versions work fine.

Portage 2.0.51-r15 (default-linux/x86/2005.0, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6 i686)
=================================================================
System uname: 2.6.10-gentoo-r6 i686 AMD Athlon(tm) XP 2100+
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jan  3 2005, 16:13:30)]
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -Os -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /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="-march=athlon-xp -O2 -Os -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks noclean sandbox sfperms userpriv"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo http://mirrors.tds.net/gentoo http://gentoo.chem.wisc.edu/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="x86 3dnow X acpi adns alsa apache2 atlas berkdb bitmap-fonts bonobo bzlib crypt directfb dvd f77 fam fbcon fftw fortran gdbm gif gimpprint gnome gpm gstreamer gtk gtk2 guile imagemagick imlib java jpeg lesstif libg++ libwww maildir mime mmap mmx mozilla moznoirc moznomail mpeg ncurses nptl nptlonly oggvorbis opengl oss pam pdflib perl pic png python quicktime readline real rtc sdl shared spell sse ssl tcpd tetex threads tiff truetype truetype-fonts type1-fonts unicode usb userlocales xml xml2 xmms xv zlib video_cards_radeon"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL
Comment 1 SpanKY gentoo-dev 2005-02-06 15:18:55 UTC
try with CFLAGS="-pipe" ?
Comment 2 SpanKY gentoo-dev 2005-02-06 15:41:44 UTC
please try 4.0.7 too
Comment 3 Derek Dolney 2005-02-07 20:49:26 UTC
As far as I understand, the -pipe option to gcc only affects the compilation process. The tools seem to build fine, but give the "Broken pipe" at runtime.

Same problem with 4.0.7.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2005-02-10 09:54:08 UTC
Can you run:

  strace -ff <your useradd command> &> trace.txt

and attach the trace.txt here.
Comment 5 Derek Dolney 2005-02-10 10:29:25 UTC
Created attachment 50926 [details]
strace output

This is using shadow-4.0.7.

I discovered that useradd and userdel both work fine if nscd is not running,
but fail with the attached strace when nscd is running.
Comment 6 Sven Wegener gentoo-dev 2005-02-13 18:05:31 UTC
*** Bug 81927 has been marked as a duplicate of this bug. ***
Comment 7 Csaba Tóth 2005-04-15 05:16:43 UTC
i have the same error here.
my experience is that my nscd freezes, after the useradd command, i can't stop it with init.d/nscd stop, i should kill it by killall nscd.

my emerge info:
mars ~ # emerge info
Portage 2.0.51.19 (hardened/x86/2.6, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.10-hardened-r3-mars-01 i686                )
=================================================================
System uname: 2.6.10-hardened-r3-mars-01 i686 Intel(R) Celeron(R) CPU 2.60GHz
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Feb 24 2005, 16:02:23)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.8.5-r3, 1.9.5, 1.6.3, 1.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -mtune=pentium4 -mfpmath=sse -fPIC -pipe -fomit-frame-pointer -msse -mmmx"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/                kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -mtune=pentium4 -mfpmath=sse -fPIC -pipe -fomit-frame-pointer -msse -mmmx"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks fixpackages sandbox"
GENTOO_MIRRORS="http://gentoo.mirror.icd.hu/ ftp://ftp.gentoo.mesh-solutions.com/gentoo/ ftp://mirror.nutsmaas.nl                /gentoo/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://212.219.56.146/sites/www.ibiblio.org/gentoo/ http                ://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LANG="hu_HU.utf8"
LC_ALL="hu_HU.utf8"
MAKEOPTS="-j1"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac accounting acl acpi acpi4linux activefilter adns apache2 apm arts asm bash-completion bcmath berkdb bz                ip2 bzlib c++ calendar cap caps cdparanoia cdr cdrom chroot clamac clamav cracklib crypt ctype cups curl curlwrap                pers cyrus dba dbase dbm devfs devfs26 devmap dhcp dio directfb dlloader dmx dnd dnsdb drac dv dvb dvd dvdr dvdre                ad encode erandom escreen esd ethereal evms2 exif extensions f2c fam fastcgi flac freetype fs ftp gcj gd gdbm geo                ip gif gmp gnutls gpm gtk gtk2 guile hal hardened iconv idled image imagemagick imap imlib inifile innodb intl ip                v6 java javascript jikes jpeg jpeg2k junit ldap lesstif libg++ libwww live lm_sensors lzo lzw lzw-tiff mcal memli                mit mhash mime mmap mmx mmx2 mng mp3 mpeg mpeg4 mpm-prefork mpm-worker mppe-mppc msdav msession mysql ncurses net                hack network nls nptl nptlonly ntlm oav objc odbc oggvorbis openal opengl openssh pam parse-clocks pcap pcntl pcr                e pdf pdflib perl pg-vacuumdelay php pic pie png pnp posix postgres pthreads pwdb python qt readline recode rpc s                amba sasl sdl sftplogging shared sharedmem simplexml skey slang smime sms snmp sockets spell squid sse ssl svg sv                ga sysvipc tcltk tcpd threads tiff transcode truetype type1 unicode usb userlocales vhosts virus-scan wmf x86 xfs                 xinetd xml xml2 xmlrpc xpm zlib linguas_hu linguas_en"
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS

Comment 8 Brant Gurganus 2005-05-02 09:37:42 UTC
useradd seems to work for me by hand, but I get the broken pipe issue when portage adds a user
Comment 9 SpanKY gentoo-dev 2005-05-15 15:42:35 UTC
*** Bug 92650 has been marked as a duplicate of this bug. ***
Comment 10 barthek 2005-05-18 03:26:38 UTC
it wouldnt work for me neither by hand or when portage does that.
with nscd disabled it works fine. 
should it be filed as glibc issue as nscd is part of the ebuild ?
Comment 11 Matthew Kennedy (RETIRED) gentoo-dev 2005-05-21 11:45:40 UTC
Is this like the error message you saw?

>>> Completed installing mldonkey-2.5.16-r10 into
/var/tmp/portage/mldonkey-2.5.16-r10/image/

>>> Merging net-p2p/mldonkey-2.5.16-r10 to /
 * Adding user 'p2p' to your system ...
 *  - Userid: 104
 *  - Shell: /bin/bash
 *  - Home: /home/p2p
 *  - Groups: users
/usr/portage/eclass/eutils.eclass: line 530: 18390 Broken pipe            
useradd ${opts} ${euser} -c "added by portage for ${PN}"

!!! ERROR: net-p2p/mldonkey-2.5.16-r10 failed.
!!! Function enewuser, Line 689, Exitcode 141
!!! enewuser failed
!!! If you need support, post the topmost build error, NOT this status message.

!!! FAILED preinst: 1
mkennedy@camus:~$
Comment 12 Matthew Kennedy (RETIRED) gentoo-dev 2005-05-21 11:48:23 UTC
Oops wrong bug! Forget about Comment #11
Comment 13 SpanKY gentoo-dev 2005-06-03 15:06:52 UTC
*** Bug 93234 has been marked as a duplicate of this bug. ***
Comment 14 Martin Mokrejš 2005-06-03 15:30:26 UTC
I have the problem dbus with with shadow-4.0.7-r1 too. I could successfully do
/etc/init.d/nscd stop.
Comment 15 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-04 14:20:54 UTC
I can confirm this problem. stopping nscd helps. 
 
btw, easy test: 
 
useradd xxxxxx 
userdel xxxxxx 
 
with nscd runnig, it shows that "broken pipe".  
Comment 16 Martin Mokrejš 2005-06-04 15:25:20 UTC
# strace -f -v -v useradd xxxx
[...]
socket(PF_FILE, SOCK_DGRAM, 0)          = 8
fcntl64(8, F_SETFD, FD_CLOEXEC)         = 0
connect(8, {sa_family=AF_FILE, path="/dev/log"}, 16) = -1 EPROTOTYPE (Protocol
wrong type for socket)
close(8)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 8
fcntl64(8, F_SETFD, FD_CLOEXEC)         = 0
connect(8, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0
send(8, "<86>Jun  5 00:22:35 useradd[2601"..., 110, MSG_NOSIGNAL) = 110
socket(PF_FILE, SOCK_STREAM, 0)         = 9
fcntl64(9, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(9, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
connect(9, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0
poll([{fd=9, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1
writev(9, [{"\2\0\0\0\1\0\0\0\6\0\0\0", 12}, {"10004\0", 6}], 2) = 18
poll([{fd=9, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1
read(9, "\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377"..., 36) = 36
close(9)                                = 0
open("/var/log/faillog", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/var/log/lastlog", O_RDWR|O_LARGEFILE) = 9
_llseek(9, 2921168, [2921168], SEEK_SET) = 0
write(9, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 292) = 292
close(9)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 9
connect(9, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0
write(9, "\2\0\0\0\n\0\0\0\7\0\0\0", 12) = 12
write(9, "passwd\0", 7)                 = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
+++ killed by SIGPIPE +++
Comment 17 Andre Lammel 2005-06-06 08:51:52 UTC
Had the same problem and found BUG #66182. We are running 
the following software:

sys-apps/shadow-4.0.7-r2
sys-libs/glibc-2.3.5
sys-kernel/gentoo-sources-2.6.11-r9

~x86 2005.0

have a look at comment #2 in BUG #66182. doing this and re-
starting nscd resolved the problem on our machine. 

at least the last 5 tests i ran with user/group/add/del went
out fine :-)

perhaps this can help to solve the problem...

regards

andre
Comment 18 Andre Lammel 2005-06-06 08:54:24 UTC
update to comment #17:

forget this comment - after 10 more tests we again got
a broken pipe :-(((
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2005-06-11 03:29:01 UTC
*** Bug 95760 has been marked as a duplicate of this bug. ***
Comment 20 Stian Skjelstad 2005-06-26 09:53:23 UTC
gentoo lavaps # /etc/init.d/nscd stop
 * WARNING:  you are stopping a boot service.
 * Shutting down Name Service Cache Daemon ...                            [ ok
]gentoo lavaps # useradd mufasa
gentoo lavaps # userdel mufasa
gentoo lavaps # /etc/init.d/nscd start
 * Starting Name Service Cache Daemon ...                                 [ ok
]gentoo lavaps # useradd mufasa
gentoo lavaps # userdel mufas
userdel: user mufas does not exist


glibc: 2.3.5
shadow: 4.0.5-r3
gentoo-sources: 2.6.11-gentoo-r6
Comment 21 SpanKY gentoo-dev 2005-06-30 19:33:27 UTC
the reason earlier versions didnt fail is because they still use the old path to
the nscd socket (/var/run/.nscd_socket)

if you guys want, you can comment out the sed at the end of src_unpack where we
update the path of the socket and re-emerge shadow to work around this issue ...
Comment 22 Andrea Barisani (RETIRED) gentoo-dev 2005-07-01 02:04:33 UTC
*** Bug 97268 has been marked as a duplicate of this bug. ***
Comment 23 Stian Skjelstad 2005-07-01 03:14:00 UTC
(In reply to comment #21)
> the reason earlier versions didnt fail is because they still use the old path to
> the nscd socket (/var/run/.nscd_socket)

Then connect() call from strace output should have failed. It gets a SIGPIPE
after a write. Looks like nscd closes the connection.
Comment 24 SpanKY gentoo-dev 2005-07-01 06:38:33 UTC
it gets a sigpipe after the second write ... if it were a connection issue i
imagine the first write would have failed too
Comment 25 Stian Skjelstad 2005-07-01 06:54:43 UTC
connect() would have failed too. But if path was wrong before, that meens nscd
never was exposed until then. It looks like an upstream bug (caching issues and
these sigpipes)
Comment 26 Jakub Moc (RETIRED) gentoo-dev 2005-07-07 16:08:04 UTC
shadow-4.0.7-r2 broke it for me, shadow-4.0.5-r3 worked fine :/
Comment 27 SpanKY gentoo-dev 2005-07-07 16:10:23 UTC
gee, maybe you should read comment #21 where i explain why earlier versions of
shadow 'work'
Comment 28 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-08 06:16:53 UTC
Fixed in shadow-4.0.7-r3.
Comment 29 Jakub Moc (RETIRED) gentoo-dev 2005-08-11 02:51:29 UTC
*** Bug 93458 has been marked as a duplicate of this bug. ***