Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 698226 - equery with pypy: IOError: [Errno 24] Too many open files
Summary: equery with pypy: IOError: [Errno 24] Too many open files
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-21 18:43 UTC by Johannes Hirte
Modified: 2020-07-23 07:58 UTC (History)
1 user (show)

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 Johannes Hirte 2019-10-21 18:43:56 UTC
When using gentoolkit with pypy, equery throws the following error:

 # equery d net-wireless/iwd
 * These packages depend on net-wireless/iwd:
Traceback (most recent call last):
  File "/usr/lib/python-exec/pypy/equery", line 38, in <module>
  File "/usr/lib/pypy2.7/site-packages/gentoolkit/equery/__init__.py", line 356, in main
  File "/usr/lib/pypy2.7/site-packages/gentoolkit/equery/depends.py", line 199, in main
  File "/usr/lib/pypy2.7/site-packages/gentoolkit/dependencies.py", line 233, in graph_reverse_depends
  File "/usr/lib/pypy2.7/site-packages/gentoolkit/dependencies.py", line 104, in get_all_depends
  File "/usr/lib/pypy2.7/site-packages/gentoolkit/dependencies.py", line 81, in _get_depend
  File "/usr/lib/pypy2.7/site-packages/gentoolkit/dependencies.py", line 72, in environment
  File "/usr/lib/pypy2.7/site-packages/portage/dbapi/porttree.py", line 614, in aux_get
  File "/usr/lib/pypy2.7/site-packages/portage/dbapi/porttree.py", line 702, in async_aux_get
  File "/usr/lib/pypy2.7/site-packages/_emerge/AsynchronousTask.py", line 30, in start
  File "/usr/lib/pypy2.7/site-packages/_emerge/EbuildMetadataPhase.py", line 41, in _start
IOError: [Errno 24] Too many open files: '/usr/portage/media-libs/libsamplerate/libsamplerate-0.1.9.ebuild'

With cpython everything works fine.
Comment 1 Johannes Hirte 2019-10-21 18:44:41 UTC
emerge --info

Portage 2.3.77 (python 3.6.9-final-0, default/linux/amd64/17.1/systemd, gcc-9.2.0, glibc-2.29-r6, 5.4.0-rc4 x86_64)
=================================================================
System uname: Linux-5.4.0-rc4-x86_64-AMD_Ryzen_5_PRO_2500U_w-_Radeon_Vega_Mobile_Gfx-with-gentoo-2.6
KiB Mem:     7066080 total,    652632 free
KiB Swap:    2097148 total,   2000340 free
Head commit of repository gentoo: cd8acb0d9a7e36fd6bccb5aca3c3e523da0013dc

Head commit of repository kde: 133775cf7555143d53ef9f52ae3bde929611af09

Head commit of repository qt: 425506b2913065f43fe7051bdcc016adae5a7307

sh bash 5.0_p11
ld GNU ld (Gentoo 2.32 p2) 2.32.0
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.0_p11::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.9::gentoo
dev-util/cmake:           3.15.4::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.2.0-r1::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

kde
    location: /usr/local/portage/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

