答复: 答复: Help! Xlib error

Ma, Qingyu (GE Healthcare) Qingyu.Ma at ge.com
Thu May 6 06:55:52 PDT 2010


Hi Peter,

You are quite right. The issue is caused by XTestFakeKeyEvent. 
Now, I can reproduce the issue with about 20 minutes execution. And, till now, 90% of crash message is the same with #1 (the number and server name is different). Bad length issue occurred only two more times.

I found a case which can cause XTestFakeKeyEvent crash, that is multi thread invoke XTestFakeKeyEvent in parallel. I guess XTestFakeKeyEvent doesn't support intercurrent protect.

Is there other cases that may cause XTestFakeKeyEvent crash? Is it a Xlib bug? If yes, is there any patch to resolve it?


Best Regards,
Ma Qingyu

-----邮件原件-----
发件人: Peter Hutterer [mailto:peter.hutterer at who-t.net] 
发送时间: 2010年5月6日 8:55
收件人: Ma, Qingyu (GE Healthcare)
抄送: xorg at lists.freedesktop.org
主题: Re: 答复: Help! Xlib error

On Thu, May 06, 2010 at 08:50:09AM +0800, Ma, Qingyu (GE Healthcare) wrote:
> Because my application is huge, and I'm not quite sure  which part cause this issue.
> I'm trying to reduce the range, but it's difficult to reproduce the issue. 
> During the long time run,  two kinds of operation related with Xserver are executed in the loop, one is openGL operation, another is faking key event to control key LED.
> Could you please give me some direction that which part may cause the issue?

Looks like the invocation of XTestFakeKeyEvent or a similar XTest function causes it, so narrowing down to those functions would be the start.
You might be able to knock up a simple reproducer based on the data you provide in your app.

Bad length means that the length field of the request is invalid. Since that is set in Xlib, this simply means that the calculation is off. Now, you could sniff the protocol and check the length field for all XTestFakeInput requests (man xscope), but finding a reproducer is probably more useful.

Cheers,
  Peter

> -----邮件原件-----
> 发件人: Peter Hutterer [mailto:peter.hutterer at who-t.net]
> 发送时间: 2010年5月5日 19:39
> 收件人: Ma, Qingyu (GE Healthcare)
> 抄送: xorg at lists.freedesktop.org
> 主题: Re: Help! Xlib error
> 
> On Wed, May 05, 2010 at 04:16:02PM +0800, Ma, Qingyu (GE Healthcare) wrote:
> > My application use openGL to draw some image on window, and modify 
> > led state on keyboard through faking key event. The operations are 
> > executed at 33ms interval.
> > If I add some system pressure, after long time execution, there is a 
> > rare possibility to occur below two errors.
> >  
> > #1
> > XIO: fatal IO error 0 (Success ) on X server "-"
> >        after 21 requests (9 known processed) with 0 event remaining.
> >  
> > #2
> > X Error of failed request:  BadLength (poly request too large or 
> > internal Xlib length error)
> >   Major opcode of failed request:  148 (XTEST)
> >   Minor opcode of failed request:  2 (X_XTestFakeInput)
> >   Serial number of failed request:  16
> >   Current serial number in output stream:  20 X Error of failed request:
> > BadLength (poly request too large or internal Xlib length error)
> >   Major opcode of failed request:  148 (XTEST)
> >   Minor opcode of failed request:  2 (X_XTestFakeInput)
> >   Serial number of failed request:  15
> >   Current serial number in output stream:  20
> >  
> >  
> > I didn't find any clue in Xorg.0.log and message log.
> > The system pressure is, Mem: 40MB free and 500MB swap is used, CPU: 
> > 95%, continuous disk writing, opengl demo(moving gear).
> >  
> > Could you please tell me what may cause these two errors?  It's urgent.
> > Thanks very much.
> 
> hmm. BadLength is usually a server or an Xlib bug. Can you provide the code that reproduces this issue?
> 
> Cheers,
>   Peter
> 



More information about the xorg mailing list