High memory usage of Xorg and kwin after Xorg security updates [nvidia]

Bug #1402551 reported by stargazer
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
kde-workspace (Ubuntu)
In Progress
Undecided
Unassigned
nvidia-graphics-drivers-304-updates (Ubuntu)
Confirmed
Undecided
Unassigned
nvidia-graphics-drivers-331-updates (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hello,

since the Xorg/nvidia security updates last week, I encounter a problem with growing Xorg and kwin memory usage.
In one hour the memory consumption is at Xorg ~ 270 MiB and at kwin: 300 MB , so the system responds slowly and scrolling is very slow in in dolphin, kwrite, firefox, etc.
After several hours the system is so slow, that only a restart helps, and then the growing of memory starts again.

*** My Tests;

I tried several nvidia drivers, but without success (from: https://launchpad.net/~xorg-edgers/+archive/ubuntu/ppa/+index?field.series_filter=precise)

304.125-0ubuntu0.0.1~xedgers12.04.1
331.113-0ubuntu0.0.1~xedgers12.04.1
346.22-0ubuntu1~xedgers12.04.1
(With purging each nvidia driver and fresh installing it)

*** My configuration;

Two Kubuntu 12.04.5 PCs with a nvidia card;
nvidia driver 331.113-0ubuntu0.0.0.3 and 304.125-0ubuntu0.0.0.1
One pc with the Trusty Xstack (HWE) with Trusty kernel (3.13.0-43.72~precise1) and the other one with the stock kernel (3.2.0-74-generic #109) and stock xstack.

I use one pc in my office, so it disturbs my work because of the slowness and restarts.

Nvidia Forum Post:

https://devtalk.nvidia.com/default/topic/797547/linux/memory-leak-in-kwin-and-xorg-after-xorg-security-updates/

Thank you for your help!

Best regards, Bernhard

*** Problematic packages and other Xorg deps

nvidia-graphics-drivers-331 (331.113-0ubuntu0.0.0.3) precise-security; urgency=medium

  [ Alberto Milone ]
  * debian/substvars:
    - Add support for video ABIs up to 19.
  * debian/templates/dkms_nvidia.conf.in:
    - Drop all the patches.
  * SECURITY UPDATE:
    - CVE-2014-8091, CVE-2014-8098, CVE-2014-8298 (LP: #1400673).
 -- Alberto Milone <email address hidden> Tue, 09 Dec 2014 12:10:46 +0100

CVE-2014-8298 RESERVED
CVE-2014-8098 out of bounds access in GLX extension
CVE-2014-8091 denial of service due to unchecked malloc in client authentication

nvidia-graphics-drivers-304-updates (304.125-0ubuntu0.0.0.1)

xorg-server-lts-trusty (2:1.15.1-0ubuntu2~precise4) precise-security; urgency=medium

  * SECURITY UPDATE: Dec 2014 security issues - additional fixes
    - debian/patches/CVE-2014-8xxx/003[4567]*.patch: add additional
      fixes not included in original pre-advisory bundle.
 -- Marc Deslauriers <email address hidden> Tue, 09 Dec 2014 17:25:15 -0500

xorg-server-lts-trusty (2:1.15.1-0ubuntu2~precise3) precise-security; urgency=medium

  * SECURITY UPDATE: Dec 2014 protocol handling security issues
    - debian/patches/CVE-2014-8xxx/*.patch: patches from upstream to fix
      a multitude of security issues, including a couple of pre-requisite
      fixes from git.
    - CVE-2014-8091
    - CVE-2014-8092
    - CVE-2014-8093
    - CVE-2014-8094
    - CVE-2014-8095
    - CVE-2014-8096
    - CVE-2014-8097
    - CVE-2014-8098
    - CVE-2014-8099
    - CVE-2014-8100
    - CVE-2014-8101
    - CVE-2014-8102
    - CVE-2014-8103
 -- Marc Deslauriers <email address hidden> Sat, 06 Dec 2014 10:28:55 -0500

CVE-2014-8091 denial of service due to unchecked malloc in client authentication
CVE-2014-8092 intger overflows in X11 core protocol requests
CVE-2014-8093 integer overflows in GLX extension
CVE-2014-8094 integer overflows in DRI2 extensions
CVE-2014-8095 out of bounds access in XInput extensions
CVE-2014-8096 out of bounds access in XC-MISC extension
CVE-2014-8097 out of bounds access in DBE extension
CVE-2014-8098 out of bounds access in GLX extension
CVE-2014-8099 out of bounds access in XVideo extension
CVE-2014-8100 out of bounds access in Render extension
CVE-2014-8101 out of bounds access in RandR extension
CVE-2014-8102 out of bounds access in XFixes extension
CVE-2014-8103 out of bounds access in DRI3 & Present extensions

and other Xorg deps

stargazer (stargazer05)
affects: linux-firmware (Ubuntu) → xorg-server-lts-trusty (Ubuntu)
Revision history for this message
Rik Mills (rikmills) wrote :

Same behaviour regards increased memory usage of Xorg and kwin up to around 300 MB observed in kubuntu 14.10 (utopic).

Not causing any slowness at present though.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers-304-updates (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers-331-updates (Ubuntu):
status: New → Confirmed
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Changed in xorg-server-lts-trusty (Ubuntu):
status: New → Confirmed
Revision history for this message
stargazer (stargazer05) wrote :

CPU Usage is also higher, particularly at scrolling.

kwin: 10 - 25%
Xorg: 10 - 50%

Revision history for this message
Rik Mills (rikmills) wrote :

After downgrading to pre security update xorg-server packages, Xorg/plasma/kwin etc once again seem to have stable and minimal memory usage.

Revision history for this message
stargazer (stargazer05) wrote :

I'm currently testing kernel 3.2.0-73.108 (latest kernel: 3.2.0-74.109).
So far no problems after two hours, maybe the kernel is the culprit.

*** Changes
linux (3.2.0-74.109) precise; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1400709

  [ Upstream Kernel Changes ]

  * x86_64, traps: Stop using IST for #SS
    - LP: #1398795
    - CVE-2014-9090
  * x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
    - LP: #1398795
    - CVE-2014-9090
  * x86_64, traps: Rework bad_iret
    - LP: #1398795
    - CVE-2014-9090
  * x86, kvm: Clear paravirt_enabled on KVM guests for espfix32's benefit
    - LP: #1400314
    - CVE-2014-8134

 -- Luis Henriques <email address hidden> Tue, 09 Dec 2014 13:55:21 +0000

linux-lts-trusty (3.13.0-43.72~precise1) precise; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1399807

  [ Upstream Kernel Changes ]

  * x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
    - LP: #1398795
    - CVE-2014-9090
  * x86_64, traps: Rework bad_iret
    - LP: #1398795
    - CVE-2014-9090
  * x86, kvm: Clear paravirt_enabled on KVM guests for espfix32's benefit
    - LP: #1400314
    - CVE-2014-8134

 -- Luis Henriques <email address hidden> Tue, 09 Dec 2014 11:09:22 +0000

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1402551

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: precise
Revision history for this message
stargazer (stargazer05) wrote :

Unfortunately the same problem occurs with kernel 3.2.0-73.108.

Which log files shall I provide?

Sorry, I do not want to grant access/link the pc with launchpad.

no longer affects: linux (Ubuntu)
Revision history for this message
stargazer (stargazer05) wrote :

There are no error messages in Xorg.0.log or /var/log/syslog

Revision history for this message
stargazer (stargazer05) wrote :

Which logs do you need for debugging?

description: updated
Revision history for this message
stargazer (stargazer05) wrote :

The output of nvidia-smi shows a video memory-usage of 967MiB / 1023MiB (GT430) , which is very high.
Normal is 110MiB / 1023MiB (1 Monitor with FullHD).

Revision history for this message
stargazer (stargazer05) wrote :

After downgrading the package xserver-xorg-core to version 1.11.4-0-ubuntu10.14, the problem is gone.

It is definitely a issue with the security updates (1.11.4-0-ubuntu10.15 and 1.11.4-0-ubuntu10.16 and trusty xstack versions 1.15.1-0ubuntu2~precise3 and 1.15.1-0ubuntu2~precise4).

It seems this memory leak is only with the nvidia binary driver (and kde?).
Has anyone tested this fglrx?

With the open source drivers radeon and intel there is no problem. Nouveau?

I will test Unity for the occurrence of the memory leak and I will post the results.

Revision history for this message
stargazer (stargazer05) wrote :

@ Francis Brown (francisbrwn9) ;

Have you downgraded all the xorg* packages and deps or only the package xserver-xorg-core?

Revision history for this message
Rik Mills (rikmills) wrote :

All that had their version bumped by the security fix.

Have noticed something interesting. Increased Xorg memory usage here seems to be somewhat related to using Chrome/Chromium (or based upon) browser with hardware accelerations enabled in the advanced options. Each time I launch an instance it increases Xorg memory usage by ~ 30MB which is not released when the application is closed. Disabling hardware acceleration seems to eliminate that and I get very little or much slower degrading of Xorg memory usage.

I would suggest this might be worth reporting to Nvidia? https://devtalk.nvidia.com/default/board/98/ as seems possible it is their drivers not liking the fixed Xorg as much as it could be a bug in any other part of the graphics stack. I likewise see no problem at present with intel hardware.

Revision history for this message
stargazer (stargazer05) wrote :

Unity compiz and Xorg processes are not growing, this seems like a KDE + Nvidia + Xorg issue.

I tested firefox without hardware acceleration, but still growing kwin and xorg processes.

You can easily reproduce this, when you start in KDE the system monitor krunner (Ctrl+Esc), then search for kwin.
Do not start other applications and watch the process memory growing.

Thank you for the nvidia-link, I'll report it, when I have more time.

Revision history for this message
Rik Mills (rikmills) wrote :

OK. In that case it is a subtly different problem from what I am seeing then. If it persists I shall file a separate report.

Revision history for this message
stargazer (stargazer05) wrote :

The apport cmd, described in comment #9 , doesn't work and cannot resolve the package names(?), and the processes apport-collect and apport-kde run with low CPU usage (a few percent) and doing nothing (tested ~ 30 min), so I cannot attach the automated logs.

Which logs shall I provide instead of the apport-collected logs?

Revision history for this message
stargazer (stargazer05) wrote :

I must correct my comment#14, because with downgrading only the xorg-server-core package, the problem persists.
You have to downgrade all xorg* relevant packages to a version before the security updates of the last weeks, as Francis Brown mentioned.

Furthermore I have tested the open-source driver nouevau. There is no memory leak, all is normal.
But with this driver the KDE effects are very slow and window moving is terribly slow, etc.

So I have to stick with the nvidia driver.

Revision history for this message
stargazer (stargazer05) wrote :
Revision history for this message
Rik Mills (rikmills) wrote :

After some testing now seems from my side at least that the raising of unreleased memory usage by xorg is not related to the new xorg packages.

Seems to be a Chrome/Chromium bug as no other programs trigger this.

Revision history for this message
stargazer (stargazer05) wrote :

I have tested with disabled compositing-KDE-effects, and the problem is gone => no memory leak.
With KDE-effects the problem persists.

I will test this with a clean installation and will post the result.

Revision history for this message
stargazer (stargazer05) wrote :
Download full text (3.9 KiB)

- I have tested a fresh installation (via usb-stick) of Kubuntu 12.04.x with nvidia driver 331.113-0ubuntu0.0.0.3 and 304.125-0ubuntu0.0.0.1 , but I cannot reproduce the problem there (a few hours of testing).

But with a fresh user on the affected installation, the memory leak occurs.

- On my Office PC (12.04.x) with nvs300 the problem is gone, but I don't know why. (nvidia driver 304.125-0ubuntu0.0.0.1)
There was a kernel update linux-image-3.2.0-75-generic, but I don't know if this is connected. I installed and reinstalled several times different kernels.
changelog
linux (3.2.0-75.110) precise; urgency=low

[ Kamal Mostafa ]

* Release Tracking Bug
- LP: #1403154

[ Upstream Kernel Changes ]

* kvm: fix excessive pages un-pinning in kvm_iommu_map error path.
- LP: #1386395
- CVE-2014-8369
* KVM: x86: Don't report guest userspace emulation error to userspace
- LP: #1392823
- CVE-2014-7842
* drivers:scsi:storvsc: Fix a bug in handling ring buffer failures that
may result in I/O freeze
- LP: #1400289
* net:socket: set msg_namelen to 0 if msg_name is passed as NULL in
msghdr struct from userland.
- LP: #1335478

-- Kamal Mostafa <email address hidden> Tue, 16 Dec 2014 10:00:12 -0800

- On my Home PC (GT 430) the problem is still there;

That's why I have upgraded to the latest Ubuntu LTS version 14.04.x
There I installed the Utopic(14.10) kernel (3.16) with the Utopic xstack (Xserver 1.16.x) with latest nvidia 346.35 driver (with the default settings), but still the problem, but now with a crash after growing of kwin and xorg.

Memory consumption after ~ 16 hours of normal working, then after 30 min after the xrestop measurement => crash and restart of the xserver (log attached)
(Full HD resolution with KDE-effects enabled (on the office pc I have exactly the same effects with the same settings)).
kwin:
Memory: 218,3 MiB
Shared: 98,5 MiB

Xorg
Memory: 217,2 MiB
Shared: 78,7 MiB

plasma-desktop
Memory: 125,4 MiB
Shared: 91,6 MiB

xrestop - Display: localhost
Monitoring 44 clients. XErrors: 0
Pixmaps: 209917K total, Other: 152K total, All: 210070K total

res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
2000000 84 14 0 1593 1903 142735K 46K 142782K 2732 kwin

[ 6422.217] (EE) Backtrace:
[ 6422.221] (EE) 0: /usr/bin/X (xorg_backtrace+0x48) [0x7f7dcd5bde88]
[ 6422.221] (EE) 1: /usr/bin/X (0x7f7dcd419000+0x1a8ea9) [0x7f7dcd5c1ea9]
[ 6422.221] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (0x7f7dcb599000+0x36d40) [0x7f7dcb5cfd40]
[ 6422.221] (EE) 3: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f7dc5289000+0x5a1d96) [0x7f7dc582ad96]
[ 6422.221] (EE) 4: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f7dc5289000+0x57fb79) [0x7f7dc5808b79]
[ 6422.221] (EE) 5: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f7dc5289000+0x134922) [0x7f7dc53bd922]
[ 6422.221] (EE) 6: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f7dc5289000+0x1388f7) [0x7f7dc53c18f7]
[ 6422.221] (EE) 7: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f7dc5289000+0x136e29) [0x7f7dc53bfe29]
[ 6422.221] (EE) 8: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f7dc5289000+0x12f4b2) [0x7f7...

Read more...

tags: added: trusty
stargazer (stargazer05)
tags: added: upstream
description: updated
Revision history for this message
stargazer (stargazer05) wrote :

Still no luck with the latest nvidia driver 346.47!

As soon as I use the driver nouveau, there is no problem, no high memory usage of kwin/xorg processes or graphics memory.

Furthermore I have tested a fresh installation with Kubuntu 14.04.2 Install-DVD with a complete wipe-out of all partitions of the SSD , but the problem occurs there too.

Revision history for this message
stargazer (stargazer05) wrote :

Same problem with nvidia-349.12 driver and kernel 3.19.x.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kde-workspace (Ubuntu):
status: New → Confirmed
Changed in xorg-server-lts-utopic (Ubuntu):
status: New → Confirmed
Revision history for this message
stargazer (stargazer05) wrote :
Revision history for this message
stargazer (stargazer05) wrote :

Same problem with nvidia driver 352.09.

Revision history for this message
stargazer (stargazer05) wrote :

Furthermore I have tested the KDE effects in 14.04.x (KDE 4.13.3);

When I disable the following KDE effects, the memory leak is not occurring.

Cover-Switch (in german: 3D-Fenstergalerie) and Flip Switch (3D-Fensterstapel)

This is the result of testing for one week.
The memory usage of the graphics card (nvidia-smi) stays normal and the kwin process usage grows to ~ 100 MiB RAM (2K:2560x1440) and also frees memory back, if windows are closed. Xorg process at ~ 100 MiB.

I will test this further, but I think this two effects were the culprits.

This problem is only with the nvidia binary driver (tested until 352.09), it is not with the driver nouveau, intel, radeon (fglrx not tested).

Changed in kde-workspace (Ubuntu):
status: Confirmed → In Progress
Changed in nvidia-graphics-drivers-304-updates (Ubuntu):
status: Confirmed → In Progress
Changed in nvidia-graphics-drivers-331-updates (Ubuntu):
status: Confirmed → In Progress
no longer affects: xorg-server-lts-utopic (Ubuntu)
no longer affects: xorg-server-lts-trusty (Ubuntu)
no longer affects: xorg-server (Ubuntu)
Revision history for this message
Alberto Milone (albertomilone) wrote :

It's probably worth asking upstream (Kwin) about that specific KDE effect. I'm not familiar with that effect, but they are probably doing something that the binary driver doesn't expect (and that used to work only by accident). Just a thought.

Changed in nvidia-graphics-drivers-304-updates (Ubuntu):
status: In Progress → Confirmed
Changed in nvidia-graphics-drivers-331-updates (Ubuntu):
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.