Bug 296473

Summary: Plasma Desktop crashes after several hours (due to memory leak of plasmoid)
Product: [Unmaintained] plasma4 Reporter: happy <hh.kde.crash>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: crash CC: ahartmetz, boutilpj, cfeck, denis.kot, dilnix, dlott+kde, franklin, gasortega, generatorglukoff, jjasen, jwjstone, pahan, spb.nevill, teedub303
Priority: NOR    
Version: 4.8.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: information about the crash
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description happy 2012-03-21 01:58:21 UTC
Application: plasma-desktop (0.4)
KDE Platform Version: 4.8.00 (4.8.0
Qt Version: 4.7.4
Operating System: Linux 3.0.0-17-generic i686
Distribution: Ubuntu 11.10

-- Information about the crash:
- Unusual behavior I noticed:
Before the crash happens, window decorations start to be drawn weirdly (wrong background around widgets etc, highlighting funny); time to respond to window clicks increases.
Applications like VLC are no longer able to display video
Looks like some kind of resource allocation problem, although system ram and cpu usage appears to be fine (ie: if something is leaking, it's not those resources)
Did not happen before 4.8.0
Appears to happen after several hours (~6) of system uptime.
Sorry, could not find symbols for libQtScript.

The crash can be reproduced some of the time.

-- Backtrace:
Application: Plasma Desktop Shell (plasma-desktop), signal: Aborted
[Current thread is 1 (Thread 0xb7709720 (LWP 2256))]

Thread 5 (Thread 0xb1590b70 (LWP 2257)):
#0  next_valid_source (source=0x0, context=0xa169af8) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:2485
#1  g_main_context_prepare (context=0xa169af8, priority=0xb1590178) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:2739
#2  0x01dda637 in g_main_context_iterate (context=0xa169af8, block=1, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3069
#3  0x01ddac2a in g_main_context_iteration (context=0xa169af8, may_block=1) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3152
#4  0x021cbb37 in QEventDispatcherGlib::processEvents (this=0xa169da0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#5  0x0219c1dd in QEventLoop::processEvents (this=0xb15902a0, flags=...) at kernel/qeventloop.cpp:149
#6  0x0219c421 in QEventLoop::exec (this=0xb15902a0, flags=...) at kernel/qeventloop.cpp:201
#7  0x0209f90b in QThread::exec (this=0xa1680d8) at thread/qthread.cpp:498
#8  0x0217ce2d in QInotifyFileSystemWatcherEngine::run (this=0xa1680d8) at io/qfilesystemwatcher_inotify.cpp:248
#9  0x020a27b3 in QThreadPrivate::start (arg=0xa1680d8) at thread/qthread_unix.cpp:331
#10 0x01d39d31 in start_thread (arg=0xb1590b70) at pthread_create.c:304
#11 0x00c5846e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 4 (Thread 0xae955b70 (LWP 2258)):
#0  __libc_enable_asynccancel () at ../nptl/cancellation.c:44
#1  0x00c49797 in __GI___poll (fds=0xa78dcf8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:85
#2  0x01de934b in g_poll (fds=0xa78dcf8, nfds=1, timeout=-1) at /build/buildd/glib2.0-2.30.0/./glib/gpoll.c:132
#3  0x01dda896 in g_main_context_poll (n_fds=1, fds=0xa78dcf8, timeout=<optimized out>, context=0xa78c870, priority=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3402
#4  g_main_context_iterate (context=0xa78c870, block=31363872, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3084
#5  0x01ddac2a in g_main_context_iteration (context=0xa78c870, may_block=1) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3152
#6  0x021cbb37 in QEventDispatcherGlib::processEvents (this=0xa78c178, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#7  0x0219c1dd in QEventLoop::processEvents (this=0xae9552a0, flags=...) at kernel/qeventloop.cpp:149
#8  0x0219c421 in QEventLoop::exec (this=0xae9552a0, flags=...) at kernel/qeventloop.cpp:201
#9  0x0209f90b in QThread::exec (this=0xa78aa40) at thread/qthread.cpp:498
#10 0x0217ce2d in QInotifyFileSystemWatcherEngine::run (this=0xa78aa40) at io/qfilesystemwatcher_inotify.cpp:248
#11 0x020a27b3 in QThreadPrivate::start (arg=0xa78aa40) at thread/qthread_unix.cpp:331
#12 0x01d39d31 in start_thread (arg=0xae955b70) at pthread_create.c:304
#13 0x00c5846e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 3 (Thread 0xaca12b70 (LWP 2285)):
#0  0x0053b416 in __kernel_vsyscall ()
#1  0x01d3da5c in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0x00c6609c in __pthread_cond_wait (cond=0x166aa50, mutex=0x166aa38) at forward.c:139
#3  0x015659a9 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#4  0x015659ef in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#5  0x01d39d31 in start_thread (arg=0xaca12b70) at pthread_create.c:304
#6  0x00c5846e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 2 (Thread 0xab33fb70 (LWP 2289)):
#0  g_poll (fds=0xb2072b0, nfds=3, timeout=-1) at /build/buildd/glib2.0-2.30.0/./glib/gpoll.c:131
#1  0x01dda896 in g_main_context_poll (n_fds=3, fds=0xb2072b0, timeout=<optimized out>, context=0xb288400, priority=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3402
#2  g_main_context_iterate (context=0xb288400, block=31363872, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3084
#3  0x01ddaf9b in g_main_loop_run (loop=0xb289a00) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3297
#4  0x07511cea in gdbus_shared_thread_func (user_data=0xb207378) at /build/buildd/glib2.0-2.30.0/./gio/gdbusprivate.c:276
#5  0x01e015f4 in g_thread_create_proxy (data=0xb288490) at /build/buildd/glib2.0-2.30.0/./glib/gthread.c:1962
#6  0x01d39d31 in start_thread (arg=0xab33fb70) at pthread_create.c:304
#7  0x00c5846e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 1 (Thread 0xb7709720 (LWP 2256)):
[KCrash Handler]
#7  0x0053b416 in __kernel_vsyscall ()
#8  0x00bb2c8f in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#9  0x00bb62b5 in __GI_abort () at abort.c:92
#10 0x004d84ed in __gnu_cxx::__verbose_terminate_handler () at ../../../../src/libstdc++-v3/libsupc++/vterminate.cc:95
#11 0x004d6283 in __cxxabiv1::__terminate (handler=0x4d83a0 <__gnu_cxx::__verbose_terminate_handler()>) at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:40
#12 0x004d62bf in std::terminate () at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:50
#13 0x004d6464 in __cxxabiv1::__cxa_rethrow () at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:116
#14 0x0219c569 in QEventLoop::exec (this=0xbfe20d04, flags=...) at kernel/qeventloop.cpp:214
#15 0x021a119d in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#16 0x02dba924 in QApplication::exec () at kernel/qapplication.cpp:3760
#17 0x0085e6fb in kdemain () from /usr/lib/kde4/libkdeinit/libkdeinit4_plasma-desktop.so
#18 0x0804850b in ?? ()
#19 0x00b9e113 in __libc_start_main (main=0x80484f0, argc=1, ubp_av=0xbfe20f04, init=0x80485e0 <__libc_csu_init>, fini=0x8048650 <__libc_csu_fini>, rtld_fini=0x35eba0, stack_end=0xbfe20efc) at libc-start.c:226
#20 0x08048531 in _start ()

Possible duplicates by query: bug 296431, bug 296407, bug 295014, bug 294113, bug 293860.

Reported using DrKonqi
Comment 1 Christoph Feck 2012-03-21 02:34:42 UTC
One of your plasma widgets has a memory leak. Try to find out which by removing one of them.
Comment 2 happy 2012-03-21 12:36:48 UTC
On Wed, 21 Mar 2012 02:34:42 AM you wrote:
> One of your plasma widgets has a memory leak. Try to find out which by removing
> one of them.

fair enough... thanks for the quick reply.

I would add that my widget set didn't change from pre 4.8.0 either - pretty minimal:
- one folder view (desktop folder)
- one note
- three icons
- analogue clock
- system load viewer
- hardware temperature
- network activity
(all out of the standard set of widgets)

I've never done any work with desktop widgets.

What do you think of these assumptions:
(1) the icons and the note are probably not leaking.
(2) that any leak is because of some activity
(3) that the more activity, the more likely the leak (like the network or the temperature).

Is there some method or tool I can use to monitor the resource usage of an individual widget?
I'm happy to do trial-and-error but that could take a while.

cheers,

d
Comment 3 Krasnikov Nikolay 2012-03-26 18:16:34 UTC
Created attachment 69918 [details]
information about the crash
Comment 4 Krasnikov Nikolay 2012-03-26 18:21:37 UTC
Sorry, not used to the tracker yet.

Application: plasma-desktop
KDE Platform Version: 4.8.00
Operating System: 3.2.0-20-generic
Distribution: Kubuntu 12.04

I may have been affected with the same error. I was away from the laptop when it happened, though. It had crashed before with sympthoms similar to what happy described (wrong widget background).

The only widgets I have installed that were not on in Kubuntu 12.04 by default were System Monitor and Icon Tabs.
Comment 5 happy 2012-03-27 11:00:20 UTC
Haven't worked all the way through the set of applets running individually but can't reproduce it yet.
The System Load viewer (not yet tested) is looking likely - temperature and network activity don't appear to be the cause.
Comment 6 Jekyll Wu 2012-03-29 07:41:26 UTC
*** Bug 297011 has been marked as a duplicate of this bug. ***
Comment 7 Anne-Marie Mahfouf 2012-04-05 08:32:47 UTC
*** Bug 297514 has been marked as a duplicate of this bug. ***
Comment 8 Krasnikov Nikolay 2012-04-05 15:59:31 UTC
Created attachment 70178 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.8.1 (4.8.1) using Qt 4.8.1

- What I was doing when the application crashed:
Nothing. I left the laptop running for a few hows. Only psi+, chromium, and one instance of Konsole were launched.

-- Backtrace (Reduced):
#6  0x00007f26ae1d1445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f26ae1d4bab in __GI_abort () at abort.c:91
[...]
#12 0x00007f26ab42f16c in QEventLoop::exec (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:218
#13 0x00007f26ab433f67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#14 0x00007f26ae599a13 in kdemain (argc=1, argv=0x7fff161ab418) at ../../../../plasma/desktop/shell/main.cpp:120
Comment 9 Krasnikov Nikolay 2012-04-10 16:38:22 UTC
Created attachment 70289 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.8.2 (4.8.2) using Qt 4.8.1

- What I was doing when the application crashed:
Left KTorrent to run for a few hours.  There was no user interation until the crash.

-- Backtrace (Reduced):
#6  0x00007f42125d2445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f42125d5bab in __GI_abort () at abort.c:91
[...]
#12 0x00007f420f83016c in QEventLoop::exec (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:218
#13 0x00007f420f834f67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#14 0x00007f421299aa13 in kdemain (argc=1, argv=0x7fff7aa3d468) at ../../../../plasma/desktop/shell/main.cpp:120
Comment 10 Patrick Boutilier 2012-04-18 19:56:08 UTC
Created attachment 70489 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.8.1 (4.8.1) using Qt 4.8.0

- What I was doing when the application crashed:

Nothing. Returned to desktop after computer was idle for about 8 hours.

-- Backtrace (Reduced):
#6  0x0000003dfc436285 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x0000003dfc437b9b in __GI_abort () at abort.c:91
#8  0x000000383dabbc5d in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#9  0x000000383dab9e16 in __cxxabiv1::__terminate (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:40
#10 0x000000383dab9e43 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:50
Comment 11 Jekyll Wu 2012-04-21 09:13:00 UTC
*** Bug 297237 has been marked as a duplicate of this bug. ***
Comment 12 Jekyll Wu 2012-04-21 09:15:16 UTC
*** Bug 298213 has been marked as a duplicate of this bug. ***
Comment 13 Jack Stone 2012-04-24 10:18:06 UTC
Created attachment 70625 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.8.1 (4.8.1) using Qt 4.8.0

- What I was doing when the application crashed:

I left the computer running and walked away. This has happened several times now.

-- Backtrace (Reduced):
#6  0x000000388f036285 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x000000388f037b9b in __GI_abort () at abort.c:91
#8  0x00000038924bbf8d in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#9  0x00000038924ba146 in __cxxabiv1::__terminate (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:40
#10 0x00000038924ba173 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:50
Comment 14 Patrick Boutilier 2012-05-03 16:32:16 UTC
(In reply to comment #10)
> Created attachment 70489 [details]
> New crash information added by DrKonqi
> 
> plasma-desktop (0.4) on KDE Platform 4.8.1 (4.8.1) using Qt 4.8.0
> 
> - What I was doing when the application crashed:
> 
> Nothing. Returned to desktop after computer was idle for about 8 hours.
> 
> -- Backtrace (Reduced):
> #6  0x0000003dfc436285 in __GI_raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #7  0x0000003dfc437b9b in __GI_abort () at abort.c:91
> #8  0x000000383dabbc5d in __gnu_cxx::__verbose_terminate_handler () at
> ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
> #9  0x000000383dab9e16 in __cxxabiv1::__terminate (handler=<optimized out>)
> at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:40
> #10 0x000000383dab9e43 in std::terminate () at
> ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:50

I upgraded my laptop to Fedora 17 Beta two weeks ago and have not had the problem since. Used to happen on a daily basis.

Qt: 4.8.1
KDE: 4.8.3
Comment 15 Denis 2012-05-11 07:21:51 UTC
Created attachment 71017 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.8.3 (4.8.3) using Qt 4.8.1

- What I was doing when the application crashed:

nothing. just unlock screensaver when came to work.

-- Backtrace (Reduced):
#6  0x00007f14cd4fa445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f14cd4fdbab in __GI_abort () at abort.c:91
[...]
#12 0x00007f14ca75716c in QEventLoop::exec (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:218
#13 0x00007f14ca75bf67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#14 0x00007f14cd8c2a13 in kdemain (argc=1, argv=0x7fffdce37ae8) at ../../../../plasma/desktop/shell/main.cpp:120
Comment 16 Jekyll Wu 2012-05-26 17:46:44 UTC
*** Bug 299750 has been marked as a duplicate of this bug. ***
Comment 17 Jekyll Wu 2012-05-27 09:35:25 UTC
*** Bug 300696 has been marked as a duplicate of this bug. ***
Comment 18 Jekyll Wu 2012-05-27 09:58:50 UTC
*** Bug 299255 has been marked as a duplicate of this bug. ***
Comment 19 Myriam Schweingruber 2012-05-27 10:11:09 UTC
Confirmed by duplicates.
Comment 20 Jekyll Wu 2012-07-04 08:38:36 UTC
*** Bug 302992 has been marked as a duplicate of this bug. ***
Comment 21 Franklin Weng 2012-07-05 23:52:03 UTC
(In reply to comment #1)
> One of your plasma widgets has a memory leak. Try to find out which by
> removing one of them.

In my case, if I removed all the widgets and left an empty plasma desktop, it wouldn't crash.

Then I tried to add a standard panel back (with task manager, system tray, digital clock), it crashed after some time.

Now I'm testing with an empty panel only.
Comment 22 Franklin Weng 2012-07-09 02:04:47 UTC
Current status:

The plasmoid that caused plasma-desktop crashed seemed to be system tray on a panel.

I restarted a standard panel and removed system tray, it didn't crash so far.

If I started an empty panel and add system tray into it, no any other plasmoids, it would crash.

Later I'll try if I put the system tray on the desktop instead of panel.

But I wonder if anyone would have the same symptom as mine.
Comment 23 dilnix 2012-07-09 09:34:21 UTC
I found a source of problem...
It was knemo... i just removed it fully (yum remove knemo) and restarted system... now have no problem during 24 hours online =)
Comment 24 Christoph Feck 2012-07-09 11:21:05 UTC
Thanks for the investigation. Now it would be interesting to find out which widget or application in the system tray causes the issue. For example, try removing mixer applet or update notifiers, or whatever else is hidden there.
Comment 25 Franklin Weng 2012-07-10 02:16:15 UTC
(In reply to comment #24)
> Thanks for the investigation. Now it would be interesting to find out which
> widget or application in the system tray causes the issue. For example, try
> removing mixer applet or update notifiers, or whatever else is hidden there.

Here's a possible root cause:  the nepomuk indexing.

If the nepomuk file indexer was disabled, it wouldn't crash.  I've been testing it for at least two hours and am still testing it.

I also disabled printer applet, korganizer reminder and akonaditray, but nepomuk file indexer is the most possible root cause because it also explains why my desktop PC wouldn't crash like that in my laptop.
Comment 26 Dan 2013-01-29 13:07:09 UTC
Seem to share the problem.

Interesting info from top:
 9124 dan       20   0 2092m 389m  62m T  0.0  2.4  19:02.97 /usr/bin/plasma-desktop                                                                                        
 9132 dan       20   0 2092m 389m  62m T  0.0  2.4   0:01.49 /usr/bin/plasma-desktop                                                                                        
 9133 dan       20   0 2092m 389m  62m T  0.0  2.4   0:01.50 /usr/bin/plasma-desktop                                                                                        
 9134 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.00 /usr/bin/plasma-desktop                                                                                        
 2732 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.04 /usr/bin/plasma-desktop                                                                                        
 2733 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.08 /usr/bin/plasma-desktop                                                                                        
 2734 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.07 /usr/bin/plasma-desktop                                                                                        
 2735 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.00 /usr/bin/plasma-desktop                                                                                        
 2736 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.05 /usr/bin/plasma-desktop                                                                                        
 2737 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.07 /usr/bin/plasma-desktop                                                                                        
 2738 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.04 /usr/bin/plasma-desktop                                                                                        
 2739 dan       20   0 2092m 389m  62m T  0.0  2.4   0:00.00 /usr/bin/plasma-desktop                                                                                        

Backtrace of the crash I experienced:

Application: Plasma Desktop Shell (plasma-desktop), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fd8fe9b3780 (LWP 9124))]

Thread 12 (Thread 0x7fd8de2f7700 (LWP 9132)):
#0  0x00007fd8fe2908bd in read () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fd8f247b8cf in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fd8f2440ba4 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd8f2440fd6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd8f2441164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fd8fb463426 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007fd8fb432c82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8fb432ed7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007fd8fb331fa7 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007fd8fb4129ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#12 0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x0000000000000000 in ?? ()

Thread 11 (Thread 0x7fd8dd124700 (LWP 9133)):
#0  0x00007fd8fe2ab904 in pthread_mutex_unlock () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fd8f247c5d1 in g_mutex_unlock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fd8f2440f4e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd8f2441164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd8fb463426 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007fd8fb432c82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007fd8fb432ed7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8fb331fa7 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007fd8fb4129ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#11 0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#12 0x0000000000000000 in ?? ()

Thread 10 (Thread 0x7fd8dc923700 (LWP 9134)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8f8217222 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007fd8f8217259 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#4  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 9 (Thread 0x7fd8c4405700 (LWP 2732)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7fd8b9327700 (LWP 2733)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee29f4 in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#7  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#9  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7fd8b3fff700 (LWP 2734)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee29f4 in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#7  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#9  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7fd8b8b26700 (LWP 2735)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7fd8b37fe700 (LWP 2736)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee29f4 in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee29f4 in ?? () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#7  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#8  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7fd8b25b5700 (LWP 2737)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fd8b1db4700 (LWP 2738)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fd8b15b3700 (LWP 2739)):
#0  0x00007fd8f2d49d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd8fb3354db in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd8f6ee00eb in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fd8f6ee29db in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fd8f6ee184f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fd8f6ee18db in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fd8fb334fcb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fd8f2d45e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd8fe29dcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fd8fe9b3780 (LWP 9124)):
[KCrash Handler]
#6  0x00007fd8fe1e0425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x00007fd8fe1e3b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x00007fd8fa3a269d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007fd8fa3a0846 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fd8fa3a0873 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007fd8fa3a09b6 in __cxa_rethrow () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#12 0x00007fd8fb43316c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#13 0x00007fd8fb437f67 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007fd8fe5aaa13 in kdemain () from /usr/lib/kde4/libkdeinit/libkdeinit4_plasma-desktop.so
#15 0x00007fd8fe1cb76d in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#16 0x0000000000400671 in _start ()

I've seen it happen with a bare panel (when I had just installed).
Has anyone come up with a fix?
Comment 27 Andrey Batyiev 2013-03-09 02:10:49 UTC
Hello everyone

I found at least one possible way to reproduce this bug:
1. I use psi-im as messenger
2. On every new message, it flash icon in system tray
3. On KDE 4.9.3 it produce X11 memory leaks from plasma-desktop at rate around 50Kb/sec (I've measured from ksysguard)

So I've bisected at found that offending commit is:
commit ae04d14bd4977225787169adb88d88da7a19de74
Author: Luboš Luňák <l.lunak@suse.cz>
Date:   Wed Oct 5 12:25:28 2011 +0200

    less Xlib code, force Qt to use X pixmap for QPixmap instead
    
    REVIEW: 102770

I've reviewed that commit and have made a patch, that works for me:
diff --git a/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp b/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
index 1826512..eabea6a 100644
--- a/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
+++ b/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
@@ -236,7 +236,7 @@ QPixmap X11EmbedContainer::toX11Pixmap(const QPixmap& pix)
         return pix;
     Pixmap xpix = XCreatePixmap(pix.x11Info().display(), RootWindow(pix.x11Info().display(), pix.x11Info().screen()),
                                 pix.width(), pix.height(), QX11Info::appDepth());
-    QPixmap wrk = QPixmap::fromX11Pixmap(xpix);
+    QPixmap wrk = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
     QPainter paint(&wrk);
     paint.drawPixmap(0, 0, pix);
     paint.end();

Can someone else also review/confirm this?

Thanks,
Andrey
Comment 28 dilnix 2013-04-11 11:57:25 UTC
(In reply to comment #27)
> I found at least one possible way to reproduce this bug:
> 1. I use psi-im as messenger
> 2. On every new message, it flash icon in system tray
> 3. On KDE 4.9.3 it produce X11 memory leaks from plasma-desktop at rate
> around 50Kb/sec (I've measured from ksysguard)
>     less Xlib code, force Qt to use X pixmap for QPixmap instead

I found the same problem with using latest Skype in Fedora 18 x64. Process X is slowly growing in memory usage (200 Mb and more) and makes memory leak during maximum 6 hours. When starting system without Skype - there no problem - uptime 32 hours, process X amounts 32-64 Mb memory.
Is anybody can fix this problem? Because Skype community is silent as dead...
Comment 29 Andreas Hartmetz 2013-07-02 17:37:16 UTC
Looks like another duplicate of the tray code leaking X pixmaps.

*** This bug has been marked as a duplicate of bug 314919 ***