[comp.windows.x] X protocol errors message interpretation?

gteo@swift.cs.tcd.ie (02/16/90)

Version: R3
Client Machine and Operating System:
	Sun 3/60 C, SunOS 3.5
Display  Type:
	Sun cgfour, MIT R3 sample server
Window Manager: uwm
Area: X protocol

Description:
	I tried to run a program on the above environment, the main window
appears and then clashes. The following error message was given:

  X protocol error: BadIDchoice, invalid resource ID chosen for this connection.
  Major opcode of failed request: 1 (X_CreateWindow)
  Minor opcode of failed request: 0
  Resource id in failed request: 0x16e0169
  Serial number of failed request: 87
  Current serial number in output stream: 93

Can someone tell me where I can find what each of these mean, please?

The same program runs properly when I send it to another server on a DECstation 
3100. The  Sun has 8M of RAM and about 30M of swap space whereas the DECstation
has 16M of RAM with about 100M of swap space.

	Thanks in advace.

Ghee Teo

erik@srava.sra.co.jp (Erik M. van der Poel) (02/16/90)

In article <6846.25dae293@swift.cs.tcd.ie> gteo@swift.cs.tcd.ie writes:
> X protocol error: BadIDchoice, invalid resource ID chosen for this connection

If you look up BadIDChoice in the Xlib document, you will find that it
is an error that cannot normally occur. A colleague of mine bumped
into this error and found that a call to setitimer() caused it. This
function causes a signal to be delivered to the program, and if this
happens in the middle of an Xlib operation, Xlib can get confused.

Try looking for `setitimer' or `SIG' in the program sources.

If you do find a setitimer() you should probably consider re-coding it
to use XtAppAddTimeOut().
-- 
Erik M. van der Poel                  erik@sra.co.jp             (Japan)
SRA, 1-1-1 Hirakawa-cho, Chiyoda-ku   erik%sra.co.jp@uunet.uu.net  (USA)
Tokyo 102 Japan. TEL +81-3-234-2692   erik%sra.co.jp@mcvax.uucp (Europe)

klee@wsl.dec.com (Ken Lee) (02/17/90)

In article <6846.25dae293@swift.cs.tcd.ie>, gteo@swift.cs.tcd.ie writes:
>   X protocol error: BadIDchoice, invalid resource ID chosen for this
connection.
>   Major opcode of failed request: 1 (X_CreateWindow)
>   Minor opcode of failed request: 0
>   Resource id in failed request: 0x16e0169
>   Serial number of failed request: 87
>   Current serial number in output stream: 93
> 
> Can someone tell me where I can find what each of these mean, please?

Does this always happen?  The IDchoice error is possibly a bug in your
Xlib.  Typically, only the first 2 lines of the error message are
useful.  You can find descriptions of the errors on p. 350-351 of
Scheifler's DP book and in the descriptions of the various Xlib
functions.  The other error data is discussed on p. 346.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee

converse@EXPO.LCS.MIT.EDU (Donna Converse) (02/17/90)

> Can someone tell me where I can find what each of these mean, please?

>   X protocol error: BadIDchoice, invalid resource ID chosen for this connection.

	In the protocol section within "X Window System - C Library and Protocol 
	Reference" by Scheifler	Gettys and Newman, or in your X protocol 
	documentation which accompanies	the release, see the section on Errors for
	a description of the IDChoice error.  The definition of an X resource is
	given in the glossary.

>   Major opcode of failed request: 1 (X_CreateWindow)

	The protocol request which generated the error message is given here.
	A discussion of the protocol request is in the section on Requests,
	and in Appendix A of the above book there is a table which shows which
	protocol requests are generated by wich Xlib functions, so that you can 
	correlate the request to an Xlib function call.

	I can tell you now that the problem occured in an argument to 
	XCreateSimpleWindow or XCreateWindow which was either a window, a 
	pixmap, a cursor, or a colormap.  

>   Minor opcode of failed request: 0

	Not very interesting, since this is not an extension.  The role of the
	minor opcode is mentioned in the protocol document, the section on
	Protocol Formats.

>   Resource id in failed request: 0x16e0169

	Not all protocol errors return resource IDs, but this one does.  This
	is the invalid resource ID.

>   Serial number of failed request: 87
	
	The 87th request sent to the server is the one that failed.

>   Current serial number in output stream: 93

	The 93rd request to the server has already been made (but not serviced).

You can figure all this stuff out using the table of contents, the index,
and the glossary.  

Donna Converse
converse@expo.lcs.mit.edu