[comp.windows.x] Need help to fix error in "xlock"

jpoon@mipos2.intel.com (12/12/90)

I am a navie user of X11.  But recently I built the X11R4 
on sun386i.  When i try to run 'xlock', it gives me the 
following error:

> X Error of failed request:  BadValue (integer parameter out of range for operation)
>   Major opcode of failed request:  26 (X_GrabPointer)
>   Minor opcode of failed request:  0
>   Resource id in failed request:  0xffff
>   Serial number of failed request:  32
>   Current serial number in output stream:  32

I debug it all the way in the X11 library.  The routine is _XRead() in
file XlibInt.c.  This is the statement (line 212 in XlibInt.c) that is 
'causing' the problem:

>     while ((bytes_read = ReadFromServer(dpy->fd, data, (int)size))
>            != size) {

Apparently, variable 'bytes_read' return -1.  Subsequently, the routine
exits with the above error.  Is there any reason why the server is not 
returning any bytes?  Is the server built incorrectly?
Any expert out there has any idea?

Thanks, 
Jack Poon

palmer@GATEWAY.MITRE.ORG (12/12/90)

>  Date: 11 Dec 90 18:47:23 GMT
>  From:
bu.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!orc!inews!mipos2.intel.com!j
poon@bloom-beacon.mit.edu
>  Organization: Intel Corporation, Santa Clara, CA
>  Subject: Need help to fix error in "xlock"
>  Message-Id: <1327@inews.intel.com>
>  Sender: xpert-request@expo.lcs.mit.edu
>  To: xpert@expo.lcs.mit.edu
>  
>  I am a navie user of X11.  But recently I built the X11R4 
>  on sun386i.  When i try to run 'xlock', it gives me the 
>  following error:
>  
>  > X Error of failed request:  BadValue (integer parameter out of range for
operation)
>  >   Major opcode of failed request:  26 (X_GrabPointer)
>  >   Minor opcode of failed request:  0
>  >   Resource id in failed request:  0xffff
>  >   Serial number of failed request:  32
>  >   Current serial number in output stream:  32
>  

This is an old error. There are several places in xlock.c where the
following line is executed :

    XGrabPointer(dsp, w, True, -1,
       GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime);

The problem is the "-1" in the event_mask parameter. You should
replace this with something like :

ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
ButtonMotionMask

(This is probably overkill but you get the idea.) Check the Xlib - C
Library Manual, Chap. 7.4 on "Pointer Grabbing".

------------------------------------------------------
Forrest Palmer                        (703) 883-5668
Internet Engineering Testbed Administrator
The MITRE Corp. - Washington Center
MS W425, McLean, VA 22102

palmer@mitre.org
------------------------------------------------------

jpoon@mipos2.intel.com (12/12/90)

Thanks to all who help.  The easiest fix, suggested by
Ken Hughes, is to get the latest version/patch from 
expo.lcs.mit.edu in contrib/xlock.shar.2.1.Z.


Thanks,
Jack Poon

raja@bombay.cps.msu.edu (Narayan S. Raja) (12/12/90)

In article <1337@inews.intel.com>, jpoon@mipos2.intel.com writes:

< Thanks to all who help.  The easiest fix, suggested by
< Ken Hughes, is to get the latest version/patch from 
< expo.lcs.mit.edu in contrib/xlock.shar.2.1.Z.

Actually an even easier fix is to start
the X server with "bc" option, e.g.

  "xinit -- bc".

A similar error occurs with Allegro Common
Lisp under X11R4 and can be fixed in the
same way.


Narayan Sriranga Raja.

dave@EXPO.LCS.MIT.EDU (12/12/90)

I've never run xlock on a 386i but I think you should
look at the xlock source and figure out how XGrabPointer
is causing a protocol error.

			dave sternlicht
			dave@expo.lcs.mit.edu