evtouch driver lockups

Adam Jackson ajax at nwnk.net
Mon Nov 2 08:43:42 PST 2009

On Mon, 2009-11-02 at 18:07 +0300, Alexander Sabourenkov wrote:
> Hello.
> I'm seeing Xorg lock up (sleep in futex) during stress-testing touchscreens - that 
> consists of many touches in quick succession, where each touch makes something be 
> redrawn.
> Backtraces are identical in upper part - the signal handler, and differ in the 
> lower part, that is from frame 11 onwards, but it's always something to do with 
> malloc/free. See the example backtrace below.
> As far as I understand, one should not do any memory allocation/deallocation or, 
> more generally, anything that might be protected with locks, in a signal handler.
> Now, my question is: how do I fix that?

Don't call TimerFree from DoBtnAction, clearly.  Use TimerCancel to
disable the middle-button emulation timer instead.  You need not even
free the timer until device close; the next call to TimerSet in
EVTouchLBRBEvent will just reuse the existing allocation.

Of course it should be noted that that TimerSet is _also_ broken, since
it mallocs and it's called from ReadInput, which (as shown in the
backtrace) is called from the signal handler.  So you'll also want to do
something like evdev does:


All of which just underlines "use evdev already" I suppose.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20091102/3f3b4dcc/attachment.pgp 

More information about the xorg-devel mailing list