Bug 281509 - knotify4 memory leak while recompiling the whole system
Summary: knotify4 memory leak while recompiling the whole system
Status: RESOLVED WORKSFORME
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 294700 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-06 23:53 UTC by darkbasic
Modified: 2019-03-23 14:34 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
/var/log/messages snippet (23.19 KB, text/plain)
2011-09-06 23:53 UTC, darkbasic
Details
knotify4 strace log (199.61 KB, application/x-bzip)
2011-10-07 11:52 UTC, Balázs Németh
Details
massif report - looks like the bus gets filled with messages which arent freed (385.71 KB, image/png)
2013-07-14 17:44 UTC, Sergio Martins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darkbasic 2011-09-06 23:53:05 UTC
Created attachment 63457 [details]
/var/log/messages snippet

Version:           unspecified (using KDE 4.7.0) 
OS:                Linux

While doing an emerge -ave @world knotify4 started eating ram until the system killed it (freeing 3GB of ram).

Reproducible: Didn't try

Steps to Reproduce:
...


Expected Results:  
...
Comment 1 Christoph Feck 2011-09-07 11:54:54 UTC
Which Phonon backend do you use? You can try switching to a different Phonon backend using System Settings > Hardware > Multimedia
Comment 2 darkbasic 2011-09-08 09:07:59 UTC
I do use gstreamer + pulseaudio, but I never had such a problem before. Anyway I just upgraded to kde 4.7.1, hoping such a problem will never see the light again.
Comment 3 Johannes Hirte 2011-09-11 21:19:41 UTC
This is still an issue with KDE SC 4.7. I've got some notify flooding from kmail2 and now knotify4 consumes half of my memory. I think this bug is related/a duplicate of https://bugs.kde.org/show_bug.cgi?id=197315.

And yes, a limit is really needed here.
Comment 4 Balázs Németh 2011-10-07 11:52:56 UTC
Created attachment 64309 [details]
knotify4 strace log

I have been being faced with the exact same problem on my Gentoo box for weeks.
I was unable to reproduce on purpose, but usually it happens once a day.

I could only make a strace output, I hope it helps you guys.

knotify4 process eats up my memory until my system starts to swap

other info:
- knotify-4.6.5 (kde-4.6.5) 
- Gentoo Linux, amd64, kde desktop profile

.xsession-errors shows a really lot of times

Oct  7 13:50:56 gaia3/gaia3 plasma-desktop(4104)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application
Comment 5 Balázs Németh 2011-10-07 11:55:12 UTC
(In reply to comment #4)
> Created an attachment (id=64309) [details]
> knotify4 strace log
> 
> I have been being faced with the exact same problem on my Gentoo box for weeks.
> I was unable to reproduce on purpose, but usually it happens once a day.
> 
> I could only make a strace output, I hope it helps you guys.
> 
> knotify4 process eats up my memory until my system starts to swap
> 
> other info:
> - knotify-4.6.5 (kde-4.6.5) 
> - Gentoo Linux, amd64, kde desktop profile
> 
> .xsession-errors shows a really lot of times
> 
> Oct  7 13:50:56 gaia3/gaia3 plasma-desktop(4104)/plasma
> StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this
> application

I don't use pulsaudio, kmail2 or such software, this is an up-to-date 'stable' Gentoo Linux.


Portage 2.1.10.11 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.3, glibc-2.12.2-r0, 2.6.39-gentoo-r3 x86_64)
=================================================================
System uname: Linux-2.6.39-gentoo-r3-x86_64-Intel-R-_Core-TM-_i5_CPU_M_520_@_2.40GHz-with-gentoo-2.0.3
Timestamp of tree: Fri, 07 Oct 2011 00:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1, 3.1.3-r1
dev-util/ccache:          2.4-r9
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo unoffical-balabit-overlay
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA PUEL skype-eula dlj-1.1 googleearth AdobeFlash-10 AdobeFlash-10.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/_gentoo_portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache distlocks ebuild-locks fixlafiles fixpackages metadata-transfer news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch webrsync-gpg"
FFLAGS=""
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://gentoo.osuosl.org/"
LANG="hu_HU.UTF-8"
LC_ALL="hu_HU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en hu"
MAKEOPTS="-j3"
PKGDIR="/_gentoo_portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/_gentoo_portage/tmp"
PORTDIR="/_gentoo_portage/portage"
PORTDIR_OVERLAY="/_gentoo_portage/overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss exif fam firefox flac fortran ftp gdbm gdu gif gpm gtk iconv ipv6 jpeg kde kipi lcms libnotify mad mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pppd qt3support qt4 readline sdl semantic-desktop session sse sse2 sse3 ssl ssse3 startup-notification svg sysfs syslog tcpd tiff truetype udev unicode usb vorbis x264 xcb xcomposite xinerama xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ubx" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en hu" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa intel fbdev" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 emg81 2011-10-31 16:11:11 UTC
I got same problem here.

It happens occasionaly, I mean I can't find out when exactly knotify4 starts to eat RAM or what exact action causes this memory leak.

It comes as a consequence of compiling packages (whole @world, @system and *even single packages* like firefox or thunderbird) - that's all I've noticed.

