Bug 89898

Summary: Segfault when resuming from suspend to ram
Product: xorg Reporter: ashim acharya <ashimtron>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: critical    
Priority: medium CC: freedesktop, jhnmlkvch9, lee295012, r9ku1q, scott.ashford
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg log none

Description ashim acharya 2015-04-04 02:54:04 UTC
Created attachment 114860 [details]
xorg log

Linux aal 3.19.3-1-ARCH #1 SMP PREEMPT Thu Mar 26 14:56:16 CET 2015 x86_64 GNU/Linux
xorg-server 1.17.1-4

Laptop computer with main screen turned off(xrandr --output LVDS1 --off).
Using hdmi output to external monitor(with hdmi to dvi adaptor).
I suspend then wake by hitting a keyboard key.
X segfaults when resuming from suspend-to-ram(systemctl suspend); usually when awaking from 1hr+ suspends(segfaults occur around 50% of the time).
I startx again.(sometimes a monitor reset is needed for usb peripherals, which are connected to it, to work again)

noob guesses: WakeupHandler/WaitForSomething timeout needs to be increased. Maybe its related to a kernel usb bug.

tail of xorg.0.log:
[ 30751.015] (II) UnloadModule: "evdev"
[ 30751.015] (II) systemd-logind: releasing fd for 13:79
[ 30751.021] (EE) systemd-logind: failed to release device: Device not taken
[ 50722.300] (II) config/udev: removing device SINO WEALTH USB KEYBOARD
[ 50722.302] (II) evdev: SINO WEALTH USB KEYBOARD: Close
[ 50722.303] (II) UnloadModule: "evdev"
[ 50722.303] (II) systemd-logind: releasing fd for 13:74
[ 50722.340] (EE) systemd-logind: failed to release device: Device not taken
[ 50722.392] (II) config/udev: removing device SINO WEALTH USB KEYBOARD
[ 50722.393] (II) evdev: SINO WEALTH USB KEYBOARD: Close
[ 50722.393] (II) UnloadModule: "evdev"
[ 50722.393] (II) systemd-logind: releasing fd for 13:75
[ 50722.893] (EE) systemd-logind: failed to release device: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[ 50722.912] (II) config/udev: removing device USB Optical Wheel Mouse
[ 50722.914] (II) evdev: USB Optical Wheel Mouse: Close
[ 50722.915] (II) UnloadModule: "evdev"
[ 50722.915] (II) systemd-logind: releasing fd for 13:76
[ 50723.415] (EE) systemd-logind: failed to release device: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[ 50723.725] (EE) 
[ 50723.725] (EE) Backtrace:
[ 50723.755] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x119) [0x5949c9]
[ 50723.757] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7f7dc797053f]
[ 50723.758] (EE) 2: /usr/lib/libc.so.6 (__strcmp_sse2_unaligned+0x1a) [0x7f7dc79cd29a]
[ 50723.758] (EE) 3: /usr/lib/xorg-server/Xorg (xf86SIGIOSupported+0xa38) [0x4a1e48]
[ 50723.759] (EE) 4: /usr/lib/libdbus-1.so.3 (dbus_connection_dispatch+0x3f1) [0x7f7dc96025d1]
[ 50723.760] (EE) 5: /usr/lib/libdbus-1.so.3 (dbus_connection_dispatch+0x645) [0x7f7dc9602dc5]
[ 50723.761] (EE) 6: /usr/lib/xorg-server/Xorg (config_fini+0x4c1) [0x49bb11]
[ 50723.761] (EE) 7: /usr/lib/xorg-server/Xorg (WakeupHandler+0x6b) [0x43d6cb]
[ 50723.761] (EE) 8: /usr/lib/xorg-server/Xorg (WaitForSomething+0x1c3) [0x58d923]
[ 50723.761] (EE) 9: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x111) [0x4388b1]
[ 50723.762] (EE) 10: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x41b) [0x43cbcb]
[ 50723.763] (EE) 11: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f7dc795d800]
[ 50723.763] (EE) 12: /usr/lib/xorg-server/Xorg (_start+0x29) [0x427039]
[ 50723.764] (EE) 13: ? (?+0x29) [0x29]
[ 50723.764] (EE) 
[ 50723.764] (EE) Segmentation fault at address 0x0
[ 50723.764] (EE) 
Fatal server error:
[ 50723.764] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 50723.764] (EE) 
[ 50723.764] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[ 50723.764] (EE) Please also check the log file at "/home/eca/.local/share/xorg/Xorg.0.log" for additional information.
[ 50723.764] (EE) 
[ 50723.764] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 50723.812] (EE) Server terminated with error (1). Closing log file.
Comment 1 Mateus Rodrigues Costa 2015-06-11 02:41:46 UTC
Linux mateus-arch 4.0.5-1-ARCH #1 SMP PREEMPT Sat Jun 6 18:37:49 CEST 2015 x86_64 GNU/Linux
xorg-server 1.17.1-6

