Bug 55329 - [linux-acpi] Lenovo X220T: acpid 2.0.17 results in Xorg server crash when rotated into tablet mode
[linux-acpi] Lenovo X220T: acpid 2.0.17 results in Xorg server crash when rot...
Status: RESOLVED FIXED
Product: xorg
Classification: Unclassified
Component: Server/General
7.7 (2012.06)
x86-64 (AMD64) Linux (All)
: medium critical
Assigned To: Xorg Project Team
Xorg Project Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-25 18:36 UTC by Dan Fuhry
Modified: 2013-02-23 13:45 UTC (History)
6 users (show)

See Also:


Attachments
strace output (31.70 KB, text/plain)
2012-09-25 18:36 UTC, Dan Fuhry
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Fuhry 2012-09-25 18:36:08 UTC
Created attachment 67691 [details]
strace output

acpid 2.0.17 includes a new "video/tabletmode TBLT (on|off)" event, which is emitted through /var/run/acpid.socket. An strace revealed that as soon as the Xorg server reads this line, it crashes. This event is fired when Lenovo convertible tablet PCs, and perhaps those of other vendors, are rotated between tablet and laptop mode.

Reproduces 100% of the time.

Tested with Arch Linux, latest everything, Xorg server 1.12.4, acpid 2.0.16 and 2.0.17.

Source file hints:
./xorg-server-1.12.4/hw/xfree86/os-support/linux/lnx_acpi.c
./xorg-server-1.12.4/hw/xfree86/common/xf86PM.c

Though downgrading fixes the issue for me, the fact that acpid can crash the X server simply by sending it a message the Xorg server does not know how to handle indicates a bug in Xorg.

strace output attached.
Comment 1 Dan Fuhry 2012-09-25 18:39:04 UTC
Apparently bugzilla didn't realize that my log file was gzipped. The attachment in my original post remains readable if you gunzip it.
Comment 2 White 2012-10-11 13:56:58 UTC
I can confirm on a lenovo x201 tablet that Xserver does crash when rotated. Also using Archlinux.
Comment 3 Anne C. Hanna 2012-10-14 19:42:22 UTC
I can also confirm with a Lenovo X201 Tablet, and a friend of mine sees the bug on his Lenovo X230 Tablet.  We use Debian unstable, for which the current acpid version is 2.0.17-1.  Downgrading acpid to 2.0.16-1 while leaving everything else unchanged also fixes it for me; he hasn't tried this yet.
Comment 4 Jonas Jelten 2012-10-15 18:07:25 UTC
in my acpi handler script i added
   exit 1
when video/tabletmode is fired. And this seems to have fixed the crashes.
(X220t core i5-2520)
Comment 5 tomka 2012-10-20 20:39:52 UTC
Putting "exit 1" in a video/tabletmode handler in the handler.sh script, like suggested by Jonas Jelten, did not affect my setup. The Xorg server on my X220t with i7-2620M CPU still crashes when going into tablet mode. I am on Arch linux with Xorg 1.13.0 and acpid 2.0.17.
Comment 6 Kai 2012-11-19 15:22:33 UTC
Add "-S" to your ACPID_ARGS in /etc/conf.d/acpid
This fixed the problem for me. By adding -S the acpi-events get filtered by your acpid-Handlers
Comment 7 Jonas Jelten 2012-11-19 18:05:46 UTC
I don't think this issue is resolved, -S disables the acpi socket...
Any dev looking into this?
Comment 8 Evgeni Golov 2012-12-19 07:22:14 UTC
Hi,

I can confirm this bug on my Thinkpad X61 Tablet. I first reported this bug in Debian some days ago: http://bugs.debian.org/696110
You can find a simple patch against xorg-server 1.12.4 that fixes the issue for me there: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=10_Dont-segfault-on-short-ACPI-strings.diff;att=3;bug=696110

Regards
Evgeni
Comment 9 Julien Cristau 2013-02-23 13:45:37 UTC
commit 3d35dfcf5bad1b0a028fbecd65cb6cf6ebf12503
Author: Ted Felix <ted@tedfelix.com>
Date:   Tue Jan 29 16:36:48 2013 +1000

    xfree86: bail on misformed acpi strings (#73227)