Bug 94801 - Floating point exception starting X server with AlpsPS/2 touchpad
Summary: Floating point exception starting X server with AlpsPS/2 touchpad
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 15:42 UTC by Santiago Gala
Modified: 2015-04-07 23:39 UTC (History)
5 users (show)

See Also:
Kernel Version: 4.0-rc3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
results of evemu-describe for first found device (1.25 KB, text/plain)
2015-03-17 21:49 UTC, Santiago Gala
Details
results of evemu-describe for second found device (2.38 KB, text/plain)
2015-03-17 21:49 UTC, Santiago Gala
Details
stick (non hardware) device with 3.19.1 (1.22 KB, text/plain)
2015-03-18 06:24 UTC, Santiago Gala
Details
working Touchpad device (kernel 3.19.1) (2.40 KB, text/plain)
2015-03-18 06:25 UTC, Santiago Gala
Details
dmesg for working kernel (102.25 KB, text/plain)
2015-03-18 06:50 UTC, Santiago Gala
Details
dmesg for non-working kernel (86.74 KB, text/plain)
2015-03-18 06:50 UTC, Santiago Gala
Details
lsinput-3.19.1.txt (working) (2.40 KB, text/plain)
2015-03-18 06:51 UTC, Santiago Gala
Details
lsinput-4.0.0-rc3.txt (non working) (2.59 KB, text/plain)
2015-03-18 06:51 UTC, Santiago Gala
Details

Description Santiago Gala 2015-03-12 15:42:51 UTC
I installed linux kernel from packages at http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc3-vivid/ on a Ubuntu 14.10 machine.

This machine was working perfectly with the packages at http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.1-vivid/

The distribution packages show a failure of the trackpad, that appears as a plain mouse and thus does not have support for the trackpad features.

With 4.0-rc3 the console mouse works perfectly, but on startx I get the following error:

(EE) 
(EE) Backtrace:
(EE) 0: /usr/bin/X (xorg_backtrace+0x56) [0x7fa849579f76]
(EE) 1: /usr/bin/X (0x7fa8493c3000+0x1bb179) [0x7fa84957e179]
(EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (0x7fa8470f8000+0x36eb0) [0x7fa84712eeb0
]
(EE) 3: /usr/lib/xorg/modules/input/synaptics_drv.so (0x7fa83a137000+0xd8e6) [0x
7fa83a1448e6]
(EE) 4: /usr/lib/xorg/modules/input/synaptics_drv.so (0x7fa83a137000+0x7f96) [0x7fa83a13ef96]
(EE) 5: /usr/bin/X (0x7fa8493c3000+0xa4c78) [0x7fa849467c78]
(EE) 6: /usr/bin/X (0x7fa8493c3000+0xbb8e9) [0x7fa84947e8e9]
(EE) 7: /usr/bin/X (0x7fa8493c3000+0xbbe63) [0x7fa84947ee63]
(EE) 8: /usr/bin/X (config_init+0x9) [0x7fa84947d8f9]
(EE) 9: /usr/bin/X (InitInput+0xbb) [0x7fa84945b42b]
(EE) 10: /usr/bin/X (0x7fa8493c3000+0x5b6c9) [0x7fa84941e6c9]
(EE) 11: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf5) [0x7fa847119ec5]
(EE) 12: /usr/bin/X (0x7fa8493c3000+0x45a8e) [0x7fa849408a8e]
(EE) 
(EE) Floating point exception at address 0x7fa83a1448e6
(EE) 
Fatal server error:
(EE) Caught signal 8 (Floating point exception). Server aborting
(EE)
Comment 1 Dmitry Torokhov 2015-03-12 21:32:25 UTC
Here are the changes that went into 4.0-rc3:

ef47fa5 Input: ALPS - move v7 packet info to Documentation and v6 packet info
626b9da Input: ALPS - fix confusing comment in protocol data
04aae28 Input: ALPS - do not mix trackstick and external PS/2 mouse data
a09221e Input: ALPS - fix trackstick detection on some Dell Latitudes
3296f71 Input: ALPS - consolidate setting protocol parameters
8326bb5 Input: ALPS - split protocol data from model info
fb2dd7a Input: ALPS - make Rushmore a separate protocol
d7c13d3 Input: ALPS - renumber protocol numbers

Can you try revering them, especially 04aae28?
Comment 2 Peter Hutterer 2015-03-13 01:50:52 UTC
evtest or evemu-describe output would be useful to have too, that should hint at why synaptics crashes (division by zero? rough guess would be some resolution setting is messed up then).
Comment 3 Santiago Gala 2015-03-17 21:49:08 UTC
Created attachment 170941 [details]
results of evemu-describe for first found device
Comment 4 Santiago Gala 2015-03-17 21:49:42 UTC
Created attachment 170951 [details]
results of evemu-describe for second found device
Comment 5 Santiago Gala 2015-03-17 21:51:50 UTC
Re: trying to revert changes, it is not so easy for me to generate a kernel, I'm usually using the Ubuntu mainline packages and this machine has a tiny SSD storage almost full...

