Bug 952221

Summary: Apple Bluetooth "Magic" Trackpad - two-finger click kills kde session
Product: [Fedora] Fedora Reporter: info <info>
Component: xorg-x11-drv-synapticsAssignee: Benjamin Tissoires <btissoir>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: btissoir, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, peter.hutterer
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-30 04:44:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of evemu-describe
none
Output of evemu-record
none
dmesg output right after kde session abort
none
Xorg.0.log.old right after kde session abort
none
Screenshot of system crash
none
Crash while two-finger clicking recorder with hid-recorder
none
Evemu reproducer for the bug none

Description info@kobaltwit.be 2013-04-15 11:51:04 UTC
Description of problem:
Starting with kernel 3.7.x, I can pretty consistently kill my kde session by performing a two-finger click on my Apple Bluetooth "Magic" Trackpad. In most cases, the I get a black screen and after a few moments the login screen is displayed again. On a few occasions, my system completely froze on a kernel oops. The latter is difficult to reproduce consistently, but it has happened more than once already.


Version-Release number of selected component (if applicable):
Most recent kernel I have tried this with and can still reproduce:
3.8.6-203.fc18.i686.PAE

How reproducible:
- killing the kde session: always
- lockup in kernel oops: sometimes

Steps to Reproduce:
1. On the gdm login screen, choose a kde session and log in
2. When fully logged in, click with two fingers on the magic trackpad
  
Actual results:
Kde session aborts immediately. A black screen appears instead and after a little while this changes to the gdm login screen. On a few occasions, I even got a kernel oops.

Expected results:
Two-finger click is normally equivalent to a right-click on a normal mouse, so that's the behaviour I would expect.

Additional info:
- This worked fine in kernel 3.6.x, and stopped working when I switched to 3.7.x or later.
- I first mentioned this issue in a comment on bug 908604. That bug mainly reported odd scrolling behaviour (also two-finger related) and was fixed recently. The two-finger click issue however still remains after the fix for the two-finger scrolling. So I decided to make it a separate bug report.

Comment 1 Benjamin Tissoires 2013-04-15 14:43:38 UTC
Thanks for opening a new bug. This seem to be a different problem than 908604.

I was not able to reproduce it with a hid recording of the magic trackpad on a fedora i386.PAE, so I will need more information from you.

Can you post the dmesg output after the kde crash, the Xorg.0.log.old and also an evemu trace of your 2 finger tap which kills kde:
http://www.freedesktop.org/wiki/Evemu

Comment 2 info@kobaltwit.be 2013-04-15 15:32:53 UTC
I am trying to generate the requested evemu trace, but I get this error:
error: this device is grabbed and I cannot record events

There is some mention of this on the freedesktop Evemu wiki page, but I'm not sure what exactly I should add where to prevent the device from being grabbed.

Can you give me some more details on how I can proceed ? Thank you.

Comment 3 Benjamin Tissoires 2013-04-15 15:47:30 UTC
> Can you give me some more details on how I can proceed ? Thank you.
>

You just need to write a file named 99-synaptics-dontgrab.conf in
/etc/X11/xorg.conf.d/ which contains:
Section "InputClass"
        Identifier "Don't grab synaptics"
        MatchDriver "synaptics"
        Option "GrabEventDevice" "off"
EndSection

then restart X, and the complain about the grab should disappear.

Comment 4 info@kobaltwit.be 2013-04-15 20:44:41 UTC
Created attachment 736041 [details]
Output of evemu-describe

Comment 5 info@kobaltwit.be 2013-04-15 20:45:14 UTC
Created attachment 736042 [details]
Output of evemu-record

Comment 6 info@kobaltwit.be 2013-04-15 20:45:57 UTC
Created attachment 736043 [details]
dmesg output right after kde session abort

Comment 7 info@kobaltwit.be 2013-04-15 20:46:32 UTC
Created attachment 736045 [details]
Xorg.0.log.old right after kde session abort

Comment 8 info@kobaltwit.be 2013-04-15 20:53:04 UTC
While I had a 100% abort rate when using kde normally, I had some more difficulties deliberately triggering the abort. That is, during normal usage I was avoiding the two-finger click because I knew it would abort my session. Each time I accidentally did use it anyway, my session aborted.

However that was not the case while I was trying to record the events during an abort. Simply two-finger clicking on the desktop nicely popped up the desktop's context menu.

After a little fiddling, I (almost) consistently could trigger the abort in two steps:
- two-finger click anywhere on the desktop background
- single finger click to discard the context menu
- right after that, two-finger click in the display folder plasmoid that is on the desktop
=> abort

The evemu-record session records exactly that. Hopefully that is sufficient for you to find the cause of these aborts.

Comment 9 Peter Hutterer 2013-04-16 08:33:13 UTC
can you check your xorg.logs for any backtrace please? the one you attached looks like one from a running session.

Comment 10 Benjamin Tissoires 2013-04-16 08:49:40 UTC
In addition to Peter's request:

I can not reproduce it on x86_64, so it's a i686 issue only.

The bug can be easily reproduced in a i686 F18 (PAE or not, even in a VM) with the two given files evemu-device.txt and evemu-record.txt: just run evemu-play and it crashes the session without backtraces nor kernel oops.

Comment 11 info@kobaltwit.be 2013-04-16 16:11:36 UTC
Created attachment 736427 [details]
Screenshot of system crash

