Bug 31601 - Another segfault when using XTEST with XI2 master devices
Summary: Another segfault when using XTEST with XI2 master devices
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 7.5 (2009.10)
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-13 07:51 UTC by Christian Beier
Modified: 2011-05-09 08:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
X log file of occuring segfault (34.41 KB, text/plain)
2010-11-18 09:37 UTC, Christian Beier
no flags Details

Description Christian Beier 2010-11-13 07:51:45 UTC
Hi,
when injecting input via XTEST into an XI2 master device, the X server sometimes segfaults at dix/events.c:3654. The offending code is 

  if (pWin->optional && CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))

in CheckDeviceGrabs() . Adding a 'pWin &&' check solves the problem.

Happens on Ubuntu 10.10 with X server 1.9. I hope that's enough info, but I can provide X log and backtrace if needed...

Cheers,
   Christian
Comment 1 Christian Beier 2010-11-18 09:37:49 UTC
Created attachment 40391 [details]
X log file of occuring segfault

Okay, seems rather hard to reproduce. What i have is VCP, VCK as normal plus some XI2 MD pairs without any slave devices (that is, only the XTEST ones). I'm injecting fake motion, button and key events.

$ addr2line -e /usr/bin/X 0x807ae75
/build/buildd/xorg-server-1.9.0/build-main/dix/../../dix/events.c:3654

Let's see if I manage to get a backtrace as well...
Comment 2 Peter Hutterer 2010-11-18 19:46:43 UTC
do you have the source for the program you use to inject events available?
Comment 3 Christian Beier 2010-11-19 03:42:24 UTC
Yeah here it is -> https://github.com/bk138/x11vnc-multiptr. 
Build with 

./autogen.sh --with-x11vnc --disable-shared && make

Start with 

x11vnc/x11vnc -multiptr -shared

Connect with your favourite VNC viewer.

Still, I'm not sure how to reproduce this reliably...


PS: 
The actual cmdline args I use are

-shared -forever -mdns -multiptr -nowait_bog -pointer_mode 4 -threads -afteraccept setcursor_helper -extra_fbur 10 -setdefer 2 -nonap

which mainly enable multithreading and do some tuning. 

What may be of interest here is that I use a rather hacky approach to _always_ show a labeled cursor (this is this setcursor_helper thingy started above when a client connects). It's source is here -> https://github.com/bk138/x11vnc-multiptr/blob/multiptr/x11vnc/misc/xi2setcursor.c. Maybe there's a cleaner solution...
Comment 4 Peter Hutterer 2010-12-07 16:24:40 UTC
(In reply to comment #3)
> Yeah here it is -> https://github.com/bk138/x11vnc-multiptr. 
> Build with 
> 
> ./autogen.sh --with-x11vnc --disable-shared && make

gave up after battling with build errors for 15 min, sorry.
Comment 5 Christian Beier 2010-12-08 04:24:05 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Yeah here it is -> https://github.com/bk138/x11vnc-multiptr. 
> > Build with 
> > 
> > ./autogen.sh --with-x11vnc --disable-shared && make
> 
> gave up after battling with build errors for 15 min, sorry.

hmm, builds fine here (debian squeeze box). and now? shall i provide a binary? anyway, i'll try to find a way to reproduce this reliably in the next days and post the procedure here...
Comment 6 Christian Beier 2011-05-09 08:21:38 UTC
As the offending lines don' exist anymore in the XServer 1.10 code (by commit http://cgit.freedesktop.org/xorg/xserver/commit/?id=1c1811ecafc144151630b3588394e2c345c53aa4), this bug can be closed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.