Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 643218 - openvz kernel, sys-libs/glibc-2.26* : getrlimit/setrlimit: Function not implemented
Summary: openvz kernel, sys-libs/glibc-2.26* : getrlimit/setrlimit: Function not imple...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal blocker
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-03 11:35 UTC by Jens Maus
Modified: 2018-09-11 15:06 UTC (History)
2 users (show)

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


Attachments
experimental patch (0001-Revert-Assume-prlimit64-is-available.patch,6.24 KB, patch)
2018-01-03 14:13 UTC, Andreas K. Hüttel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Maus 2018-01-03 11:35:48 UTC
I have a perfectly running amd64 Gentoo/Linux system in an openvz hosted environment. So far it was running perfectly and with recent updates applied. However, as soon as I emerge version 2.26 of glibc it breaks with error messages suggesting severe problems. After having merged glibc-2.26-r5 (or r3) the symptoms are:

-- cut here --
# sudo
sudo: getrlimit: Function not implemented
sudo: setrlimit: Function not implemented
sudo: setrlimit: Function not implemented
-- cut here --

also a new remote SSH session cannot be initiated due to similar errors in missing getrlimit/setrlimit functionality.

Furthermore, also portage stops working immediately after the merge:

-- cut here --
# emerge --sync
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/emerge", line 44, in <module>
    from _emerge.main import emerge_main
  File "/usr/lib64/python2.7/site-packages/_emerge/main.py", line 23, in <module>
    from portage.sync import _SUBMODULE_PATH_MAP
  File "/usr/lib64/python2.7/site-packages/portage/sync/__init__.py", line 8, in <module>
    from portage.sync.controller import SyncManager
  File "/usr/lib64/python2.7/site-packages/portage/sync/controller.py", line 22, in <module>
    from portage.package.ebuild.doebuild import _check_temp_dir
  File "/usr/lib64/python2.7/site-packages/portage/package/ebuild/doebuild.py", line 56, in <module>
    from portage.dbapi.porttree import _parse_uri_map
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/porttree.py", line 90, in <module>
    portage.process.atexit_register(close_portdbapi_caches)
  File "/usr/lib64/python2.7/site-packages/portage/proxy/objectproxy.py", line 22, in __getattribute__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib64/python2.7/site-packages/portage/proxy/lazyimport.py", line 107, in _get_target
    __import__(name)
  File "/usr/lib64/python2.7/site-packages/portage/process.py", line 31, in <module>
    max_fd_limit = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
resource.error: (38, 'Function not implemented')
-- cut here --

By simply commenting out the resource.getrlimit() call in /usr/lib64/python2.7/site-packages/portage/process.py I can perfectly get portage running again.

Afterwards I can downgrade to sys-libs/glibc-2.25-r9 (after having patched toolchain-glibc.eclass to allow the downgrade) and then everything starts working perfectly fine again.

As said, my Gentoo system is running in an OpenVZ environment which is currently using the following kernel: 3.13.0-042stab124.2

emerge --info output:

-- cut here --
Portage 2.3.19 (python 2.7.14-final-0, default/linux/amd64/17.0, gcc-7.2.0, glibc-2.25-r9, 3.13.0-042stab124.2 x86_64)
=================================================================
System uname: Linux-3.13.0-042stab124.2-x86_64-Intel-R-_Xeon-R-_CPU_E5-2680_v2_@_2.80GHz-with-gentoo-2.4.1
KiB Mem:     8388608 total,   5157856 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 03 Jan 2018 08:30:01 +0000
Head commit of repository gentoo: de15b1fc26edd736d2a4b7a36599c4623fc6a17c
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.6-r1::gentoo, 3.5.4-r1::gentoo, 3.6.3-r1::gentoo
dev-util/cmake:           3.10.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo, 2.27::gentoo, 2.29.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.3.0::gentoo, 5.4.0-r3::gentoo, 7.2.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=native -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind /var/www/localhost/htdocs/roundcube"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/apache2-php7.1/ext-active/ /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-pipe -O2 -march=native -mtune=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ ftp://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl amd64 bash-completion berkdb bzip2 chroot cli cracklib crypt cxx dri fortran gdbm gif gnutls http2 iconv idn iproute2 ipv6 jbig jpeg jpeg2k logrotate modules mpeg multilib ncurses nls nptl openmp pam pcre png readline seccomp session ssl tcpd threads tiff unicode vim-syntax xattr 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="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias auth_digest" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi geoip gunzip gzip_static spdy auth_pam fancyindex" NGINX_MODULES_MAIL="imap smtp" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
-- cut here --
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2018-01-03 14:13:10 UTC
Created attachment 512972 [details, diff]
experimental patch

Could you please try if the attached patch solves your problem?

(Put it into /etc/portage/patches/sys-libs/glibc and re-emerge glibc-2.26 ...)
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2018-01-03 14:13:41 UTC
See also https://bbs.archlinux.org/viewtopic.php?id=229952
Comment 3 Jens Maus 2018-01-04 07:39:55 UTC
Thanks for this patch. I just tested it and it indeed fixes the getrlimit/setrlimit problems with 'sudo', portage and ssh. So, I think this should be fixed now. Looking forward to seeing this patch integrated in an upcoming ebuild update of sys-libs/glibc-2.26
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2018-01-04 17:53:17 UTC
(In reply to Jens Maus from comment #3)
> Thanks for this patch. I just tested it and it indeed fixes the
> getrlimit/setrlimit problems with 'sudo', portage and ssh. So, I think this
> should be fixed now. Looking forward to seeing this patch integrated in an
> upcoming ebuild update of sys-libs/glibc-2.26

OK. This is good, but we should try to find the actual reason for the problem. 

Your "emerge --info" output says as Kernel version "3.13.0-042stab124.2". 

The minimum requirement for glibc-2.26 is 3.2.0, and that's the version which introduced the syscalls missing in your case. 

So, why is your 3.13 behaving like pre-3.2 ?

Do you have access to the kernel config.gz, and if yes, could you attach it here please? 
Could you maybe ask your hosting provider if their kernels have any unusual patches related to prlimit64?

I'll try to read on OpenVZ in the meantime, which might be the "other part of the story" too...
Comment 5 Jens Maus 2018-01-05 08:12:39 UTC
Sorry, but it seems /proc/config.gz is not there and I am not able to access the kernel config by other means. The hosting provider is strato (strato.de) and I can see if I can open a request for the config data there, but I doubt that we will get an answer anytime soon.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2018-09-11 15:06:30 UTC
(In reply to Jens Maus from comment #5)
> Sorry, but it seems /proc/config.gz is not there and I am not able to access
> the kernel config by other means. The hosting provider is strato (strato.de)
> and I can see if I can open a request for the config data there, but I doubt
> that we will get an answer anytime soon.

OK. My advice would be to unmask 2.25 and mask everything >=2.26 locally. The problem is clearly the OpenVZ kernel; there is not much we can do from glibc.