I didn't find any backtrace in my log files.

However, today I got into this situation that allowed me to take a picture of a system crash that may be related.

While working on my PC normally, I accidentally brushed the touchpad with a second finger while clicking it. The touchpad immediately stopped responding, but the screen didn't. I could still use the spare mouse I had attached as well.

In an attempt to wake up the touchpad I clicked it (perhaps a couple of times). The next thing I got was the system crash attached here.

I don't have any evemu recordings of this unfortunately.

Note that the mouse pointer was still responding to the spare mounse (I could move it around), but that is all. I could not do a soft reboot via the keyboard. I had to use the reset button on my PC.

Hopefully this gives another hint.

Comment 12 Benjamin Tissoires 2013-04-17 07:41:54 UTC
The screenshot you gave show a bug in the hidp module, the module which drives hid devices over bluetooth. So even if it's still a kernel oops, it's not related to your primary problem. In addition, David Herrmann did a rework on the hidp module recently[1] and I hope this will fix this oops.

To go back to our bug:
- the bug is not related to kde, gnome is also crashing in the same way
- the component which is crashing is X, but it crashes silently: no backtraces and freeze of the system if startx is run from a tty.

I'd like to see the differences from the 3.6 and the 3.7 when you manage to trigger the bug.
For that, I'll need you to use hid-replay[2] to record the raw events sent by the device. However, instead of using the packages on [2], please use this scratch-build: http://koji.fedoraproject.org/koji/taskinfo?taskID=5259242
The package on [2] will not record anything from the magic trackpad.

So basically, run your current kernel (3.8.7 or 3.8.6). Record the magictrackpad HID events. Trigger the crash. If the trace is correctly recorded, I'll be able to compare the output of both 3.6 and 3.7 kernels.
If there is a doubt that some events are missing in the end, please run hid-recorder from a tty, go back to X and trigger the bug.


[1] http://article.gmane.org/gmane.linux.bluez.kernel/35137
[2] http://bentiss.github.io/hid-replay-docs/

Comment 13 info@kobaltwit.be 2013-04-19 16:30:08 UTC
Created attachment 737695 [details]
Crash while two-finger clicking recorder with hid-recorder

I have downloaded and installed the hid-recorder tool from the scratch build, installed it and started in on a separate VT.

Next I switched back to X, and made it to crash. Attached is what hid-recorder recorded. My kernel is currently 3.8.7-201.fc18.i686.PAE.

Note that I had a few clicks before it actually crashed:
I started with a two-finger click in a konsole window. This just showed me the context menu. So I single clicked to close the context menu and then had some more single clicks to hide two open windows.
The next two-finger click was on the desktop, working fine. Then I followed with a single click to hide the context menu again.
The last two-finger click was in the show folder plasma widget again, which successfully crashed the X server.

Comment 14 Benjamin Tissoires 2013-04-22 09:00:26 UTC
Thanks for the logs.

There is no difference, between 3.6 and 3.8 outputs. This comes definitively from X.

I suspect a rebuild of the package is enough to solve the problem (at least, on my virtual i386). When running under gdb, I got a stack smash in xf86-input-synaptics...

Can you give a test to the following scratch build?
http://koji.fedoraproject.org/koji/taskinfo?taskID=5286588

Comment 15 info@kobaltwit.be 2013-04-22 17:53:30 UTC
Installed xorg-x11-drv-synaptics-1.6.3-2.fc18.i686 and rebooted the system (perhaps logging out would have been sufficient).

Unfortunately, the crash still happens.

Comment 16 Benjamin Tissoires 2013-04-23 15:21:40 UTC
ok. Well, I can also reproduce it, and still did not found the cause of it.

Changing the component to xorg-x11-drv-synatics because the bugs comes from there.

Comment 17 Benjamin Tissoires 2013-04-25 16:21:58 UTC
Created attachment 739981 [details]
Evemu reproducer for the bug

Ok, I managed to get the most simple reproducer.

Actually, the problem is indeed a stack smash.
I built a new package here (you may need to use yum reinstall as I kept the same build number than the previous scratch-build):
http://koji.fedoraproject.org/koji/taskinfo?taskID=5302191

Can you please test it?

Comment 18 info@kobaltwit.be 2013-04-25 21:28:14 UTC
I have installed your most recent build.

Two finger clicking seems to work properly now. I haven't been able to make it crash again.

Good job ! Thank you.

Comment 19 Fedora Update System 2013-04-26 01:39:15 UTC
xorg-x11-drv-synaptics-1.6.3-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/xorg-x11-drv-synaptics-1.6.3-3.fc18

Comment 20 Fedora Update System 2013-04-26 01:42:21 UTC
xorg-x11-drv-synaptics-1.7.0-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/xorg-x11-drv-synaptics-1.7.0-2.fc19

Comment 21 Fedora Update System 2013-04-26 14:29:43 UTC
Package xorg-x11-drv-synaptics-1.7.0-2.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing xorg-x11-drv-synaptics-1.7.0-2.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-6689/xorg-x11-drv-synaptics-1.7.0-2.fc19
then log in and leave karma (feedback).

Comment 22 Fedora Update System 2013-04-30 04:44:08 UTC
xorg-x11-drv-synaptics-1.7.0-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2013-05-07 18:29:26 UTC
xorg-x11-drv-synaptics-1.6.3-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.