Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893770 - sys-apps/xdg-desktop-portal-gnome-43.1: excessive CPU usage
Summary: sys-apps/xdg-desktop-portal-gnome-43.1: excessive CPU usage
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-09 23:20 UTC by JFR
Modified: 2023-07-30 11:06 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 JFR 2023-02-09 23:20:49 UTC
Excessive CPU usage (and extreme delays, upwards of 30 seconds at times, waiting for "Save As" dialog to appear) in xdg-desktop-portal-gnome when saving a file from Chrome. Destination folder has 2722 files in it (issue seems to begin appearing at a few hundreds of files), on btrfs. Even once you've saved the file and the dialog is gone, 100% single-threaded CPU usage can continue for several minutes(!), and attempting to save another file during this time will lead to Chrome darkening the screen and then... sitting there not responding to keyboard input (but responding to mouse input) until the Save As dialog finally shows up again (again upwards of 30 seconds at times).

Saving from Firefox has absolutely no issues. I don't know if it also uses xdg-desktop-portal-gnome or not.

This is incredibly reproducible on my side and occurs every time I download more than "a few" files in succession. The more files I download, the longer it takes to do each one, even if I wait quite some time between each one. Effectively the only CPU usage is from xdg-desktop-portal-gnome (the other 5 cores are usually ~20% background load).

strace after my CPU fan had already been maxed out for about 30s-1m the latest time:

strace: Process 24504 attached
mprotect(0x7f3b22a25000, 8192, PROT_READ|PROT_WRITE) = 0
mprotect(0x7f3b22a27000, 32768, PROT_READ|PROT_WRITE) = 0
write(17, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x556a26c2b860, FUTEX_WAKE_PRIVATE, 1) = 1
write(17, "\1\0\0\0\0\0\0\0", 8)        = 8
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\20\0\373b\347\1\0\0\224\240@\0\234\377\234\377\1\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0"..., iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 1056
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\20\0\34\2\347\1\0\0\224\240@\0\234\377\234\377\1\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0"..., iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 1056
recvmsg(21, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=9, events=POLLIN}, {fd=21, events=POLLIN}], 3, 0) = 1 ([{fd=9, revents=POLLIN}])
read(9, "\31\7\0\0\0\0\0\0", 16)        = 8
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
openat(AT_FDCWD, "/home/jrunyon/.local/share/recently-used.xbel", O_RDONLY) = 29
newfstatat(29, "", {st_mode=S_IFREG|0600, st_size=561840, ...}, AT_EMPTY_PATH) = 0
brk(0x556a50516000)                     = 0x556a50516000
read(29, "<?xml version=\"1.0\" encoding=\"UT"..., 561840) = 561840
close(29)                               = 0
mprotect(0x7f3b2de16000, 24576, PROT_READ|PROT_WRITE) = 0

... sat here for quite a while, then CPU fan spins down and it starts flooding the terminal ...

eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 29
write(17, "\1\0\0\0\0\0\0\0", 8)        = 8
poll([{fd=29, events=POLLIN}], 1, 25000) = 1 ([{fd=29, revents=POLLIN}])
read(29, "\1\0\0\0\0\0\0\0", 16)        = 8
write(29, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x556a4f2d5a10, FUTEX_WAKE_PRIVATE, 2147483647) = 0
close(29)                               = 0
openat(AT_FDCWD, "/usr/share/applications/org.gnome.Terminal.desktop", O_RDONLY) = 29
newfstatat(29, "", {st_mode=S_IFREG|0644, st_size=499, ...}, AT_EMPTY_PATH) = 0
read(29, "[Desktop Entry]\nName=Terminal\nCo"..., 4096) = 499
read(29, "", 4096)                      = 0
close(29)                               = 0
access("/usr/local/sbin/gnome-terminal", X_OK) = -1 ENOENT (No such file or directory)

... etc, appears to be functioning normally again, and goes through accessing a metric crapton of files ...

I believe, but am not sure, that I had the same issue with -42.3 (which is the only other version of this package I've had installed).

To make matters worse, if I kill the misbehaving xdg-desktop-portal-gnome, Chrome simply refuses to let me download files (and thinks that it has a download in-progress, warning me upon exit) until I reboot.
Comment 1 Greg Kubaryk 2023-02-09 23:38:34 UTC
for posterity's sake, it would probably be good to include emerge --info in a comment
Comment 2 JFR 2023-02-10 01:21:00 UTC
Sorry, here you go

Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/17.1/desktop/gnome, gcc-11, glibc-2.36-r5, 5.15.80-gentoo x86_64)
=================================================================
System uname: Linux-5.15.80-gentoo-x86_64-Intel-R-_Core-TM-_i5-9600K_CPU_@_3.70GHz-with-glibc2.36
KiB Mem:    32798780 total,  10046328 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 04 Feb 2023 20:30:01 +0000
Head commit of repository gentoo: 895db73cef929c35eb376d76ba197fe5f2942708
Timestamp of repository steam-overlay: Mon, 30 Jan 2023 17:48:24 +0000
Head commit of repository steam-overlay: cb2e509008f4686631582637696f9f98d10588d6

sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9-r1::gentoo, 3.11.1-r1::gentoo
dev-lang/rust-bin:         1.66.1::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r2::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           15.0.7-r1::gentoo
sys-devel/gcc:             11.3.1_p20230120-r1::gentoo, 12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            15.0.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

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

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: True

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /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="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://www.gtlib.gatech.edu/pub/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en_US en"
MAKEOPTS="-j6"
PKGDIR="/var/cache/binpkgs"
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"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli colord crypt curl dbus dri dts dvb dvd dvdr eds elogind encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gstreamer gtk gui iconv icu introspection ipv6 jpeg lcms libass libglvnd libnotify libsecret libtirpc lm-sensors logrotate mad mng mp3 mp4 mpeg multilib musicbrainz nautilus ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp smartcard sound spell split-usr ssl startup-notification svg sysprof test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wifi wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" 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 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-US en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="nvidia intel i965 iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-06 09:29:47 UTC
(In reply to Sam James from comment #3)
> Small chance of it being
> https://github.com/flatpak/xdg-desktop-portal/commit/
> 26e3ff258b8f744d7f459598edd91465ab756cd0.

fixed by, I mean.
Comment 5 Pacho Ramos gentoo-dev 2023-07-30 11:06:11 UTC
Please try with 44.2 version if possible. Thanks