maximum number of clients reached

Bug #910539 reported by whitis
86
This bug affects 19 people
Affects Status Importance Assigned to Milestone
fglrx-installer (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

X server hits a client limit at a very low value. Somewhere around 95 clients. This is very easy to hit and I have hit this limit frequently since upgrading to 11.10. This has not normally been a problem in decades of running linux.

# Firefox downloads PDF file but does not open it as usual
$ evince /tmp/CM6206+datasheet+1.7.pdf &
[26] 9099
 Maximum number of clients reachedCannot parse arguments: Cannot open display:
[26] Exit 1 evince /tmp/CM6206+datasheet+1.7.pdf
$ ubuntu-bug evince
Maximum number of clients reachedCannot start: Gtk couldn't be initialized
$ ps axlww | fgrep -i evince | wc
     45 632 4771
 $ ico
Maximum number of clients reachedico: cannot open display ":0"
$ killall evince

# NOTE that I killed evince and thus about half the clients.

$ xlsclients | wc
     50 107 1227
$ xlsclients | sort | uniq -c
      1 '' /bin/sh /usr/lib/libreoffice/program/soffice
      1 cervantes applet.py
      1 cervantes bamfdaemon
      1 cervantes bluetooth-applet
      1 cervantes compiz
      1 cervantes deja-dup
      6 cervantes emacs
      1 cervantes eog
      1 cervantes evolution-alarm-notify
      4 cervantes file-roller
      1 cervantes firefox
      1 cervantes gdu-notification-daemon
      1 cervantes gnome-fallback-mount-helper
      1 cervantes gnome-screensaver
      1 cervantes gnome-session
      1 cervantes gnome-settings-daemon
      1 cervantes gnome-terminal
      1 cervantes gpodder
      3 cervantes inkscape
      1 cervantes nautilus
      1 cervantes nm-applet
      1 cervantes notify-osd
      1 cervantes npviewer.bin
      2 cervantes plugin-container
      1 cervantes polkit-gnome-authentication-agent-1
      2 cervantes python
      1 cervantes scp-dbus-service.py
      1 cervantes soffice
      1 cervantes ubuntuone-syncdaemon
      1 cervantes unity-panel-service
      1 cervantes unity-window-decorator
      1 cervantes update-manager
      1 cervantes update-notifier
      2 cervantes vlc
      2 cervantes xsane
      1 cervantes xterm -bg green -title alpine -e alpine

$ sudo lsof -p `pidof X` | grep socket | wc -l
[sudo] password for whitis:
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/whitis/.gvfs
      Output information may be incomplete.
64

$ xwininfo -root -children | wc
    882 5982 56551

$ xrestop - Display: :0
          Monitoring 67 clients. XErrors: 0
          Pixmaps: 162522K total, Other: 1405K total, All: 163928K total

res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
1200000 1784 2 1 38 16732 26206K 435K 26641K ? Compiz
0600000 0 0 0 1 0 22500K 0B 22500K ? <unknown>
1a00000 7 3 1 20 66 20282K 2K 20284K 2723 nautilus
0c00000 6 2 0 18 319 18750K 7K 18757K 2680 gnome-setting
14c00000 59 99 1 2268 2453 12731K 62K 12793K 2426 Downloads
4e00000 4 3 1 18 55 12709K 2K 12712K 11289 food_0002.jpe
a400000 25 126 1 1040 151 12316K 8K 12324K 22268 Wireless Test
13600000 48 165 1 128 115 8221K 8K 8229K 26330 BitPim
0000000 2 0 2 0 132 7500K 5K 7505K ? <unknown>
1e00000 0 0 0 1 0 7500K 0B 7500K ? <unknown>
2c00000 9661 67 1 118 1113 1870K 255K 2125K 2782 unity-window-
e000000 5 3 1 19 57 1358K 2K 1361K 5330 CN0144-Design
6400000 5 3 1 19 57 1358K 2K 1361K 19168 st51_d00_e00.
6000000 5 3 1 19 57 1358K 2K 1361K 19051 st51_d00_asci
4c00000 5 3 1 19 57 1358K 2K 1361K 11279 15w-pcb.zip [
13a00000 15 99 1 175 131 900K 6K 906K 30059 Preview 7650
7a00000 15 101 1 167 130 899K 6K 906K 23198 Preview 7650:
7600000 17 7714 1 26 68 472K 183K 656K 21913 virginia_low.
6200000 22 7862 1 50 83 463K 187K 651K 21158 usmap2.svg -
7400000 17 4358 1 28 69 469K 105K 575K 21902 virginia.svg
...

Unity and compiz seem to have an inordinate number of windows open.

uptime was a mere 19 days.

I am not running google chrome, lastpass, or MinimizeToTray which have been blamed for this problem elsewhere.

On a related note, the screensaver can take a very long time to let you unlock the screen (and actually displays the desktop to prying eyes before hiding it and displaying the prompt). Last time I needed to unlock, it would not display the password window. I switched to a console window and killed it. It has been mentioned that switching to console and back may free some x server resources.

I have 16GB RAM in this machine.

ati-driver-installer-11-10-x86.x86_64.run

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: xorg 1:7.6+7ubuntu7
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: fglrx
.tmp.unity.support.test.0:

ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 1e1a99f31ec2933306456e1f141c45d8
CheckboxSystem: edda5d4f616ca792bf437989cb597002
CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,gnomecompat,resize,regex,mousepoll,snap,imgpng,grid,place,unitymtgrabhandles,move,vpswitch,animation,workarounds,wall,session,expo,fade,ezoom,scale,unityshell]
CompositorRunning: compiz
Date: Sun Jan 1 07:19:16 2012
DistUpgraded: Log time: 2011-11-09 01:26:59.103060
DistroCodename: oneiric
DistroVariant: ubuntu
GdmLog: X: /tmp/.X11-unix has suspicious mode (not 1777) or is not a directory, aborting.
GraphicsCard:
 ATI Technologies Inc Cayman PRO [AMD Radeon 6900 Series] [1002:6719] (prog-if 00 [VGA controller])
   Subsystem: ASUSTeK Computer Inc. Device [1043:03d4]
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
JockeyStatus:
 xorg:fglrx_updates - ATI/AMD proprietary FGLRX graphics driver (post-release updates) (Proprietary, Disabled, Not in use)
 xorg:fglrx - ATI/AMD proprietary FGLRX graphics driver (Proprietary, Disabled, Not in use)
MachineType: System manufacturer System Product Name
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic root=UUID=02f53b93-8fd3-44ee-911b-a2d656e2d4d2 ro
SourcePackage: xorg
UpgradeStatus: Upgraded to oneiric on 2011-11-09 (53 days ago)
dmi.bios.date: 02/17/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1902
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: Crosshair IV Formula
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1902:bd02/17/2011:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnCrosshairIVFormula:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
version.compiz: compiz 1:0.9.6+bzr20110929-0ubuntu5
version.fglrx-installer: fglrx-installer N/A
version.ia32-libs: ia32-libs 20090808ubuntu26
version.libdrm2: libdrm2 2.4.26-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 7.11-0ubuntu3
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.11-0ubuntu3
version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu7
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.0-1ubuntu13
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20110811.g93fc084-0ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.15.901-1ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110411+8378443-1

Revision history for this message
whitis (whitis) wrote :
Bryce Harrington (bryce)
affects: xorg (Ubuntu) → fglrx-installer (Ubuntu)
Revision history for this message
Mark Stosberg (markstos) wrote :

I'm also getting this error when trying to open a PDF with evince on 12.04.

Revision history for this message
Donatas Olsevičius (donatas-o) wrote :

I've had 200 zenity instances (xlsclients | sort | uniq -c), killed it (killall zenity) and now everything works fine. The problem appeared after 35 days uptime.

Revision history for this message
SSShei (ssshei) wrote :

There is an easy way around this -- rename (or even delete) the file /etc/ati/atiapfuser.blb. From my research this is a "user profile" which doesn't seem to be utilized, at least in my case. When that files exist, you will see LOTS of entries like:

Xorg 21747 root 103r REG 8,4 0 16387220 /etc/ati/atiapfuser.blb

in the output of "sudo lsof -P `pidof X`". But after I 'mv' the file, not long these entries.

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

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

Changed in fglrx-installer (Ubuntu):
status: New → Confirmed
Revision history for this message
CoolAcid (jakendall-q) wrote :

What GPU and driver (w/ version) is everyone using? I've noticed the /etc/ati/atiapfuser on mine and would like to see if this could be the actual reason.

Thanks,
J

Revision history for this message
linas (linasvepstas) wrote :

Nothing to do with ATI, I hit this on NVIDIA as well. In my case, I have many, many copies of evince running.

Revision history for this message
linas (linasvepstas) wrote :

Anyway, googling for the error message suggests that lots of people hit this; its a hard-coded constant in an X11 header file; it would need to be changes and have X11 recompiled, or made into a run-time configurable parameter.

Lets just hope that Wayland doesn't have this problem ...

Revision history for this message
CoolAcid (jakendall-q) wrote :

Although I agree with both points. It is hard coded limit in X11, and you can hit it with NVIDIA drivers. However, in this case, there is a bug in the ATI drivers which causes users to hit this limit sooner due to elevated number of windows created and/or not released correctly.

Wayland *should* resolve this issue, however, ATI drivers would need to be coded to use that driver format as they are currently not supported.

Revision history for this message
SA (superaorta) wrote :

I've just hit this bug in 13.04 using nvidia drivers.

but the 280+ instances of Kblankscrn from the screen saver bug currently going around probably contributes!

Revision history for this message
padarjohn (john-meissen) wrote :

I don't think this is an issue with a hardcoded constant in X, not unless someone recently made it much smaller. I hadn't seen this problem at all in 15+ years of using Linux/X, not until upgrading from 10.04LTS to 12.04LTS.

More likely it's a newly introduced resource leak in X or gnome.

I'm using the nVidia driver.

I hit this yesterday and had to log out/restart X, and I'm already hitting it again today.

After killing everything except a single terminal and this instance of Firefox I notice out of 244 root window children over 160 instances of this sort:

     0xc001b9 (has no name): () 238x196+842+518 +842+518
        2 children:
        0xc001ba (has no name): () 236x164+1+27 +843+545
        0xc001bb (has no name): () 238x196+0+0 +842+518

They're all children of the root window. There are some duplicates, for instance (ignoring their 2 children):

     0xc01660 (has no name): () 1077x1052+850+154 +850+154
     0xc016b1 (has no name): () 1077x1052+324+118 +324+118
     0xc017ea (has no name): () 1077x1052+850+154 +850+154
     0xc01877 (has no name): () 1077x1052+850+154 +850+154
     0xc018fb (has no name): () 1077x1052+850+154 +850+154
     0xc01947 (has no name): () 1077x1052+850+154 +850+154
     0xc019cc (has no name): () 1077x1052+850+154 +850+154
     0xc01a45 (has no name): () 1077x1052+850+154 +850+154

I used to think it was xscreensaver, but I disabled that. I have no screensaver process running now. The only "strange" thing that might be related is a shell script I run that fires off xplanet every 5 minutes to generate a jpeg and then calls
  gconftool -t str -s /desktop/gnome/background/picture_filename <file.jpg>
to update the background image.

> xlsclients
john gnome-session
john gnome-settings-daemon
john gnome-panel
john gnome-fallback-mount-helper
john rainlendar2
john polkit-gnome-authentication-agent-1
john devilspie
john gtk-window-decorator
john notify-osd
john gdu-notification-daemon
john telepathy-indicator
john indicator-applet
john gweather-applet-2
john indicator-applet-session
john indicator-printers-service
john evolution-alarm-notify
john gnome-terminal
john firefox

Any suggestions on how to debug this would be appreciated.

Revision history for this message
padarjohn (john-meissen) wrote :

This is looking more and more like a X server resource leak.

I reached this state again after a couple of days (as I usually do) and tried to capture some information to compare with the clean-state data, so I closed everything I had open until I had only the clients that I normally have right after login. Then I started running xwininfo with different options.

After successfully running xwininfo several times I suddenly got

 Maximum number of clients reachedxwininfo: error: unable to open display ":0.0"

I literally had not run anything else other than a few shell commands. I seriously doubt xwininfo is leaking handles. Later, when I'm not doing real work, I'll try to script something to see if I can create a failure.

Revision history for this message
Matthew Piatt (matthew-g-piatt) wrote :

I'm running an AMD Radeon HD 6450 with the driver downloaded and installed from the AMD website (http://support.amd.com/en-us/download/desktop?os=Linux%20x86)

When running "sudo lsof -P `pidof X`" I would also see a lot of entries like another user mentioned above:

Xorg 21747 root 103r REG 8,4 0 16387220 /etc/ati/atiapfuser.blb

After renaming atiapfuser.blb to something else (atiapfuser.blb.bak), I rebooted, and these entries stopped piling up. It's been a few days since I did this, and I haven't seen them at all, and I don't get any more errors about maximum number of clients reached.

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.