Bug 60925 - Apps can leak resources and cause X server to fail
Summary: Apps can leak resources and cause X server to fail
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-15 19:42 UTC by Chris Wilson
Modified: 2014-03-21 20:04 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Chris Wilson 2013-02-15 19:42:22 UTC
I experienced what looks like bug #39552, but was not resolved by installing the fixed version of the Intel X server.

It seems that applications are able to (accidentally) make the entire desktop unusable by leaking resources. In my case it's the AWN indicator-applet. Animated indicator icons leak resources until some windows, and eventually the entire desktop, can't be drawn any more and remain black. Killing and restarting the applet makes the desktop usable again. If it gets really bad then I have to do this from the command line.

Chris Wilson (ickle) thinks it would be a good idea to file a bug against the X server since it allows apps to exhaust the (very limited?) pixmap memory available to the X server. I think he thinks this is a general X server bug, although I have never seen it with any driver except intel. He says:

"Thinking about it, a bug against Xorg core to teach it per-client resource limits is actually not a bad idea. I would imagine that XACE, the security extension to X that already does all the permission checks, should be modifiable to also perform resource limit checks."
[https://bugs.freedesktop.org/show_bug.cgi?id=39552#c60]

I hope this is useful. Cheers, Chris.
Comment 1 Knut Petersen 2013-02-25 07:14:23 UTC
qinternet is often used by opensuse users to control internet connections.
A usefull utility, but it has the same problem: ONE EXTRA PIXMAP EVERY SECOND, never freed until qinternet gets killed. It´s amazing how long the xserver survives, but after about two days of uptime problems arise.

cu,
 Knut
Comment 2 Chris Wilson 2013-04-03 20:30:44 UTC
Is there any way to account for these resources, or list who is holding them and how much?

I'm experimenting with using Cairo Dock instead of AWN, and it appears to have the same problem, but I can't yet find which process has the resource leak (awn-indicator-applet was a lucky guess, which of course no longer works).
Comment 3 Knut Petersen 2013-04-03 20:53:35 UTC
(In reply to comment #2)
> Is there any way to account for these resources, or list who is holding them
> and how much?
> 
> I'm experimenting with using Cairo Dock instead of AWN, and it appears to
> have the same problem, but I can't yet find which process has the resource
> leak (awn-indicator-applet was a lucky guess, which of course no longer
> works).

Well, qinternet reliably eats memory every second, but it does not seem to be the only problem. I tried xrestop, it does work fine normally, but it killed the xserver twice when fired up in those situations. "Killed" means: absolutely no entry in the xserver log, no entry in the system log, absolutely nothing. It´s not easy to debug when debugging tools fail ...

cu,
 Knut
Comment 4 davidoski 2014-01-13 23:40:33 UTC
Hi,

this bug is in fact caused by the intel video driver xf86-video-intel in the version subsequent to 2.21.15. To avoid problem just install the following version: http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/xf86-video-intel-2.21.15.tar.gz

During installation you need to name it as xserver-xorg-video-intel to replace the driver installed from repository of your distribution.

After installation the sna AccellMethod must be set in the xorg.conf file in the Device section:

Option "AccelMethod" "sna" 

This solved problem on my Debian Wheezy powered machine.
Comment 5 bjo 2014-01-24 05:34:11 UTC
According to https://bugs.archlinux.org/task/38547 there's also a memory leak which is not fixed in 2.21.15. Also on my own machine X uses 300-400MB memory after some days, xf86-video-intel version is 2.99.907-2 with sna acceleration.
Comment 6 davidoski 2014-01-24 06:22:47 UTC
You are right. 2.21.15 appears to be slightly better but is leaking memory as well although not so fast. I'll downgrade the version installed on my machine until I find the one that doesn't leak memory.

http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/refs/tags
Comment 7 Knut Petersen 2014-01-24 08:14:29 UTC
(In reply to comment #4)
> Hi,
> 
> this bug is in fact caused by the intel video driver xf86-video-intel in the
> version subsequent to 2.21.15. To avoid problem just install the following
> version:
> http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/xf86-video-
> intel-2.21.15.tar.gz

Well, the bugreport is several months older than 2.21.15, so this version definitely is not the solution. 

The problem itself is many _years_ older.

cu,
 Knut
Comment 8 Adam Jackson 2014-03-21 19:28:01 UTC
"My application leaks resources and I want someone else to clean up after it!"

No, fix your app.
Comment 9 Chris Wilson 2014-03-21 19:37:28 UTC
That's an interesting attitude. It doesn't help me much because it's not MY app. It's AN app that's running on my desktop, but how am I supposed to know which one? Killing apps at random until it stops happening?

I think the X server should protect itself against broken apps, just as the kernel does. Fixing every app is an impossible task.
Comment 10 Alan Coopersmith 2014-03-21 19:53:53 UTC
(In reply to comment #9)
> That's an interesting attitude. It doesn't help me much because it's not MY
> app. It's AN app that's running on my desktop, but how am I supposed to know
> which one? Killing apps at random until it stops happening?

xrestop or similar tools using the X Resource extension.
Comment 11 Chris Wilson 2014-03-21 20:04:11 UTC
As Knut Petersen said in comment #3, xrestop doesn't work:

"I tried xrestop, it does work fine normally, but it killed the xserver twice when fired up in those situations."


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.