I can't say that this bug was with KDE 4.6.*, but it definately, hundred percent sure, happens with KDE 4.7.0, 4.7.1 and 4.7.2

Gentoo ~x86, KDE 4.7.2.
If I should provide logs or something - please tell me.
Comment 7 Patrick 2011-11-05 11:08:01 UTC
While I didn't compile anything myself, I do have this issue. We are two users on this computer and the knotify that suddenly will grow to 2+ GB will systematically be from the non active user (other x-window session). I am using the 4.7 repository from opensuse (11.4). Please note that this is not an infinite leak as the process will eventually recover normal activity (after a long while).
Comment 8 Roger Larsson 2012-01-19 08:53:22 UTC
I have exactly the same problem as Patrick #7 but as I have 8 GB of memory our knotify grows to about 6.7 GB!
OpenSUSE 12.1 Tumbleweed.
For me it is terminal - if I can get into text konsole and kill it everything recovers.

You need to use both sessions - my wife who is the other user was away for three days. I left her logged in - her knotify did not grow. But as she returned and read some mails and browsed around a bit my knotify grew to 6.7GB. And her X session become unresponsible.

Note: as Patrick describes it is the other knotify that grows!

Idea: Does knotify register for dnotify or something like that then a compilation could cause lots of events.

Phonon backend: Gstreamer
Comment 9 András Manţia 2012-02-16 17:16:11 UTC
I'm not sure if it is the same bug, as I noticed only recently, but knotify4 grown for me over 2.8GB in a day. I used the pc for normal things, which means development, mail, net...
Comment 10 András Manţia 2012-02-16 17:31:06 UTC
I used gstreamer, no pulseaudio, qt 4.8
Comment 11 Christoph Feck 2012-02-23 19:12:30 UTC
*** Bug 294700 has been marked as a duplicate of this bug. ***
Comment 12 Michael Pyne 2012-06-20 02:17:21 UTC
I've had this happen. It only ever happened while a notification was supposed to play though. I also use Gstreamer, no PulseAudio, on Gentoo. I suspect the issue was actually with phonon-gst and not knotify4, but knotify4 is the one playing the sound...

For Gentoo, I believe some ebuilds actually make a terminal beep to warn of important info, which Konsole by default will refer to knotify4. So it's possible that's the reason it is seen while using emerge.

I haven't had it happen in awhile though, I believe phonon-gst has been fixed in the meantime. I would try phonon-gstreamer from git if possible.
Comment 13 Jekyll Wu 2012-12-14 05:33:07 UTC
Inspired by comment #12, here is the steps for reproducing the problem:

1. run "kcmshell4 kcmnotify", ensure "KDE sound system" is used.

2. open konsole, set the events of "Bell in Visible/Invisible Session" to play sound and choose some sound file

3. in konsole/shell, run the following command:

    for i in `seq 1 1000`; do echo -en "\a"; sleep 3; done

4. in the mean time, user ksysguard to observer the (heap) memory usage of knotify4, which increases about 100KB after each notifiation sound .

The leak can be reproduced using any phonon backend (vlc, gstream, avkode), so the cause should be in knotify4 or phonon itself.

I 'm using phonon* built from master code.
Comment 14 Myriam Schweingruber 2012-12-14 13:39:11 UTC
(In reply to comment #13)
> Inspired by comment #12, here is the steps for reproducing the problem:
> 
> 1. run "kcmshell4 kcmnotify", ensure "KDE sound system" is used.
> 
> 2. open konsole, set the events of "Bell in Visible/Invisible Session" to
> play sound and choose some sound file
> 
> 3. in konsole/shell, run the following command:
> 
>     for i in `seq 1 1000`; do echo -en "\a"; sleep 3; done
> 
> 4. in the mean time, user ksysguard to observer the (heap) memory usage of
> knotify4, which increases about 100KB after each notifiation sound .
> 
> The leak can be reproduced using any phonon backend (vlc, gstream, avkode),
> so the cause should be in knotify4 or phonon itself.
> 
> I 'm using phonon* built from master code.

Confirmed with KDE 4.9.90
Comment 15 Sergio Martins 2013-07-14 17:43:19 UTC
I get a 20k increase when using vlc, and around 150k when using gstreamer.
Comment 16 Sergio Martins 2013-07-14 17:44:24 UTC
Created attachment 81109 [details]
massif report - looks like the bus gets filled with messages which arent freed
Comment 17 Sergio Martins 2013-07-14 17:54:12 UTC
someone with phonon/gst knowledge should look at this
Comment 18 Michael Pyne 2013-07-14 21:03:04 UTC
Bug 312448 (against juk) might also be related. In my initial attempts to reproduce the heap leak with massif it keeps showing the major leak originating from gst_buffer_try_new_and_alloc().

I'll post the massif output to the JuK bug, but please let me know if that is a dupe of this one.
Comment 19 Ben Creasy 2019-03-20 23:36:45 UTC
Coming upon 7 years since the last comment - could this be closed?
Comment 20 Michael Pyne 2019-03-23 14:34:28 UTC
Good idea Ben, and I've not been able reproduce in the meantime.