OTOH, it was easy to run evemu-describe on the devices. The main difference I see is that the driver was creating just one device with 3.19.1, like:

/dev/input/event6:	AlpsPS/2 ALPS DualPoint TouchPad

while now it creates two:

/dev/input/event11:	AlpsPS/2 ALPS DualPoint Stick
/dev/input/event12:	AlpsPS/2 ALPS DualPoint TouchPad

I have attached the result of running evemu-describe for both

Please tell me if there is a simple way (like using dkms) to build the module for testing
Comment 6 Pali Rohár 2015-03-17 22:07:26 UTC
Older kernels create device with name "DualPoint Stick". New kernel use name "AlpsPS/2 ALPS DualPoint Stick". So please double check for names.

If you have laptop with both Trackstick and Touchpad, you should have two input devices (one Stick and one TouchPad).
Comment 7 Santiago Gala 2015-03-17 22:42:32 UTC
The one from 3.19.1 (deb at http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.1-vivid/ ) has the message I posted, double checked now. Not sure of the patches it includes. This is the working one. The one with the two devices, coming from 4.0.0-rc3, does not work, as reported.
Comment 8 Santiago Gala 2015-03-17 22:49:03 UTC
Sorry, I missed the second part of the comment. The laptop has only Touchpad, and only Touchpad is reported under 3.19.1 But under 4.0.0-rc3 it reports both non-existant Stick and Touchpad.
Comment 9 Pali Rohár 2015-03-17 22:54:00 UTC
Thanks for info! Can you share also your laptop model and output from command sudo lsinput ?
Comment 10 Pali Rohár 2015-03-17 23:03:04 UTC
@Dmitry Torokhov: Maybe we are seeing problem with "redundant" input device which I mentioned in our patch review? http://www.spinics.net/lists/linux-input/msg36335.html

@Santiago Gala: Can you also provide full dmesg output from both working and non working kernel?
Comment 11 Peter Hutterer 2015-03-18 00:21:03 UTC
#     Event code 1 (ABS_Y)
#       Value   1302
#       Min        0
#       Max        0
#       Fuzz       0
#       Flat       0
#       Resolution 0

that can't be right, and is where the synaptics crash comes from. it does divisions by (max - min) which is 0 here. The X axis looks suspicious as well: resolution of 4 with a max of 448? could be right, but sounds like specs fresh from the 90s.