qt
    location: /usr/local/portage/qt
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j4"
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 a52 aac aacplus acl alsa alt-svc amd64 amr amrenc anacron berkdb bluetooth bzip2 cairo caps celt chm cleartype_hinting cli corefonts crypt cryptsetup cups cxx d3d9 dav1d dbus default-gold dell device-mapper djvu dri drm dvd ebook editorconfig efi egl eps epub evdev exif faac fdk ffmpeg fftw flac fontconfig fortran gbm gdbm gif git glamor gmp gold gpg gphoto2 gpm graphviz harfbuzz iconv icu id3tag ipv6 ithreads jpeg kipi lcms lensfun libatomic libcxx libcxxabi libffi libinput libkms libsamplerate libtirpc libunwind libxml2 lm-sensors lz4 lzma lzo mad matroska mjpeg mmap mng mobi modern-top mp3 mpeg mtp multilib mysql ncurses networkmanager nfs nls nptl ogg openal opencl opencv openexr opengl openmp openssl opus pam parted pcre pcre16 pdf png policykit postscript pulseaudio python qml qt5 raw readline s3tc schroedinger sdl sdl2 seccomp sift smp sndfile sox speex spice split-usr sqlite ssl subversion svg system-harfbuzz system-icu system-jpeg system-jsoncpp system-libvpx system-sqlite systemd taglib tcpd tesseract theora threads thumbnail tiff truetype udev uefi unicode urandom usb usbredir user-session v4l vaapi vde vdpau vhosts virgl virt-network virtfs vorbis vpx vte vulkan wavpack wayland webp wmf x264 x265 xattr xcb xcomposite xkb xml xmp xpm xv xvid zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" 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="karbon sheets words" CAMERAS="canon ricoh ricoh_g3" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 ssse3 sse4_1 sse4_2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64 pc" INPUT_DEVICES="evdev libinput synaptics" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX X86" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="pypy pypy3 python2_7 python3_6" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu" 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, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Zac Medico gentoo-dev 2019-10-21 22:28:15 UTC
Which version of pypy did you see the error with. Is it dev-python/pypy-7.2.0? I wonder if pypy3 behaves any differently.
Comment 3 Johannes Hirte 2019-10-22 06:04:08 UTC
(In reply to Zac Medico from comment #2)
> Which version of pypy did you see the error with. Is it
> dev-python/pypy-7.2.0? I wonder if pypy3 behaves any differently.

Yes, dev-python/pypy-7.2.0 and it's the same behaviour with pypy3.
Comment 4 Zac Medico gentoo-dev 2019-10-22 19:29:06 UTC
(In reply to Johannes Hirte from comment #0)
>   File "/usr/lib/pypy2.7/site-packages/gentoolkit/dependencies.py", line 72,
> in environment
>   File "/usr/lib/pypy2.7/site-packages/portage/dbapi/porttree.py", line 614,
> in aux_get
>   File "/usr/lib/pypy2.7/site-packages/portage/dbapi/porttree.py", line 702,
> in async_aux_get
>   File "/usr/lib/pypy2.7/site-packages/_emerge/AsynchronousTask.py", line
> 30, in start
>   File "/usr/lib/pypy2.7/site-packages/_emerge/EbuildMetadataPhase.py", line
> 41, in _start
> IOError: [Errno 24] Too many open files:
> '/usr/portage/media-libs/libsamplerate/libsamplerate-0.1.9.ebuild'
> 
> With cpython everything works fine.

This shows that it's regenerating metadata, so it would be interesting to see if the metadata regeneration triggers the problem. You can use this command to generate all of the metadata in advance:

emerge --regen

After running that, does it suppress equery the problem?
Comment 5 Johannes Hirte 2019-10-22 20:52:35 UTC
(In reply to Zac Medico from comment #4)
> (In reply to Johannes Hirte from comment #0)
> >   File "/usr/lib/pypy2.7/site-packages/gentoolkit/dependencies.py", line 72,
> > in environment
> >   File "/usr/lib/pypy2.7/site-packages/portage/dbapi/porttree.py", line 614,
> > in aux_get
> >   File "/usr/lib/pypy2.7/site-packages/portage/dbapi/porttree.py", line 702,
> > in async_aux_get
> >   File "/usr/lib/pypy2.7/site-packages/_emerge/AsynchronousTask.py", line
> > 30, in start
> >   File "/usr/lib/pypy2.7/site-packages/_emerge/EbuildMetadataPhase.py", line
> > 41, in _start
> > IOError: [Errno 24] Too many open files:
> > '/usr/portage/media-libs/libsamplerate/libsamplerate-0.1.9.ebuild'
> > 
> > With cpython everything works fine.
> 
> This shows that it's regenerating metadata, so it would be interesting to
> see if the metadata regeneration triggers the problem. You can use this
> command to generate all of the metadata in advance:
> 
> emerge --regen
> 
> After running that, does it suppress equery the problem?

No, still the same IOError: [Errno 24].
Comment 6 Johannes Hirte 2019-12-18 08:32:55 UTC
Seems this is caused by the different gc-behaviour of pypy:

https://bitbucket.org/pypy/pypy/issues/878

I was able to workaround by increasing the soft-limit for open files. Default is 1024, and this is not enough for the whole portage tree.
Comment 7 Reva Denis 2020-07-23 07:57:31 UTC
I confirmed that bug.
Comment 8 Reva Denis 2020-07-23 07:58:00 UTC
It only exist with default low soft limit.