Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 570342 - >=kde-plasma/breeze-5.5.0 leaks memory in X
Summary: >=kde-plasma/breeze-5.5.0 leaks memory in X
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-31 08:51 UTC by Elizabeth Myers
Modified: 2016-01-18 17:49 UTC (History)
1 user (show)

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


Attachments
Patch for breeze-5.5 that fixes this bug (0001-breeze-5.5-dont-leak.patch,30.54 KB, patch)
2016-01-17 00:18 UTC, A. Wilcox (awilfox)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elizabeth Myers 2015-12-31 08:51:07 UTC
plasmashell seems to have a nasty leak in X - about 5 GB a day. I've been unable to elucidate the cause, despite enabling/disabling things such as compositing, changing rendering backend to xrender (leak still occurs), various effects, and so on.

Once the memory is leaked in X, it can't be reclaimed until X is restarted. This to me smells like a drawable/texture leak, but I don't know for sure.

Note I have tested xfce4 (which is the only other compositing WM I really want to install) and I don't get such leaking in X.

My setup is xf86-video-intel (haswell) but it seems to happen with radeon (HD 6800) as well.

If it's relevant, I am using gnome-breeze. I don't think that's the source of my problems, though.

Reproducible: Always

Steps to Reproduce:
1. Log into plasmashell
2. Wait a while
3. Memory is gradually leaked by X
Actual Results:  
Memory leaked by X

Expected Results:  
Memory should not be leaked by X

KDE USE flags:
kde-plasma/breeze kde4
app-office/akonadi-server -qt4 qt5 -mysql postgres
kde-plasma/plasma-desktop legacy-systray

emerge --info:
Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-4.9.3, glibc-2.22-r1, 4.3.3-gentoo x86_64)
=================================================================
System uname: Linux-4.3.3-gentoo-x86_64-Intel-R-_Core-TM-_i7-4800MQ_CPU_@_2.70GHz-with-gentoo-2.2
KiB Mem:    16371020 total,   2289356 free
KiB Swap:    8388604 total,   8370196 free
Timestamp of repository gentoo: Wed, 30 Dec 2015 12:15:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.11-r1::gentoo, 3.4.3-r7::gentoo, 3.5.1-r2::gentoo
dev-util/cmake:           3.4.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.3.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

Elizafox
    location: /usr/local/portage
    masters: gentoo

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage
    priority: 0

bumblebee
    location: /var/lib/layman/bumblebee
    masters: gentoo
    priority: 50

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

