On 30/10/2009 13:48, Ken Brown wrote:
I'm having trouble with checkX. I haven't seen other people complain
about this, so I assume it's something about my system, but I can't
figure out what. There are two symptoms:
1. If I run checkX with a timeout, the timeout seems to be ignored. For
example, with the X server *not* running:
$ checkX -d 127.0.0.1:0.0 -t 100 --debug
checkX.exe DEBUG: displayname : '127.0.0.1:0.0'
checkX.exe DEBUG: opt_location: 0
checkX.exe DEBUG: opt_loglevel: 7
checkX.exe DEBUG: opt_nogui : 0
checkX.exe DEBUG: opt_notty : 0
checkX.exe DEBUG: opt_timeout : 100.00
checkX.exe DEBUG: (adjust_path) path is :
/usr/local/texlive/2009/bin/i386-cygwin:/usr/local/bin:/usr/bin:/c/Program
Files/ThinkPad/Utilities:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program
Files/Intel/Wireless/Bin/:/c/Program Files/IBM ThinkVantage/Client
Security Solution:/c/Program Files/ThinkPad/ConnectUtilities:/c/Program
Files/QuickTime/QTSystem/:/c/Program Files/Common
Files/Lenovo:/usr/lib/lapack:/usr/X11R6/bin:/usr/bin
checkX.exe DEBUG: (find_X11_lib) DLL is /usr/bin/cygX11-6.dll
checkX.exe DEBUG: (dlopen_X11_lib) /usr/bin/cygX11-6.dll dlopen'ed
successfully.
checkX.exe DEBUG: (load_X11_symbols) symbol XOpenDisplay loaded ok
checkX.exe DEBUG: (load_X11_symbols) symbol XCloseDisplay loaded ok
checkX.exe DEBUG: (try_with_timeout) Using delay of 100 secs, 0 nanosecs
(100.00)
checkX.exe DEBUG: (try_with_timeout) xserver search was unsuccessful
checkX.exe Info: could not open X display '127.0.0.1:0.0'
checkX.exe DEBUG: returning with status 1
checkX.exe Info: Exiting with status 1
The problem is that it returns within a second, in spite of the timeout.
Or am I misunderstanding what the timeout is supposed to do?
I think this is a misunderstanding here.
Looking at the source, the timeout is the maximum time checkX will wait for an
XOpenDisplay() to complete. If that fails immediately (e.g. due to with
ECONNREFUSED), checkX will stop immediately.
This is pretty reasonable. If there is nothing listening on the socket for the
X server, that is not going to get better if we wait...
... except if the server happens to be starting up when we execute checkX.
So, this is not quite what startxwin.bat requires, as the server may still be
in the process of starting up. Fortunately, the X server binds it's socket
pretty early in the startup, so this probably works pretty well, but in theory
at least there is still a possible timing window in startxwin.bat.
So it perhaps be useful if checkX retried the XOpenDisplay() periodically
until the timeout was up (as xinit does)
2. If I start the X server by using the default startxwin.bat or
startxwin.sh (both of which call checkX), the server is very unstable
and crashes within a few minutes. This happens consistently, and it
never happens if I comment out the line calling checkX.
I think I was able to reproduce this problem (it is not how I normally start
the X server)
However, now I come back to look at this in detail, the problem no longer
seems to exist. Are you still able to demonstrate it?
I tried strace'ing checkX, but I don't know what to look for in the
output. (I'll send it if it would be useful, but I don't want to spam
the list otherwise.) I'm attaching cygcheck output.
--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/