Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Portage not emerging after system update
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
reb85
n00b
n00b


Joined: 16 Aug 2014
Posts: 3

PostPosted: Sat Aug 16, 2014 9:29 am    Post subject: [SOLVED] Portage not emerging after system update Reply with quote

Hello everybody,

I am running a Gentoo Hardened server, with PAX and SELinux (permissive mode).
A couple of days ago I performed a system upgrade by running emerge -avNDu world. Portage started emerging a set of about a hundred packages. It correctly emerge glibc, kernel-headers, gcc, coreutils, perl, and python. Right after correctly emerging libpcre, portage got unable to merge any additional package. Even trying to update gentoo-sources, for instance, resolves into an error.

The issue seems to be in the install phase, not in the compialtion phase.

Here enclosed an example of emerging gentoo-sources:

Quote:


localhost ~ # emerge -av gentoo-sources

* IMPORTANT: 1 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] sys-kernel/gentoo-sources-3.14.14:3.14.14 USE="-build -deblob -experimental -symlink" 0 kB

Total: 1 package (1 new), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-kernel/gentoo-sources-3.14.14
* linux-3.14.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ]
* genpatches-3.14-18.base.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ]
* genpatches-3.14-18.extras.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ]
>>> Preparing to unpack ...
>>> Unpacking source...
>>> Unpacking linux-3.14.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work
>>> Unpacking genpatches-3.14-18.base.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/patches
>>> Unpacking genpatches-3.14-18.extras.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/patches
* Applying 1000_linux-3.14.1.patch (-p1) ... [ ok ]
* Applying 1001_linux-3.14.2.patch (-p1) ... [ ok ]
* Applying 1002_linux-3.14.3.patch (-p1) ... [ ok ]
* Applying 1003_linux-3.14.4.patch (-p1) ... [ ok ]
* Applying 1004_linux-3.14.5.patch (-p1) ... [ ok ]
* Applying 1005_linux-3.14.6.patch (-p1) ... [ ok ]
* Applying 1006_linux-3.14.7.patch (-p1) ... [ ok ]
* Applying 1007_linux-3.14.8.patch (-p1) ... [ ok ]
* Applying 1008_linux-3.14.9.patch (-p1) ... [ ok ]
* Applying 1009_linux-3.14.10.patch (-p1) ... [ ok ]
* Applying 1010_linux-3.14.11.patch (-p1) ... [ ok ]
* Applying 1011_linux-3.14.12.patch (-p1) ... [ ok ]
* Applying 1012_linux-3.14.13.patch (-p1) ... [ ok ]
* Applying 1013_linux-3.14.14.patch (-p1) ... [ ok ]
* Applying 1500_XATTR_USER_PREFIX.patch (-p1) ... [ ok ]
* Applying 1700_enable-thinkpad-micled.patch (-p1) ... [ ok ]
* Applying 2400_kcopy-patch-for-infiniband-driver.patch (-p1) ... [ ok ]
* Applying 2700_ThinkPad-30-brightness-control-fix.patch (-p1) ... [ ok ]
* Applying 2900_dev-root-proc-mount-fix.patch (-p1) ... [ ok ]
* Applying 2905_s2disk-resume-image-fix.patch (-p1) ... [ ok ]
* Applying 4200_fbcondecor-0.9.6.patch (-p1) ... [ ok ]
* Applying 4500_support-for-pogoplug-e02.patch (-p1) ... [ ok ]
* Applying 4567_distro-Gentoo-Kconfig.patch (-p1) ... [ ok ]
>>> Source unpacked in /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work
>>> Preparing source in /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/linux-3.14.14-gentoo ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/linux-3.14.14-gentoo ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/linux-3.14.14-gentoo ...
>>> Source compiled.
>>> Test phase [not enabled]: sys-kernel/gentoo-sources-3.14.14