qt
    location: /var/lib/layman/qt
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native -ggdb"
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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -mtune=native -ggdb"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news noinfo parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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="/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cuda cups cxx dbus declarative dri dts dvd dvdr egl emboss encode evdev exif fam ffmpeg firefox flac gdbm gif gl glamor gles2 gpm gstreamer gtk iconv icu infinality ipv6 jpeg jpeg2k kde kipi lcms lensfun libnotify mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl offensive ogg opencl openexr opengl openmp pam pango pch pcre pdf phonon plasma png policykit ppds psd pulseaudio python qml qt3support qt4 qt5 raw readline s3tc sctp sdl seccomp semantic-desktop session spell sse sse2 ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis widgets wifi wxwidgets x264 xattr xcb xcomposite xfs xinerama xml xscreensaver xv xvid xvmc 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" 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 itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4 python3_5" QEMU_SOFTMMU_TARGETS="aarch64 alpha arm cris i386 lm32 m68k microblaze microblazeel mips mips64 mips64el mipsel moxie or32 ppc ppc64 ppcemb s390x sh4 sh4eb sparc sparc64 unicore32 x86_64 xtensa xtensaeb tricore" QEMU_USER_TARGETS="aarch64 alpha arm armeb cris i386 m68k microblaze microblazeel mips mips64 mips64el mipsel mipsn32 mipsn32el or32 ppc ppc64 ppc64abi32 s390x sh4 sh4eb sparc sparc32plus sparc64 unicore32 x86_64 ppc64le" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="nvidia intel i965" XFCE_PLUGINS="battery brightness clock multiload-nandhp power trash" 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"
USE_PYTHON="2.7 3.4 3.5"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Robert Schedel 2016-01-05 01:29:35 UTC
(In reply to Elizabeth Myers from comment #0)

1. You seem to have "infinality" enabled:
> USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo
...
> gl glamor gles2 gpm gstreamer gtk iconv icu infinality ipv6 jpeg jpeg2k kde

Please disable and retry.
I have fought myself against a memory leak within "konsole" (not plasmashell) when building major gentoo packages like glibc. After seeking reports about possible memory leaks with enabled "infinality", I had disabled "infinality" and rebuilt "freetype". Afterwards leaks were gone. IOW, it is one thing that should definitely be checked.

2. For the record, because unmentioned: Obviously this is dup to the existing KDE upstream ticket where you are already discussing same topic:
https://bugs.kde.org/show_bug.cgi?id=344879
Comment 2 Elizabeth Myers 2016-01-05 10:22:45 UTC
(In reply to Robert Schedel from comment #1)
> (In reply to Elizabeth Myers from comment #0)
> 
> 1. You seem to have "infinality" enabled:
> > USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo
> ...
> > gl glamor gles2 gpm gstreamer gtk iconv icu infinality ipv6 jpeg jpeg2k kde
> 
> Please disable and retry.
> I have fought myself against a memory leak within "konsole" (not
> plasmashell) when building major gentoo packages like glibc. After seeking
> reports about possible memory leaks with enabled "infinality", I had
> disabled "infinality" and rebuilt "freetype". Afterwards leaks were gone.
> IOW, it is one thing that should definitely be checked.

Konsole doesn't leak with infinality, nor do I have any other problems in any other environments. I think this is a red herring but nonetheless, I will try it.

> 
> 2. For the record, because unmentioned: Obviously this is dup to the
> existing KDE upstream ticket where you are already discussing same topic:
> https://bugs.kde.org/show_bug.cgi?id=344879

That one seems to say plasmashell leaks, not X.
Comment 3 Elizabeth Myers 2016-01-05 10:35:53 UTC
I have elucidated one way I get leaks: maximising and restoring windows by dragging the title bar to the edge and pulling away. I don't think that's the full story though, since I don't resize windows very often and still get the leak - this just happens to leak a lot of memory at once.

Disabling infinality (going so far as to remove the USE flag) and all related configuration has not stopped the leak.
Comment 4 A. Wilcox (awilfox) 2016-01-05 10:44:26 UTC
I can duplicate this on x86_64 with an ATi/AMD Radeon HD 5770, though mine leaks much, much faster; I lose 11 GB every few hours and have to relog 2-3x per day.

I can make it leak myself very fast by alt+tabbing between windows.  If I kill plasmashell from a terminal, the leak stops cold.  It only occurs in Plasma 5.5+; I didn't have this leak in 5.4.2.

When I have more time, I will test this on my nvidia computer, which I have just upgraded from KDE 4 to Plasma 5 over the weekend.
Comment 5 A. Wilcox (awilfox) 2016-01-14 19:47:49 UTC
I have bisected plasma-workspace and found it wasn't the issue.  The actual leak is occurring in >=kde-plasma/breeze-5.5.0.

6d852f30a1f2c1988359d4e0cdb21e2f1714a6bd is the first bad commit 
commit 6d852f30a1f2c1988359d4e0cdb21e2f1714a6bd 
Author: Hugo Pereira Da Costa <hugo.pereira@free.fr> 
Date:   Sun Oct 18 17:52:15 2015 +0200 

    Delay update of widget's palette to after polish is completed, because setPalette messes up with the 
    event queue otherwise, resulting with some input chains being broken. 
    BUG: 344425 

:040000 040000 f3ff4ded09578226fe4b5da136fb3b6f68d66a06 b66dec2e05bf198f8d372b29b554359877fc04d2 M      kstyle


I will be attempting to patch this over the weekend.
Comment 6 Elizabeth Myers 2016-01-15 04:55:48 UTC
Hello,

The culprit was misidentified. It was in fact kde-plasma/breeze. See upstream bug https://bugs.kde.org/show_bug.cgi?id=357800 - it will be fixed in 5.5.4.

In the meantime, attached to aforementioned bug is a patch that resolves the issue, as well as multiple weird hangs/lockups/etc.
Comment 7 Elizabeth Myers 2016-01-15 04:57:05 UTC
Hello,

The culprit was misidentified. It was in fact kde-plasma/breeze. See upstream bug https://bugs.kde.org/show_bug.cgi?id=357800 - it will be fixed in 5.5.4.

In the meantime, attached to aforementioned bug is a patch that resolves the issue, as well as multiple weird hangs/lockups/etc.
Comment 8 Elizabeth Myers 2016-01-15 05:03:48 UTC
(In reply to Andrew Wilcox (awilfox) from comment #5)
> I have bisected plasma-workspace and found it wasn't the issue.  The actual
> leak is occurring in >=kde-plasma/breeze-5.5.0.
> 
> 6d852f30a1f2c1988359d4e0cdb21e2f1714a6bd is the first bad commit 
> commit 6d852f30a1f2c1988359d4e0cdb21e2f1714a6bd 
> Author: Hugo Pereira Da Costa <hugo.pereira@free.fr> 
> Date:   Sun Oct 18 17:52:15 2015 +0200 
> 
>     Delay update of widget's palette to after polish is completed, because
> setPalette messes up with the 
>     event queue otherwise, resulting with some input chains being broken. 
>     BUG: 344425 
> 
> :040000 040000 f3ff4ded09578226fe4b5da136fb3b6f68d66a06
> b66dec2e05bf198f8d372b29b554359877fc04d2 M      kstyle
> 
> 
> I will be attempting to patch this over the weekend.

They appear to have beat you to it upstream in identifying it, though they're wrong in saying it only happens with kate or kwrite.

(Also sorry for previous dupe)
Comment 9 A. Wilcox (awilfox) 2016-01-17 00:18:29 UTC
Created attachment 423086 [details, diff]
Patch for breeze-5.5 that fixes this bug

This patch applies cleanly to 5.5.0 and 5.5.2 in my testing, and resolves the leak.  It is based on upstream's patch from the KDE bugzilla which Elizabeth had to pull for me because their bug tracker is still unavailable on IPv6.
Comment 10 Elizabeth Myers 2016-01-18 17:49:13 UTC
This will be fixed in 5.5.4. That patch seems to be too invasive to put in the tree after putting feelers out.