Xvnc consumes 100% CPU usage after client disconnects
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vnc4 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I have been experiencing this bug for several years but I finally decided to investigate it. I run Xvnc through xinetd and I often find that there are left-over Xvnc processes each consuming 100% CPU. They tend to crop up when a client disconnects. In particular, scanning ports with nmap produces the problem every time.
I used gdb to capture a few stack traces of the offending code:
(gdb) bt
#0 0x00007f468f811c1f in _IO_vfprintf_
format=<value optimized out>, ap=<value optimized out>) at vfprintf.c:1542
#1 0x00007f468f81bb24 in __fprintf (stream=<value optimized out>,
format=<value optimized out>) at fprintf.c:33
#2 0x000000000055ddbe in rfb::Logger_
logname=
message=
#3 0x000000000054b989 in rfb::Logger:
logname=
format=0x7b4c08 "XserverDesktop
at Logger.cxx:76
#4 0x000000000053db47 in rfb::LogWriter:
#5 0x00000000005438ed in XserverDesktop:
#6 0x000000000053c054 in vncWakeupHandler ()
#7 0x000000000042809b in WakeupHandler ()
#8 0x000000000043ab17 in WaitForSomething ()
#9 0x0000000000427866 in Dispatch ()
#10 0x000000000040c2e6 in main ()
(gdb) bt
#0 0x00007f468f8a23a0 in __write_nocancel () at ../sysdeps/
#1 0x00007f468f83d773 in _IO_new_file_write (f=0x7f468fb589c0, data=<value optimized out>, n=69) at fileops.c:1276
#2 0x00007f468f83d3ba in new_do_write (fp=0x7f468fb589c0, data=0x7f4690735000 " XserverDesktop: XserverDesktop:
#3 0x00007f468f83e925 in _IO_new_do_write (fp=<value optimized out>, data=<value optimized out>, to_do=69) at fileops.c:503
#4 0x00007f468f83d51d in _IO_new_file_xsputn (f=0x7f468fb589c0, data=0x7b79ea, n=1) at fileops.c:1358
#5 0x00007f468f8109b6 in _IO_vfprintf_
#6 0x00007f468f81bb24 in __fprintf (stream=<value optimized out>, format=<value optimized out>) at fprintf.c:33
#7 0x000000000055dd91 in rfb::Logger_
#8 0x000000000054b989 in rfb::Logger:
#9 0x000000000053db47 in rfb::LogWriter:
#10 0x00000000005438ed in XserverDesktop:
#11 0x000000000053c054 in vncWakeupHandler ()
#12 0x000000000042809b in WakeupHandler ()
#13 0x000000000043ab17 in WaitForSomething ()
#14 0x0000000000427866 in Dispatch ()
#15 0x000000000040c2e6 in main ()
(gdb) bt
#0 0x00007f3b454913e3 in __gxx_personali
from /usr/lib/
#1 0x00007f3b44f4c646 in _Unwind_
from /lib/x86_
#2 0x00007f3b45491a51 in __cxa_throw ()
from /usr/lib/
#3 0x000000000057780c in network:
at TcpSocket.cxx:417
#4 0x0000000000543863 in XserverDesktop:
#5 0x000000000053c054 in vncWakeupHandler ()
#6 0x000000000042809b in WakeupHandler ()
#7 0x000000000043ab17 in WaitForSomething ()
#8 0x0000000000427866 in Dispatch ()
#9 0x000000000040c2e6 in main ()
So it seems to be spending all its time on C++ exception handling and logging error messages. :/
I also got a couple profiles with oprofile, which are attached.
Note that other ppl have this problem too, e.g. http://
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: vnc4server 4.1.1+xorg4.
ProcVersionSign
Uname: Linux 2.6.38-10-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Mon Aug 1 11:26:14 2011
ProcEnviron:
LANGUAGE=en_US:en
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: vnc4
UpgradeStatus: Upgraded to natty on 2011-05-08 (85 days ago)
Also attaching my xinetd file for Xvnc.