On Mon, Jun 30, 2003 at 05:31:54PM +0500, Vlad Harchev wrote:
> Hello,
>
> I'm forwarding my mail again since nobody replied to it.
> What do developers think about it?
Thanks to email "Beerse, Corn?" <[EMAIL PROTECTED]> I've realized
that the versions of Xvnc and RH mentioned in original email are a bit old.
I'm very sorry for confusion - currently I'm using Xvnc 3.3.7 by realvnc
on RH73 and I remember seeing 100% CPU hogging by Xvnc even with these
versions when I'm changing system time. So it seems that the patch still
needs to be commited to RealVNC's Xvnc sources.
Best regards,
-Vlad
>
> ----- Forwarded message from Vlad Harchev <[EMAIL PROTECTED]> -----
>
> From: Vlad Harchev <[EMAIL PROTECTED]>
> Subject: Re: Xvnc-3.3.3 eats 100% CPU sometimes after a week of work or
> time adjustment
> Date: Thu, 26 Jun 2003 12:47:21 +0500
> To: [EMAIL PROTECTED]
> User-Agent: Mutt/1.4i
>
> On Fri, Nov 01, 2002 at 05:21:57PM +0400, Vlad Harchev wrote:
>
> Hello,
>
> Please note to how old message (that was left unreplied) I'm replying too.
>
> > On Fri, 1 Nov 2002, Vlad Harchev wrote:
> >
> > > Hi,
> > >
> > > I'm using Xvnc-3.3.3 from redhat-7.2 for x86 (package name is
> > > vnc-server-3.3.3r2-18).
> > > I encounter the following problem with it:
> > >
> > > Sometimes Xvnc begins eating 100% CPU. Stracing it I get the following loop
> > > (2 cycles shown):
> > >
> > > time(NULL) = 1026840822
> > > select(128, [0 1 3 5 6 7 8], NULL, NULL, {0, 0}) = 0 (Timeout)
> > > select(4, [3], NULL, NULL, {0, 0}) = 0 (Timeout)
> > > gettimeofday({1026840822, 9415}, NULL) = 0
> > > time(NULL) = 1026840822
> > > select(128, [0 1 3 5 6 7 8], NULL, NULL, {0, 0}) = 0 (Timeout)
> > > select(4, [3], NULL, NULL, {0, 0}) = 0 (Timeout)
> > > gettimeofday({1026840822, 9622}, NULL) = 0
> > >
> > > In such state Xvnc perfectly accepts connections from vncviewers, and works
> > > fine.
> > >
> > > Only killing Xvnc stops it from eating all CPU.
> > >
> > > As I observed, Xvnc switches to this state in the following conditions:
> > > 1) Either 1 week or more of process life.
> > > 2) Changing the time on the box (e.g. increasing current system time by a
> > > couple of minutes using 'date -s').
> > > It seems condition 1 is necessary, and condition 2 is not necessary provided
> > > condition 1 takes place.
> > >
> > > There are several Xvncs running on that box - they are started at the same
> > > time (with precission of several seconds), and they begin eating CPU almost at
> > > the same time. Not all Xvncs that switch to that state are connected to - one
> > > of Xvncs is run for programs just to have $DISPLAY pointing somewhere, and
> > > it's started as "Xvnc -ac -depth 8 -geometry 20x20 -fp
> > > tcp/localhost:7100 :8" and NO apps draw windows on it at all too, and it also
> > > begins eating CPU too. Other Xvncs are run using following commandline:
> > > "Xvnc -fp tcp/localhost:7100 -pixelformat rgb565 -depth 16 -geometry 1024x768"
> > >
> > > Here is a stderr output of the Xvnc that nobody was connecting to:
> > > ------
> > > started at Oct 22 18:12:31 2002
> > > 22/10/02 18:12:31 Xvnc version 3.3.3r2+tight1.1p9
> > > 22/10/02 18:12:31 Copyright (C) AT&T Laboratories Cambridge.
> > > 22/10/02 18:12:31 All Rights Reserved.
> > > 22/10/02 18:12:31 See http://www.uk.research.att.com/vnc for information on
> > > VNC
> > > 22/10/02 18:12:31 Desktop name 'x11' (srv:8)
> > > 22/10/02 18:12:31 Protocol version supported 3.3
> > > 22/10/02 18:12:31 Listening for VNC connections on TCP port 5908
> > > -------
> > > As you can see, the log is empty (no connections were made to this Xvnc).
> > > It started eating all CPU on oct 31 between 21:30 and 21:40 (I'm using
> > > reports provided by sar(1)).
> >
> > I'm sorry, I forgot to add that I changed the system time (increaded by 5
> > minutes) on Oct 31 21:36. So it seems Xvnc began eating all CPU
> > almost immedeately..
> >
> > Best regards,
> > -Vlad
> >
>
> Yesterday RedHat released updates to the XFree86 package for RH7.x and Rh8,
> which had the following among the list of problems fixed:
> {{
> - - Fix a long standing problem in the X server where the mouse, keyboard, or
> video would hang, or the server to go into an endless loop whenever the
> system time was changed backwards
> }}
> It fully matches symptoms I've witnessed.
>
> After inspecting that source package for XFree, it turned out that:
>
> Description of the problem can be found at:
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=63509
>
> The patch that fixes this problem is rather short, and I've attached it.
>
> What do you think about it?
>
> Could developers please review it, try to apply, and ideally make a new
> release of Xvnc?
>
> --
> Best regards,
> -Vlad
> This patch for 4.2.1, guarantees time atomicity in GetTimeInMillis() which should
> prevent time skew from crashing the X server. <[EMAIL PROTECTED]>
>
> --- xc/programs/Xserver/hw/xfree86/common/xf86Io.c:3.49 Fri May 31 14:45:58
> 2002
> +++ xc/programs/Xserver/hw/xfree86/common/xf86Io.c Mon Sep 16 14:05:46 2002
> @@ -400,25 +400,20 @@
> {
> struct timeval tp;
> register CARD32 val;
> + register INT32 diff;
> static CARD32 oldval = 0;
> - static CARD32 skew = 0;
> + static CARD32 time = 0;
>
> gettimeofday(&tp, 0);
> - val = (tp.tv_sec * 1000) + (tp.tv_usec / 1000) + skew;
> - /* On some systems the clock is not monothonic */
> - if ((val < oldval) && ((oldval - val) < HALFMONTH)) {
> - /* if clock is not monothonic find out clock skew skew */
> - xf86MsgVerb(X_WARNING,4,"System time not monotonic!\n");
> - skew += oldval - val;
> - val = (tp.tv_sec * 1000) + (tp.tv_usec / 1000) + skew;
> - } else if (skew && ((val - oldval) < HALFMONTH)) {
> - /* try to reduce skew */
> - INT32 diff = skew - (val - oldval);
> - skew = diff < 0 ? 0 : diff;
> - val = (tp.tv_sec * 1000) + (tp.tv_usec / 1000) + skew;
> + val = (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
> + if (oldval) {
> + diff = val - oldval;
> + if (diff > 0)
> + time += diff;
> }
> oldval = val;
> - return val;
> +
> + return time;
> }
> #endif /* DDXTIME && !QNX4 */
> _______________________________________________
> VNC-List mailing list
> [EMAIL PROTECTED]
> To remove yourself from the list visit:
> http://www.realvnc.com/mailman/listinfo/vnc-list
>
> ----- End forwarded message -----
> _______________________________________________
> VNC-List mailing list
> [EMAIL PROTECTED]
> To remove yourself from the list visit:
> http://www.realvnc.com/mailman/listinfo/vnc-list
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list