>>> Install gentoo-sources-3.14.14 into /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/image/ category sys-kernel
>>> Copying sources ...
!!! dodoc: /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/0000_README does not exist
* ERROR: sys-kernel/gentoo-sources-3.14.14::gentoo failed (install phase):
* dodoc failed
*
* If you need support, post the output of `emerge --info '=sys-kernel/gentoo-sources-3.14.14::gentoo'`,
* the complete build log and the output of `emerge -pqv '=sys-kernel/gentoo-sources-3.14.14::gentoo'`.
* The complete build log is located at '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/environment'.
* Working directory: '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/image/usr/src/linux-3.14.14-gentoo'
* S: '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/linux-3.14.14-gentoo'
* QA Notice: file does not exist:
*
* dodoc: /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/0000_README does not exist

>>> Failed to emerge sys-kernel/gentoo-sources-3.14.14, Log file:

>>> '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/build.log'

* Messages for package sys-kernel/gentoo-sources-3.14.14:

* ERROR: sys-kernel/gentoo-sources-3.14.14::gentoo failed (install phase):
* dodoc failed
*
* If you need support, post the output of `emerge --info '=sys-kernel/gentoo-sources-3.14.14::gentoo'`,
* the complete build log and the output of `emerge -pqv '=sys-kernel/gentoo-sources-3.14.14::gentoo'`.
* The complete build log is located at '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/environment'.
* Working directory: '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/image/usr/src/linux-3.14.14-gentoo'
* S: '/var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/work/linux-3.14.14-gentoo'



Here the supplementary info provided by emerge --info '=sys-kernel/gentoo-sources-3.14.14::gentoo'

Quote:

localhost ~ # emerge --info '=sys-kernel/gentoo-sources-3.14.14::gentoo'
Portage 2.2.8-r1 (hardened/linux/amd64/selinux, gcc-4.6.3, glibc-2.19-r1, 3.11.2-hardenedhardened_1 x86_64)
=================================================================
System Settings
=================================================================
System uname: Linux-3.11.2-hardenedhardened_1-x86_64-Intel-R-_Atom-TM-_CPU_330_@_1.60GHz-with-gentoo-2.2
KiB Mem: 1787420 total, 104832 free
KiB Swap: 2441844 total, 2441828 free
Timestamp of tree: Sat, 09 Aug 2014 05:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash: 4.2_p45
dev-lang/python: 2.7.7, 3.3.5-r1
dev-util/pkgconfig: 0.28-r1
sys-apps/baselayout: 2.2
sys-apps/openrc: 0.12.4
sys-apps/sandbox: 2.6-r1
sys-devel/autoconf: 2.69
sys-devel/automake: 1.12.6, 1.13.4
sys-devel/binutils: 2.23.2
sys-devel/gcc: 4.6.3, 4.7.3-r1
sys-devel/gcc-config: 1.7.3
sys-devel/libtool: 2.4.2-r1
sys-devel/make: 3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc: 2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -msse3 -mtune=atom -march=atom"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -msse3 -mtune=atom -march=atom"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://de-mirror.org/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-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=""
SYNC="rsync://rsync8.de.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri gdbm hardened iconv ipv6 justify mmx modules multilib ncurses nls nptl open_perms openmp pam pax_kernel pcre readline selinux session sse sse2 sse3 ssl tcpd udev unconfined unicode urandom xattr xtpax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 author" 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 ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON




After some checks I think the problem is associated to the "install" binary from the coreutils package. It always segfaults, even when trying to copy a user file around the system. Actualyl install correctly copies the file, but then it segfaults right before exiting. Maybe it is related to SELinux?

Does anyone have any idea on how to solve this issue?

Thanks


Last edited by reb85 on Sun Aug 17, 2014 11:03 am; edited 1 time in total
Back to top
View user's profile Send private message
perfinion
n00b
n00b


Joined: 16 Aug 2014
Posts: 1

PostPosted: Sat Aug 16, 2014 6:21 pm    Post subject: Reply with quote

Hi,