Same here.
I am also using a laptop and I am triggering the bug by resuming from hibernation.
I noticed that 1 hour thing too.
I usually have my USB mouse plugged in, so the USB peripherals may very well be related to it.

Xorg.0.log form around the time of the segfault:
[ 20602.300] (II) config/udev: removing device  USB OPTICAL MOUSE
[ 20605.532] (**) Option "fd" "33"
[ 20606.536] (II) UnloadModule: "libinput"
[ 20606.536] (II) systemd-logind: releasing fd for 13:71
[ 20607.037] (EE) systemd-logind: failed to release device: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[ 20608.965] (EE) 
[ 20608.965] (EE) Backtrace:
[ 20609.157] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x5966d9]
[ 20609.357] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7f0c0a3fe5af]
[ 20609.377] (EE) 2: /usr/lib/libc.so.6 (__strcmp_sse2_unaligned+0x1a) [0x7f0c0a45ae0a]
[ 20609.378] (EE) 3: /usr/lib/xorg-server/Xorg (xf86SIGIOSupported+0xa18) [0x4a2838]
[ 20609.379] (EE) 4: /usr/lib/libdbus-1.so.3 (dbus_connection_dispatch+0x375) [0x7f0c0c08f4a5]
[ 20609.380] (EE) 5: /usr/lib/libdbus-1.so.3 (dbus_connection_dispatch+0x64d) [0x7f0c0c08fd2d]
[ 20609.380] (EE) 6: /usr/lib/xorg-server/Xorg (config_fini+0x4c1) [0x49c5e1]
[ 20609.380] (EE) 7: /usr/lib/xorg-server/Xorg (WakeupHandler+0x6d) [0x43d8dd]
[ 20610.053] (EE) 8: /usr/lib/xorg-server/Xorg (WaitForSomething+0x1e7) [0x58f427]
[ 20610.054] (EE) 9: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x111) [0x438b21]
[ 20610.054] (EE) 10: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x41b) [0x43ce0b]
[ 20610.056] (EE) 11: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f0c0a3eb790]
[ 20610.056] (EE) 12: /usr/lib/xorg-server/Xorg (_start+0x29) [0x4271f9]
[ 20611.785] (EE) 13: ? (?+0x29) [0x29]
[ 20611.785] (EE) 
[ 20612.149] (EE) Segmentation fault at address 0x0
[ 20612.149] (EE) 
Fatal server error:
[ 20612.149] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 20612.149] (EE) 
[ 20612.149] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[ 20612.149] (EE) Please also check the log file at "/home/mateus/.local/share/xorg/Xorg.0.log" for additional information.
[ 20612.149] (EE) 
[ 20612.441] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 20612.471] (EE) Server terminated with error (1). Closing log file.
Comment 2 scott 2015-07-14 04:34:09 UTC
I may have a similar crash when using xrandr.

