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:

http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/commit/?id=ddc126637404cb3d9356b7698779dcd8849f8718

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

- ajax

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to