Did you recently switch to SELinux?
also, do you have install-xattr on your system by any chance? (qlist -Iv install-xattr)

can you try re-building the context files too:
Code:

cd /etc/selinux/strict/contexts/files/ # or equivalent if you're not using strict
sefcontext_compile file_contexts
sefcontext_compile file_contexts.homedirs
sefcontext_compile file_contexts.local


If none of these fix it, can you post your full build.log (eg /var/tmp/portage/sys-kernel/gentoo-sources-3.14.14/temp/build.log)
also post the output of the "seinfo" command
Back to top
View user's profile Send private message
reb85
n00b
n00b


Joined: 16 Aug 2014
Posts: 3

PostPosted: Sat Aug 16, 2014 9:01 pm    Post subject: Reply with quote

Hello,

I do not have install-xattr installed.
Anyway, I ran the commands you suggested, and was able to correctly install gentoo-sources. I will now try with the other packages.

I read about sefcontext_compile. I suppose the error I got was related to the one reported here: http://blog.siphos.be/2013/07/rebuilding-selinux-contexts-with-sefcontext_compile/, but I do not fully understand the problem. May I ask you to elaborate on the issue? In particular, are you aware of any other situation/package that might get broken upon update?

By the way, no, I did not switch to SELinux recently. I think I started using it about 8 months ago, and made a couple of system updates before getting this problem.

Thank you for your help.
Back to top
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Sun Aug 17, 2014 8:41 am    Post subject: Reply with quote

SELinux works with labels on all resources in order to enforce its policy. For files, those labels are put inside extended attributes of the file (i.e. on the file system). But labeling files requires some "knowledge" of which label to put on which file. For this, a file context "library" of sorts is maintained. This is the default_contexts file inside /etc/selinux/strict/contexts/files/ and it uses regular expressions to allow marking labels with a wide set of files without needing to iterate on each and every file that might ever exist.

Now, regular expression support can be implemented with a wide range of libraries. One of these is PCRE (Perl-Compatible Regular Expressions), provided through libpcre. The SELinux utilities use libpcre to match regular expressions with the real paths, but made a (silly or not) design mistake of optimizing the regular expressions by running them through libpcre, and then storing the memory buffers of the (compiled) regular expressions (by libpcre) on disk. These are the *.bin files inside /etc/selinux/strict/contexts/files/. Through the *.bin files, the SELinux tools just need to load those files back to memory and they have access to the regular expressions, all readily compiled.

That works fine, until libpcre is updated and has internally updated its memory structures. These internal structures are (boring for the outsider) things like switching from 32-bit integers to 64-bit integers, reshuffling variable orders, using unsigned characters instead of signed characters and what not. Basically code optimizations for libpcre. These changes however make the binary memory dumps invalid, because they were generated with the "old" libpcre, and are now loaded with the new libpcre.

The result is that libpcre tries to read what it considers to be its own memory, notices that it is corrupt, and segfaults.

For Gentoo (and Portage) this means that every operation related to (re)labeling files (which is something that happens either behind the scenes automatically, or is triggered during installations by Portage to make sure all files have the right label) results in a segmentation fault, and thus the installations fail.
_________________
Please add "[solved]" to the initial topic title when it is solved.
Back to top
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Sun Aug 17, 2014 8:42 am    Post subject: Reply with quote

reb85 wrote:
In particular, are you aware of any other situation/package that might get broken upon update?


The problem exists whenever libpcre is upgraded.

In recent libselinux utilities though, we patched the code so that it can detect that the *.bin files are not from the same libpcre, and will ignore the files, continuing with the (non-compiled, but valid) file context files.
_________________
Please add "[solved]" to the initial topic title when it is solved.
Back to top
View user's profile Send private message
reb85
n00b
n00b


Joined: 16 Aug 2014
Posts: 3

PostPosted: Sun Aug 17, 2014 10:41 am    Post subject: Reply with quote

Thank you very much for the explanations.

Cheers!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum