Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677570 - net-p2p/rtorrent-0.9.7-r1 with net-misc/curl-7.64.0 uses 100% cpu
Summary: net-p2p/rtorrent-0.9.7-r1 with net-misc/curl-7.64.0 uses 100% cpu
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Stephen Shkardoon
URL:
Whiteboard:
Keywords:
Depends on: 682150
Blocks:
  Show dependency tree
 
Reported: 2019-02-09 17:49 UTC by Thomas Lindroth
Modified: 2019-04-02 09:09 UTC (History)
3 users (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 Thomas Lindroth 2019-02-09 17:49:55 UTC
Some kind of regression was introduced in curl-7.64.0 causing rtorrent to consume 100% cpu. A few minutes after startup rtorrent will start spending all cpu time executing epoll_wait() in a  loop. I bisected the problem down to this commit in curl https://github.com/curl/curl/commit/bbae24c3ae3bce7518f0fbd2d260359ee6a36510.

The symptoms are basically identical to this older bug https://github.com/rakshasa/rtorrent/issues/580. Rtorrent use the level triggered epoll mode so if there is data left in a pipe managed by curl I guess rtorrent just keep executing epoll_wait() over and over.

I've opened an upstream bug but they want a minimal reproducible testcase and I don't want to spend that much time on the problem. https://github.com/curl/curl/issues/3542

This bug report is just to let the maintainer know that net-misc/curl-7.64.0 is broken with net-p2p/rtorrent-0.9.7-r1


flags and version of packages:
[ebuild   R    ] net-misc/curl-7.64.0::gentoo  USE="ldap ssl -adns -brotli -http2 -idn -ipv6 -kerberos -metalink -rtmp -samba -ssh -static-libs -test -threads" ABI_X86="(64) -32 (-x32)" CURL_SSL="openssl -gnutls -libressl -mbedtls -nss (-winssl)" 0 KiB
[ebuild   R    ] net-libs/libtorrent-0.13.7-r1::gentoo  USE="ssl -debug -libressl -test" 0 KiB
[ebuild   R    ] net-p2p/rtorrent-0.9.7-r1::gentoo  USE="-daemon -debug (-selinux) -test -xmlrpc" 0 KiB


.rtorrent.rc:
bind=0.0.0.0
throttle.min_peers.normal.set = 60
throttle.max_peers.normal.set = 150
network.port_range.set = 8000-8000
protocol.pex.set = yes
directory.default.set = /mnt/virtual/torrent
dht.mode.set = on
dht.port.set = 6881
schedule = watch_directory,10,10,load.start=/mnt/virtual/torrent/*.torrent
group.seeding.ratio.enable=
ratio.min.set=110
session.path.set = /home/tholin/.rtorrent
ipv4_filter.load = ~/.rtorrent_blocklist,unwanted
file.prioritize_toc.set=1
encoding.add = UTF-8


Portage 2.3.51 (python 2.7.15-final-0, default/linux/amd64/17.0/desktop, gcc-7.3.0, glibc-2.27-r6, 4.14.98 x86_64)
=================================================================
System uname: Linux-4.14.98-x86_64-Intel-R-_Core-TM-_i7-4790K_CPU_@_4.00GHz-with-gentoo-2.6
KiB Mem:    16246280 total,    325244 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Sat, 09 Feb 2019 00:45:01 +0000
Head commit of repository gentoo: 0ac1479f4d1136529470166f428ec89a53d0413b
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.30 p5) 2.30.0
ccache version 3.3.4 [disabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24

tholins-overlay
    location: /usr/local/portage/my-overlay
    masters: gentoo
    priority: 0

jorgicio
    location: /var/lib/layman/jorgicio
    sync-type: laymansync
    sync-uri: https://github.com/jorgicio/jorgicio-gentoo.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/tomoyo/conf /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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
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 -pipe"
FEATURES="assume-digests binpkg-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-backup unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirror.dkm.cz/gentoo/ https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ https://ftp.lanet.kr/pub/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8 -l12"
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 acl acpi alsa amd64 berkdb branding bzip2 cairo cdda cdr cjk cli consolekit crypt cxx dbus dri dts dvd dvdr emboss encode exif fam flac fortran gdbm gif glamor gpm gtk hardened iconv icu jpeg lcms ldap libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl offensive ogg opengl openmp pam pango pcre pdf png policykit ppds python qt5 readline sdl seccomp spell ssl start up-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xinerama xml xv xvid 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 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="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" 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="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="vesa intel i965" 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, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Thomas Lindroth 2019-03-31 12:50:32 UTC
The fix is included in the newly released curl-7.64.1
I suggest this version is stabilized and rtorrent made to depend on it.
Comment 3 Stephen Shkardoon 2019-03-31 16:09:41 UTC
Once the new version of cURL is stabilized, this is likely not going to be a big issue for most users, so I'm skeptical there's much value in worrying about it too much for rtorrent specific.
I'd be happy to set a block on the specific cURL versions that exhibit the buggy behavior for rTorrent, but I'd also just hope those versions lost their stable keyword.

I've created a stabilization request for the version which fixes the issue.
Comment 4 Stephen Shkardoon 2019-04-01 05:16:01 UTC
(In reply to Thomas Lindroth from comment #2)
> The fix is included in the newly released curl-7.64.1
> I suggest this version is stabilized and rtorrent made to depend on it.

Can you confirm the issue is resolved once you upgrade curl to 7.64.1 in Gentoo? (That is, there's no further issues and the CPU usage goes back down to nominal levels).
Comment 5 Thomas Lindroth 2019-04-01 13:18:28 UTC
I tested the 7.64.1 version from portage and it works fine with rtorrent.
Comment 6 Stephen Shkardoon 2019-04-02 09:09:07 UTC
This is now resolved through curl being marked stable in amd64 and x86 (the two platforms rtorrent is also stable).