Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 440188 - getent fails with segmentation fault, causes application installations to fail
Summary: getent fails with segmentation fault, causes application installations to fail
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 00:31 UTC by PJ
Modified: 2012-11-17 17:15 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 PJ 2012-10-30 00:31:35 UTC
I have done my best to search for similar bugs and haven't found any.

emerge --update --deep --newuse world has been repeatedly failing on a consistent set of packages for me, all of which report an error similar to the one below with a different group name:

>>> Emerging (1 of 3) www-servers/apache-2.2.23
 * httpd-2.2.23.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                     [ ok ]
 * gentoo-apache-2.2.23-20121012.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                    [ ok ]
 * Adding group 'apache' to your system ...
 *  - Groupid: 81
groupadd: group 'apache' already exists
 * ERROR: www-servers/apache-2.2.23 failed (setup phase):
 *   (no error message)
 * 
 * Call stack:
 *         ebuild.sh, line  85:  Called pkg_setup
 *         ebuild.sh, line 319:  Called apache-2_pkg_setup
 *   apache-2.eclass, line 365:  Called enewgroup 'apache' '81'
 *       user.eclass, line 343:  Called die
 * The specific snippet of code:
 *   		groupadd -r ${opts} "${egroup}" || die
 * 

'uname -a' is:

Linux 3.5.4-hardened-r1 #1 SMP Mon Oct 29 19:03:52 EDT 2012 i686 Intel(R) Pentium(R) CPU G850 @ 2.90GHz GenuineIntel GNU/Linux

emerge --info is as follows:

Portage 2.1.11.9 (hardened/linux/x86/selinux, gcc-4.5.4, glibc-2.15-r3, 3.5.4-hardened-r1 i686)
=================================================================
System uname: Linux-3.5.4-hardened-r1-i686-Intel-R-_Pentium-R-_CPU_G850_@_2.90GHz-with-gentoo-2.1
Timestamp of tree: Mon, 29 Oct 2012 18:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo bitcoin
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=nocona -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-march=i686 -O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=i686 -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://www.gtlib.gatech.edu/pub/gentoo "
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/bitcoin"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="aac afs alsa apache2 avahi berkdb bzip2 cli cracklib crypt css cups cxx dri dvd fastcgi firefox ftp gdbm gif gpm hardened iconv innodb ipv6 java6 javascript jpeg mmx modules mudflap mysql mysqli ncurses nls nptl open_perms openmp pam pax_kernel pcre pdf perl php pic png postgres pppd python readline rss ruby samba selinux session sharedext simplexml smp soap sockets sse sse2 ssl subversion tcpd threads tidy tiff tokenizer unicode urandom vhosts wddx x86 xml zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" QEMU_SOFTMMU_TARGETS="arm i386 ppc ppc64 ppcemb" QEMU_USER_TARGETS="arm armeb i386" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-30 20:35:30 UTC
Hi PJ,

Apparently, Portage tries to get information from your group database to see if a group with name "apache" already exists. This check sais no, but the moment that it wants to create a group "apache" then the system complains that such a group already exists.

There can be a number of factors that play here.

One is that you are using SELinux - do you get any denials during the emerge update, specifically related to access on /etc/group? What is the label of /etc/group and do you run SELinux already in enforcing mode, or just permissive?

One could be that your system is configured for central authentication/authorization (like an OpenLDAP having your groups) while your system has some misconfiguration so that querying only takes local settings, but manipulation uses the centralized one (which then fails).

Do you already have an "apache" group defined on the system? Especially, if you are truely updating the system, then it is very likely that apache is already installed on your system.
Comment 2 PJ 2012-11-10 20:37:57 UTC
Hi,

My apologies for not getting back to you sooner.

I'm pretty sure I am running SELinux. I set my gentoo profile hardened/linux/x86/selinux. I don't know which mode I'm running in, enforcing or permissive. I would guess it's set to whatever the default is. I'll lookup how to determine this and get back to you.

group has the following permissions:

-rw-r--r-- 1 root root 689 Aug 19 11:42 /etc/group

I don't use OpenLDAP or any kind of centralized authentication.

I do already have an 'apache' group, along with any other groups for which the corresponding emerge fails.
Comment 3 PJ 2012-11-10 20:40:37 UTC
running 'sestatus -v' just prints one line saying 'disabled'
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-11 07:39:36 UTC
I don't see a reason to believe this is a SELinux problem (nor hardened/PaX). You did select the SELinux profile, but you haven't converted the system to start using SELinux. As long as the output of sestatus tells that SELinux is disabled, nothing of SELinux is ever running, or even tried.

What is the output of "getent group apache"?
Comment 5 PJ 2012-11-11 15:44:52 UTC
running that command actually seg faults...

I have 3 other machines whose gentoo profiles are set to default/linux/x86/10.0 but each with different use flags and kernel configs. None exhibit this issue, which was my thinking for filing the bug here. The transmission bittorrent client installs on one of these without a problem but not on this machine (fails with the group 'transmission').

I'd be happy to enable selinux in either mode if you think it might help (and may do so in the future anyway now that I know it's disabled). For now, I'll keep it as is for troubleshooting purposes.
Comment 6 PJ 2012-11-11 15:50:14 UTC
I ran revdep-rebuild in hopes it'd fix the seg fault. sys-apps/dbus is broken but won't emerge because the group 'messagebus' exists.

I'm not sure if that's the cause of the seg fault.
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-12 20:25:02 UTC
Well, the segfault is very likely the cause of this bug. getent segfaults, so the eclass continues (as it did not get positive response that the group already exists).

We'll need to focus on the reasons of the segmentation faults. Are you certain that -march=nocona is safe here? I'm no expert on these matters, but you might want to just use -march=native and let GCC decide on the architecture.

You'll need to rebuild glibc though to verify this. Rebuilding dbus won't help - getent doesn't use dbus for communications. And as long as getent segfaults, you'll have issues. And if the -march is indeed the cause, you're very likely to see other problems as well on your system (as it means that applications are built with a processor instruction set that isn't fully compatible with your CPU).
Comment 8 PJ 2012-11-17 15:08:38 UTC
I changed my make.conf to use -march=native, recompiled glibc, tested getent (which then worked), and then updated @world. ...FINALLY worked!

That didn't present any other issues that I know of, and I can't believe that.

But thank you for your help!
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-17 17:15:22 UTC
You're welcome. Glad it got resolved.