Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 198756 - net-misc/memcached segfault when launched with P (pidfile) flag like in init script
Summary: net-misc/memcached segfault when launched with P (pidfile) flag like in init ...
Status: RESOLVED DUPLICATE of bug 195248
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-10 23:32 UTC by Jeff Mitchell
Modified: 2007-11-11 08:36 UTC (History)
0 users

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 Jeff Mitchell 2007-11-10 23:32:41 UTC
I get a repeatable segfault from memcached 1.2.2 (~amd64 masked) when trying to run it.  Upon taking the command line from the init script, I have found that if the -P <pidfile> flag is used like in the init script, memcache immediately segfaults.  Otherwise it is fine.

Reproducible: Always

Steps to Reproduce:
1. Start memcached via the init script, or manually with -P flag
2.
3.

Actual Results:  
Segfault

Expected Results:  
No segfault, working normally

Here are some lines from running strace on it:

open("/lib/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200 \0\0"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0755, st_size=43344, ...}) = 0
mmap(NULL, 2139464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x2afb20e58000
mprotect(0x2afb20e62000, 2093056, PROT_NONE) = 0
mmap(0x2afb21061000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9000) = 0x2afb21061000
close(4)                                = 0
mprotect(0x2afb21061000, 4096, PROT_READ) = 0
mprotect(0x2afb20e56000, 4096, PROT_READ) = 0
munmap(0x2afb1ffba000, 139604)          = 0
open("/etc/passwd", O_RDONLY)           = 4
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
lseek(4, 0, SEEK_CUR)                   = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=3013, ...}) = 0
mmap(NULL, 3013, PROT_READ, MAP_SHARED, 4, 0) = 0x2afb1ffba000
lseek(4, 3013, SEEK_SET)                = 3013
munmap(0x2afb1ffba000, 3013)            = 0
close(4)                                = 0
setgid(2)                               = 0
setuid(110)                             = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2afb2082cf70) = 19209
--- SIGCHLD (Child exited) @ 0 (0) ---
exit_group(0)                           = ?
Process 19208 detached

The directory that is specified is owned by the memcached user, and the pidfile is created.

emerge --info:

Portage 2.1.3.16 (default-linux/amd64/2006.0, gcc-4.1.1, glibc-2.6.1-r0, 2.6.22-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r8 x86_64 Intel(R) Pentium(R) D CPU 3.00GHz
Timestamp of tree: Sat, 10 Nov 2007 03:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip X X509 a52 aac aalib acpi aiglx aim alisp alsa amarok amd64 ao apache2 arts asf async audiofile authfile authlib automount avalon bash-completion bcmath bdf berkdb bidi bitmap-fonts bittorrent bonobo branding bzip2 cairo calendar cddb cdparanoia cgi chroot cjk clamav clamd cli commercial contentcache cracklib crypt css ctype cups curl curlwrappers d daap dbus dcc dcraw dga dio directfb disassembler dovecot-sasl dri dts dvd dvdr dvdread ecc eds emacs emboss encode esd ethereal exif expat extraengine extrafilters fam fame fastcgi fat ffmpeg fftw firefox flac fltk font-server fontconfig foomaticdb force-cgi-redirect fortran fpx ftp fuse gd gdbm gif glut gmp gnome gpgme gpm graphviz gs gstreamer gtk gtk2 gtkhtml guile hal hash hdri howl howl-compat hpn iconv icq id3 idea idn ifsession imagemagick imap imlib innodb inode iproute2 ipv6 irc isdnlog jabber java javamail javascript jbig jce jikes jms jmx joystick jpeg jpeg2k json jython kde kdeenablefinal lame largeterminal latex lcms ldap libcaca libedit libg++ libvisual libwww lm_sensors logitech-mouse logrotate lzo lzw lzw-tiff mad mailbox maildir math mbox mcal mdnsresponder-compat memlimit mhash midi mikmod mime mjpeg mmap mng modplug mono motif mouse mozilla mozsvg mp3 mp4live mpeg mpeg2 mplayer msn mule multiuser musepack musicbrainz mysql mysqli ncurses nethack netpbm network new-login nfs nis nls nocardbus nptl nptlonly nsplugin ntfs nvidia nxclient offensive ogg oggvorbis on-the-fly-crypt openexr opengl openmp openntpd openssh oss pam pango passwordsave paste64 pcntl pcre pear pear-db perl php plotutils pmu png pop3d posix postfix ppds pppd pulseaudio python qt3 qt3support qt4 quicktime rdesktop readline reflection reiserfs restrict rewrite rhino rt2500pci ruby samba sasl script sdl sensord session shaper sharedext sharedmem shorten sieve simplexml sitemisc slang slp smime sndfile soap sockets socks5 softquota spamassassin speex spell spl sql sqlite sqlite3 ssl streamzap svg svgz sysfs syslog sysvipc tcl tcltk tcpd theora threads tiff tk tokenizer tools transcode truetype truetype-fonts type1 type1-fonts ucs2 unicode unzip usb utempter utf8 utils v4l v4l2 vcd vda vfat vhosts vim-syntax visualization vorbis vroot webdav wma wmf wordperfect wv wxwindows xcb xemacs xface xforms xfs xinerama xinetd xml xmlreader xmlrpc xmlwriter xorg xosd xpm xprint xrandr xscreensaver xsl xslt xv xvid xvmc yahoo zeroconf zip zlib" ALSA_CARDS="usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv fbdev nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeff Mitchell 2007-11-10 23:36:23 UTC
Stable 1.1.13 does not exhibit this behavior.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-11-11 08:36:09 UTC

*** This bug has been marked as a duplicate of bug 195248 ***