[ubuntu-x] Heisenbug in xserver-xorg-input-synaptics

Chase Douglas chase.douglas at canonical.com
Sat Jan 7 17:19:30 UTC 2012

On 01/07/2012 09:09 AM, Tormod Volden wrote:
> On Sat, Jan 7, 2012 at 5:48 PM, Chase Douglas
> <chase.douglas at canonical.com> wrote:
>> On 01/06/2012 06:05 PM, Chase Douglas wrote:
>>> Hi all,
>>> I tried to track down the bug in the X staging ppa
>>> (ppa:ubuntu-x-swat/x-staging) that causes trackpads to flip to the edge
>>> of the screen. This is what I found:
>>> In the X server when there's a relative motion event it computes an
>>> acceleration for it. You can follow the events from QueuePointerEvents()
>>> to BasicComputeAcceleration(). BasicComputeAcceleration() then calls a
>>> function pointer, which by default for the X synaptics driver calls back
>>> into the driver's SynapticsAccelerationProfile() function.
>>> If you set a breakpoint in BasicComputeAcceleration() with the condition
>>> of "result > 10000", you'll get a hit. When you continue, your pointer
>>> will flip to an edge of the screen. Generally, the value of the result
>>> variable is on the order of +<some value>e+304 or inf when this occurs.
>>> The next step is to try setting a breakpoint in
>>> SynapticsAccelerationProfile() with the condition "accelfct > 10000" on
>>> the return statement.
>>> I compiled xserver-xorg-input-synaptics with noopt, but I wasn't able to
>>> trigger the bug. Then, I compiled with the default optimizations, and
>>> the bug reappeared, but the breakpoint with the condition was never hit.
>>> I tried removing the condition, and the breakpoint worked as expected.
>>> I've sent this to both ubuntu-x and ubuntu-devel to ask if anyone has
>>> any ideas on how to debug this without getting to the level of
>>> compiler/assembly/linker debugging :).
>> Nevermind, I should have looked closer at the build log. The signature
>> of the acceleration callback changed to returning a double instead of a
>> float. This emitted a warning that I failed to see.
> Just figured this out before seeing your mail :) You will need (at least)
> http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/commit/?id=7c0361d4ec6b1f1325cb6551d0ee2e7f5cfae15b

I fixed it by merging from debian-experimental, which has all the latest
goodies from upstream git master.

> Not only the return value changed type, also the input parameters. You
> would see this in the debugger that e.g. acc was not the same inside
> BasicComputeAcceleration() as inside SynapticsAccelerationProfile().

Yeah, I really just needed another 15 mins of work on this bug, but it
was the end of the day yesterday so I just threw up my hands in
annoyance :). Thanks for looking into it for me!

-- Chase

More information about the Ubuntu-x mailing list