This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

More notes on client exit causing 100% cpu usage


When I type 'exit' in an xterm window I have about a 15% chance that xterm
will enter and infinite loop and take all available cpu resources.  At this
time the xterm window is still displayed in Cygwin/XFree86, but it is not
being drawn correctly; X still responds fine, albeit a bit sluggishly, as
xterm is eating the available cpu cycles.

When xterm exits and closes normally I get a series of client requests that
fail, though xterm does end up closing eventually.  When xterm uses 100% of
the cpu time I get no messages; however, when I "destroy" the window, I get
slightly different series of operations that cause errors.  Below is
information about the operations that fail.

1) Normal xterm 'exit' - this series of failures is seen infrequently.
Major Opcode	Result of op	client->errorValue
------------	------------	------------------
40			3			2,097,166
3			3			4,194,362
14			9			4,194,362
3			3			4,194,361
14			9			4,194,361

2) Normal xterm 'exit' - this series of failures is seen most of the time.
Major Opcode	Result of op	client->errorValue
------------	------------	------------------
40			3			2,097,166
42			3			2,097,166
3			3			4,194,380
14			9			4,194,380

3) No failed requests are generated when an xterm 'exit' causes xterm to
enter an infinite loop.

4) When I 'destroy' an xterm window that has entered an infinite loop, I get
the following failed operations:
Major Opcode	Result of op	client->errorValue
------------	------------	------------------
40			3			2,097,166
3			3			4,194,391
14			9			4,194,391
3			3			4,194,391
14			9			4,194,391
3			3			4,194,394
14			9			4,194,394
3			3			4,194,390
14			9			4,194,390
3			3			4,194,390
14			9			4,194,390
3			3			4,194,390
14			9			4,194,390
At this point the xterm window disappears and the Xserver resumes normal
operations; cpu usages returns to normal, and the xterm process is
terminated.

How to read these tables
-----------------------------
1) Look up the major opcode in Xproto.h (eg. 40 == X_TranslateCoords)
2) Look up the result of op in X.h (eg. 3 == BadWindow)
3) Look for information on the xterm errorValue;
	I do not currently know where to find this information,
	but perhaps you could check the xterm headers in
	the XFree86 cvs tree.

What to do with this data
-------------------------
1) Research, research, research.  We need to know whether
	this has happened to other OS ports of XFree86,
	and whether there is a common mistake that
	causes this problem.
2) Look at os/WaitFor.c and dix/dispatch.c; look for
	typos, logical mistakes, something that would
	cause operations to be processed out of order.
3) Anything else you can think of :)

Set forth! :)

Harold


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]