either way, check those patches for anything that changes the absinfo struct for the touchpad and you've got the culprit.
Comment 12 Santiago Gala 2015-03-18 06:24:05 UTC
(In reply to Santiago Gala from comment #7)
> The one from 3.19.1 (deb at
> http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.1-vivid/ ) has the
> message I posted, double checked now. Not sure of the patches it includes.
> This is the working one. The one with the two devices, coming from
> 4.0.0-rc3, does not work, as reported.

Sorry, I'm a bit dislexic; misunderstood what I needed to double check and thus double checked the wrong thing. 

There are also two devices in the 3.19.1 kernel:

/dev/input/event5:	DualPoint Stick
/dev/input/event6:	AlpsPS/2 ALPS DualPoint TouchPad

The machines does not have a trackstick, but I think there was a previous model that did have one. I attach alps05.txt and alps06.txt to show the differences between 3.19.1 and 4.0.0-rc3. Re: the ABS_Y event, you can see:

sgala@zen:~$ diff -u alps06.txt alps12.txt 
--- alps06.txt	2015-03-18 07:21:08.827315595 +0100
+++ alps12.txt	2015-03-17 22:40:15.363548619 +0100
@@ -15,21 +15,21 @@
 #     Event code 335 (BTN_TOOL_QUADTAP)
 #   Event type 3 (EV_ABS)
 #     Event code 0 (ABS_X)
-#       Value   1076
+#       Value    198
 #       Min        0
-#       Max     4095
+#       Max      448
 #       Fuzz       0
 #       Flat       0
-#       Resolution 42
+#       Resolution 4
 #     Event code 1 (ABS_Y)
-#       Value    869
+#       Value   1302
 #       Min        0
-#       Max     2047
+#       Max        0
 #       Fuzz       0
 #       Flat       0
-#       Resolution 38
+#       Resolution 0
 #     Event code 47 (ABS_MT_SLOT)
-#       Value      1
+#       Value      0
 #       Min        0
 #       Max        1
 #       Fuzz       0
@@ -38,17 +38,17 @@
 #     Event code 53 (ABS_MT_POSITION_X)
 #       Value      0
 #       Min        0
-#       Max     4095
+#       Max      448
 #       Fuzz       0
 #       Flat       0
-#       Resolution 42
+#       Resolution 4
 #     Event code 54 (ABS_MT_POSITION_Y)
 #       Value      0
 #       Min        0
-#       Max     2047
+#       Max        0
 #       Fuzz       0
 #       Flat       0
-#       Resolution 38
+#       Resolution 0
 #     Event code 57 (ABS_MT_TRACKING_ID)
 #       Value      0
 #       Min        0
@@ -83,9 +83,9 @@
 B: 12 00 00 00 00 00 00 00 00
 B: 15 00 00 00 00 00 00 00 00
 B: 15 00 00 00 00 00 00 00 00
-A: 00 0 4095 0 0 42
-A: 01 0 2047 0 0 38
+A: 00 0 448 0 0 4
+A: 01 0 0 0 0 0
 A: 2f 0 1 0 0 0
-A: 35 0 4095 0 0 42
-A: 36 0 2047 0 0 38
+A: 35 0 448 0 0 4
+A: 36 0 0 0 0 0
 A: 39 0 65535 0 0 0
Comment 13 Santiago Gala 2015-03-18 06:24:56 UTC
Created attachment 170991 [details]
stick (non hardware) device with 3.19.1
Comment 14 Santiago Gala 2015-03-18 06:25:42 UTC
Created attachment 171001 [details]
working Touchpad device (kernel 3.19.1)
Comment 15 Santiago Gala 2015-03-18 06:32:00 UTC
The laptop is a Toshiba Sattellite Z30-A-1DG ( http://www.toshiba.es/laptops/satellite/satellite-z30-a/satellite-z30-a-1dg/ )

I'm attaching the lsinput and both dmesg
Comment 16 Santiago Gala 2015-03-18 06:50:24 UTC
Created attachment 171011 [details]
dmesg for working kernel
Comment 17 Santiago Gala 2015-03-18 06:50:58 UTC
Created attachment 171021 [details]
dmesg for non-working kernel
Comment 18 Santiago Gala 2015-03-18 06:51:26 UTC
Created attachment 171031 [details]
lsinput-3.19.1.txt (working)
Comment 19 Santiago Gala 2015-03-18 06:51:55 UTC
Created attachment 171041 [details]
lsinput-4.0.0-rc3.txt (non working)
Comment 20 Pali Rohár 2015-03-18 21:01:25 UTC
Now I found that in Dmitry's patch "Input: ALPS - consolidate setting protocol parameters" were removed lines for ALPS_PROTO_V7:

-		priv->x_max = 0xfff;
-		priv->y_max = 0x7ff;

And from output I see that touchpad use protocol v7.

So I think removed x_max/y_max lines should be reverted back, or not? Dmitry, please answer.

And about trackstick detection for protocol v7. I already sent patch to linux-input which is preinstalled on Ubuntu Dell Latitude machines.

http://www.spinics.net/lists/linux-input/msg36554.html

Detection for v7 is *same* as for rushmore protocol (with same reg base).
Comment 21 Pali Rohár 2015-03-18 21:12:29 UTC
Dmitry, and in that patch is probably another problem. You moved

if (alps_dolphin_get_device_area(psmouse, priv))

call from ALPS_PROTO_V5 to ALPS_PROTO_V7. And it looks like this cause filling those min/max zero values, because it is called for different protocol now...
Comment 22 Dmitry Torokhov 2015-03-20 16:27:14 UTC
Hmm, it looks like I indeed messed up where I put the call to alps_dolphin_get_device_area(). I'll fix that up.

BTW, Peter, I'd rather userspace did not do divide by 0 - I can feed all kinds of garbage through uinput.
Comment 23 Peter Hutterer 2015-03-23 01:53:00 UTC
yep, understood. A synaptics patch to stop the crash is on the xorg-devel list.
Comment 24 Dmitry Torokhov 2015-04-04 00:12:07 UTC
Fix has been merged into upcoming 4.0-rc7: c164c147c9a0a371c4710186972a02b6ee2eb984
Comment 25 Santiago Gala 2015-04-07 10:04:39 UTC
FYI: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc7-vivid/ works perfectly. The reporting of the TouchPad is ok


Although there are still two devices (I didn't got clearly the status of this): 

$ sudo lsinput  | grep Point
   name    : "AlpsPS/2 ALPS DualPoint Stick"
   name    : "AlpsPS/2 ALPS DualPoint TouchPad"

The non-existant Stick and the TouchPad

Regards and thanks
Comment 26 Dmitry Torokhov 2015-04-07 15:44:56 UTC
It is as supposed to be for now. We need to find someone with V7 device _and_ a trackstick before I can apply Pali's patch for the trackstick detection in V7 devices.
Comment 27 Peter Hutterer 2015-04-07 23:39:27 UTC
xf86-input-synaptics commit 30866b97be6939b895327b930154ef758eed7ff8 fixed the floating point exception.

Note You need to log in before you can comment on or make changes to this bug.