Hello.
My coworkers and I regularly use the -query option to 'vncserver'.
Unfortunately after the server has been up and running for a long time
our session is disconnected and the Xvnc dies.
I have been asking around and I was pointed to the following
X11/XFree86 bug report which has been fixed for a little while now.
I checked the file in question in the vnc-3.3.7-unixsrc.tgz and it
appears that this bug still exists in RealVNC.
Is it possible to get this incoporated into a future release of
RealVNC?
Thanks,
-Kyle
--
_
-------------------------------ooO( )Ooo-------------------------------
Kyle J. McDonald (o o) Systems Support Engineer
Sun Microsystems Inc. |||||
Enterprise Server Products [EMAIL PROTECTED]
1 Network Drive BUR03-4630 \\\// voice: (781) 442-2184
Burlington, MA 01803 (o o) fax: (781) 442-1542
-------------------------------ooO(_)Ooo-------------------------------
Received: from phys-d3-ha21sca-1 (phys-d3-ha21sca-1.SFBay.Sun.COM
[129.145.155.163]) by josie.East.Sun.COM
(8.11.7p1+Sun/8.11.7/ENSMAIL,v2.2) with ESMTP id hALNxPm28600 for
<@josie.East.sun.com:[EMAIL PROTECTED]>; Fri, 21 Nov 2003 18:59:25
-0500 (EST)
Received: from Sun.COM (almas.SFBay.Sun.COM [129.145.23.120]) by
ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.16
(built May 14 2003)) with ESMTP id
<[EMAIL PROTECTED]> for [EMAIL PROTECTED]
(ORCPT [EMAIL PROTECTED]); Fri, 21 Nov 2003 15:59:24 -0800 (PST)
Date: Fri, 21 Nov 2003 15:59:24 -0800
From: Alan Coopersmith <[EMAIL PROTECTED]>
Subject: [Fwd: Xserver: overflow condition in XdmcpWakeupHandler()]
To: [EMAIL PROTECTED]
Message-id: <[EMAIL PROTECTED]>
Organization: Sun Microsystems
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: en-us, en
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.2.1)
Gecko/20030711
-------- Original Message --------
Subject: Xserver: overflow condition in XdmcpWakeupHandler()
Resent-Date: 21 Feb 2002 11:07:00 -0000
Resent-From: [EMAIL PROTECTED]
Resent-To: [EMAIL PROTECTED]
Date: Thu, 21 Feb 2002 02:47:18 -0700 (MST)
From: Paul Anderson <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Xserver: rollover condition in XdmcpWakeupHandler()
VERSION:
X.Org: R6.6
XFree86: Current 4.2 CVS tree as of 18-Feb-2002
CLIENT MACHINE and OPERATING SYSTEM:
HP-UX
DISPLAY TYPE:
N/A
WINDOW MANAGER:
N/A
COMPILER:
ANSI cc on HP-UX
Others?
AREA:
Xserver
SYNOPSIS:
It looks like there is a rollover condition in
xc/programs/Xserver/os/xdmcp.c:XdmcpWakeupHandler()
which can cause XDM sessions to be terminated.
DESCRIPTION:
The XDMCP code calculates its timeout time incorrectly
when the time wraps from 0xffffffff to 0x00000000.
The routine XdmcpWakeupHandler() currently has the following
comparison in its 'else if' condition:
else if (timeOutTime && GetTimeInMillis() >= timeOutTime)
{
if (state == XDM_RUN_SESSION)
{
state = XDM_KEEPALIVE;
send_packet();
}
else
timeout();
}
A problem with this test occurs when we wrap back to 0 every 49+
days. When this occurs, Xservers with active XDMCP sessions
will send XDM_KEEPALIVE messages to the XDMCP host continually
for ~3 minutes. If the host computer cannot reply to all of the
keep-alive messages in time, the Xservers seem to assume that the
host is dead, and the server terminates any XDM sessions.
Whether or not the session is closed will depend on the network
load, etc.
If the test in the 'else if' branch is changed from:
else if (timeOutTime && GetTimeInMillis() >= timeOutTime)
to:
else if (timeOutTime && (int)(GetTimeInMillis() - timeOutTime) >= 0)
the problem is avoided. As a result, the XDM_KEEPALIVE
sessions aren't sent continuously.
REPEAT BY:
You could wait the 49+ days for the rollover to occur. Or
the following sample program indicates the differences
in the two comparisons used in the 'else if' branch.
This might not reconstruct the problem exactly, but it
should indicate whether or not a compiler generates
code that will hit the problem.
#include <stdio.h>
#include <stdlib.h>
unsigned int timeOutTime, GetTimeInMillis, GetTimeInSec;
int millis;
main()
{
int test1, test2, timeOut;
int n; int days;
/* Start with time of day close to the value where
* (time_of_day_in_sec*1000) overflows an unsigned int.
*/
GetTimeInSec = 49*24*3600 + 16*3600; /* 49 days, 16 hours*/
GetTimeInMillis = 0;
millis = 0;
timeOut = 2; /* Always set time out to 2 millisec */
timeOutTime = GetTimeInMillis + timeOut;
n = 0;
for (;;)
{
test1=0;
test2=0;
if (timeOutTime && GetTimeInMillis >= timeOutTime) {
/* timeOutTime should always be > GetTimeInMillis */
test1 = 1;
}
if (timeOutTime && (int)(GetTimeInMillis-timeOutTime) >= 0 ) {
/* timeOutTime should always be > GetTimeInMillis */
test2 = 1;
}
if(test1!=0 || test2!=0) {
printf("test1 = %d, test2 = %d\n", test1, test2);
if(test1!=0) {
printf("Test1 failed when time = %d sec and %d millisec\n",
GetTimeInSec, millis);
}
if(test2!=0) {
printf("Test2 failed when time = %d sec and %d millisec\n",
GetTimeInSec, millis);
}
printf("GetTimeInSec*1000 = 0x%x\n", GetTimeInSec*1000);
printf("GetTimeInMillis = 0x%x\n", GetTimeInMillis);
printf("timeOutTime = 0x%x\n", timeOutTime);
exit(1);
}
millis = millis +1;
if(millis == 1000) {
GetTimeInSec = GetTimeInSec + 1;
millis = 0;
}
GetTimeInMillis = GetTimeInSec*1000 + millis;
timeOutTime = GetTimeInMillis + timeOut;
n++;
if(n==0x100000) {
n=0;
printf("%x %x\n", GetTimeInMillis, timeOutTime);
}
}
}
Under HP-UX, the following output occurs:
ffd68400 ffd68402
ffe68400 ffe68402
fff68400 fff68402
test1 = 1, test2 = 0
Test1 failed when time = 4294967 sec and 295 millisec
GetTimeInSec*1000 = 0xfffffed8
GetTimeInMillis = 0xffffffff
timeOutTime = 0x1
This indicates that the two calculations differ every 4294967.295 sec.
This should be verified on other OSes and other compilers to
see how general a problem this is.
SAMPLE FIX:
The following diff is against the xdmcp.c file found in
the XFree86 4.2.0 release:
$ diff -c xdmcp.c.v4.2 xdmcp.c.fix
*** xdmcp.c.v4.2 Tue Feb 19 01:21:03 2002
--- xdmcp.c.fix Tue Feb 19 01:21:46 2002
***************
*** 726,732 ****
if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION)
timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000;
}
! else if (timeOutTime && GetTimeInMillis() >= timeOutTime)
{
if (state == XDM_RUN_SESSION)
{
--- 726,732 ----
if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION)
timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000;
}
! else if (timeOutTime && (int)(GetTimeInMillis() - timeOutTime) >= 0)
{
if (state == XDM_RUN_SESSION)
{
Please feel free to contact me with any questions.
-paul
--
Paul Anderson
Hewlett Packard Voice: (970)898-4086
3404 E. Harmony Road, MS-74 FAX: (970)898-6649
Fort Collins, CO 80528-9599 E-mail: [EMAIL PROTECTED]
--
-Alan Coopersmith- [EMAIL PROTECTED]
Sun Microsystems, Inc. - Sun Software Group
User Experience Engineering: G11N: X Window System
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list