X.Org X Server 1.17.2
Release Date: 2015-06-16
[ 14947.723] X Protocol Version 11, Revision 0
[ 14947.725] Build Operating System: Linux 4.0.4-2-ARCH x86_64 
[ 14947.726] Current Operating System: Linux rakanishu 4.0.7-2-ARCH #1 SMP PREEMPT Tue Jun 30 07:50:21 UTC 2015 x86_64
[ 14947.726] Kernel command line: root=/dev/sda2 pcie_aspm=force rw initrd=/initramfs-linux.img
[ 14947.728] Build Date: 30 June 2015  09:00:12PM
...
[ 15234.205] (II) modeset(G0): EDID vendor "CMN", prod id 5568
[ 15234.205] (II) modeset(G0): Printing DDC gathered Modelines:
[ 15234.205] (II) modeset(G0): Modeline "1920x1080"x0.0  151.60  1920 2010 2070 2220  1080 1086 1095 1138 -hsync -vsync (68.3 kHz eP)
[ 15235.812] (EE) 
[ 15235.812] (EE) Backtrace:
[ 15235.812] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x596779]
[ 15235.813] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7f5cf9eb35af]
[ 15235.813] (EE) 2: /usr/lib/xorg-server/Xorg (DamageRegister+0x11) [0x5195f1]
[ 15235.813] (EE) 3: /usr/lib/xorg-server/Xorg (xf86RandR12PreInit+0x488) [0x4bc1f8]
[ 15235.813] (EE) 4: /usr/lib/xorg-server/Xorg (BlockHandler+0x8a) [0x43d88a]
[ 15235.813] (EE) 5: /usr/lib/xorg-server/Xorg (WaitForSomething+0x15b) [0x58f44b]
[ 15235.813] (EE) 6: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x111) [0x438c61]
[ 15235.814] (EE) 7: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x41b) [0x43cf4b]
[ 15235.814] (EE) 8: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f5cf9ea0790]
[ 15235.814] (EE) 9: /usr/lib/xorg-server/Xorg (_start+0x29) [0x427319]
[ 15235.814] (EE) 10: ? (?+0x29) [0x29]
[ 15235.814] (EE) 
[ 15235.814] (EE) Segmentation fault at address 0x10
[ 15235.815] (EE) 
Fatal server error:
[ 15235.815] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 15235.815] (EE)
Comment 3 Andreas Reis 2015-07-16 19:34:12 UTC
There's at least three other people suddenly getting similar crashes. See (with logs): https://bbs.archlinux.org/viewtopic.php?id=199812

I've tried using various git versions (server, intel driver, kernel, evdev) and reverts – to no avail.

Do your input devices work when you restart the xserver (pkill X; startx)? Mine (all USB) don't.
Comment 4 ashim acharya 2015-07-16 20:19:28 UTC
Since upgrading to kernel 4.1.1 (~3 weeks ago), X hasn't segfaulted. Usb devices are sometimes lost when resuming though.
Comment 5 Andreas Reis 2015-07-16 22:49:28 UTC
Bit weird given that I'm getting it both on 4.1.2 and 4.2-git. Then again, I never get it from suspend&resume, either.

xrandr --output HDMI1 --off doesn't cause it either, though it corrupts the display. What should be 1440p+1080p becomes 1080p only, and that monitor's viewport is also screwed up (upper third is doubled horizontally).

Anyway, this is what I get if I call a backtrace from an attached gdb (via ssh):

Program received signal SIGSEGV, Segmentation fault.
0x00000000005f2226 in FlushAllOutput () at io.c:675
675     io.c: File or directory not found
(gdb) bt
#0  0x00000000005f2226 in FlushAllOutput () at io.c:675
#1  0x00000000005e9cbe in WaitForSomething (pClientsReady=pClientsReady@entry=0x321aac0) at WaitFor.c:217
#2  0x000000000043c004 in Dispatch () at dispatch.c:358
#3  0x0000000000441bf4 in dix_main (argc=12, argv=0x7fff953e21b8, envp=<optimized out>) at main.c:298
#4  0x00007f08b32fb790 in __libc_start_main () from /usr/lib/libc.so.6
#5  0x00000000004274b9 in _start ()
Comment 6 Matt Whitlock 2015-07-17 11:50:52 UTC
I think I'm experiencing the same crash as in Comment 5. It happens seemingly spontaneously/spuriously. It even happened while I was away from the computer. (I returned to find that X had restarted.) This was in the log:

[2272468.016] (EE) Backtrace:
[2272468.016] (EE) 0: /usr/bin/X (xorg_backtrace+0x56) [0x5dc3e6]
[2272468.016] (EE) 1: /usr/bin/X (0x400000+0x1e1729) [0x5e1729]
[2272468.016] (EE) 2: /lib64/libc.so.6 (0x7f73d01c3000+0x33bc0) [0x7f73d01f6bc0]
[2272468.016] (EE) 3: /usr/bin/X (FlushAllOutput+0xc1) [0x5e0d71]
[2272468.016] (EE) 4: /usr/bin/X (0x400000+0x3baaf) [0x43baaf]
[2272468.016] (EE) 5: /usr/bin/X (0x400000+0x40774) [0x440774]
[2272468.016] (EE) 6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f73d01e2fa0]
[2272468.017] (EE) 7: /usr/bin/X (0x400000+0x27d2e) [0x427d2e]

Using addr2line, I resolve these addresses to source lines, as follows:

0: /usr/bin/X (xorg-server-1.17.2/os/backtrace.c:126)
1: /usr/bin/X (xorg-server-1.17.2/os/osinit.c:132)
2: /lib64/libc.so.6 (??)
3: /usr/bin/X (xorg-server-1.17.2/os/io.c:675)
4: /usr/bin/X (xorg-server-1.17.2/dix/dispatch.c:455)
5: /usr/bin/X (xorg-server-1.17.2/dix/main.c:307)
6: /lib64/libc.so.6 (??)
7: /usr/bin/X (??)

I have also seen the crash at io.c:675 but with "WaitForSomething" in the trace, as shown in Comment 5.
Comment 7 Andreas Reis 2015-07-22 12:15:48 UTC
No more crashes for me with the patch that's in Arch's xorg-server 1.17.2-4:
"os: make sure the clientsWritable fd_set is initialized before use"
Comment 8 JM9 2015-10-13 01:17:32 UTC
Still crashing on Arch Xorg xorg-server 1.17.2-4

[ 13517.792] (II) AIGLX: Resuming AIGLX clients after VT switch
[ 13517.792] (II) intel(0): switch to mode 1920x1080@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 13517.792] (EE)
[ 13517.792] (EE) Backtrace:
[ 13518.190] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x596d09]
[ 13518.221] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7f82ae6bf67f]
[ 13518.222] (EE) 2: /usr/lib/libc.so.6 (cfree+0x34) [0x7f82ae707ac4]
[ 13518.222] (EE) 3: /usr/lib/libc.so.6 (realloc+0x25d) [0x7f82ae707d8d]
[ 13518.223] (EE) 4: /usr/lib/xorg-server/Xorg (xf86PruneDuplicateModes+0xdc6) [0x4b9cc6]
[ 13518.223] (EE) 5: /usr/lib/xorg-server/Xorg (xf86PruneDuplicateModes+0x1c2b) [0x4bb91b]
[ 13518.223] (EE) 6: /usr/lib/xorg/modules/extensions/libglx.so (GlxSetVisualConfigs+0x65bf) [0x7f82abeb4eff]
[ 13518.223] (EE) 7: /usr/lib/xorg-server/Xorg (xf86VTEnter+0x88) [0x4784d8]
[ 13518.223] (EE) 8: /usr/lib/xorg-server/Xorg (xf86SIGIOSupported+0x867) [0x4a2747]
[ 13518.223] (EE) 9: /usr/lib/xorg-server/Xorg (xf86SIGIOSupported+0xb6b) [0x4a2afb]
[ 13518.224] (EE) 10: /usr/lib/libdbus-1.so.3 (dbus_connection_dispatch+0x375) [0x7f82b0353165]
[ 13518.225] (EE) 11: /usr/lib/libdbus-1.so.3 (dbus_connection_dispatch+0x6dd) [0x7f82b0353b0d]
[ 13518.225] (EE) 12: /usr/lib/xorg-server/Xorg (config_fini+0x4c1) [0x49c7c1]
[ 13518.225] (EE) 13: /usr/lib/xorg-server/Xorg (WakeupHandler+0x6d) [0x43da1d]
[ 13518.225] (EE) 14: /usr/lib/xorg-server/Xorg (WaitForSomething+0x1ef) [0x58f54f]
[ 13518.225] (EE) 15: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x111) [0x438c61]
[ 13518.225] (EE) 16: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x41b) [0x43cf4b]
[ 13518.226] (EE) 17: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f82ae6ac610]
[ 13518.226] (EE) 18: /usr/lib/xorg-server/Xorg (_start+0x29) [0x427319]
[ 13518.226] (EE) 19: ? (?+0x29) [0x29]
[ 13518.226] (EE)
[ 13518.226] (EE) Segmentation fault at address 0x0
[ 13518.226] (EE)
Fatal server error:
[ 13518.226] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 13518.226] (EE)
[ 13518.226] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
Comment 9 GitLab Migration User 2018-12-13 22:32:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/474.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.