# [SOLVED] Bad magic cookies when resuming from suspend

## Elv13

Hello, I often can't open X applications after resuming from suspend. I get:

```

> kcalc

Invalid MIT-MAGIC-COOKIE-1 keyQXcbConnection: Could not connect to display :0

zsh: abort      kcalc

```

Here is an strace:

```
strace xmessage

execve("/usr/bin/xmessage", ["xmessage"], [/* 47 vars */]) = 0

brk(NULL)                               = 0x1300000

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d192000

access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3

fstat(3, {st_mode=S_IFREG|0644, st_size=219645, ...}) = 0

mmap(NULL, 219645, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa52d15c000

close(3)                                = 0

open("/usr/lib64/libXaw.so.7", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\201\1\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=480888, ...}) = 0

mmap(NULL, 2577464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52ccfc000

mprotect(0x7fa52cd66000, 2097152, PROT_NONE) = 0

mmap(0x7fa52cf66000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6a000) = 0x7fa52cf66000

mmap(0x7fa52cf71000, 1080, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa52cf71000

close(3)                                = 0

open("/usr/lib64/libXt.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`<\1\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=425408, ...}) = 0

mmap(NULL, 2523904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52ca93000

mprotect(0x7fa52caf6000, 2093056, PROT_NONE) = 0

mmap(0x7fa52ccf5000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x62000) = 0x7fa52ccf5000

mmap(0x7fa52ccfb000, 768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa52ccfb000

close(3)                                = 0

open("/usr/lib64/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\335\1\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=1310080, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d15b000

mmap(NULL, 3407192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52c753000

mprotect(0x7fa52c88d000, 2097152, PROT_NONE) = 0

mmap(0x7fa52ca8d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a000) = 0x7fa52ca8d000

close(3)                                = 0

open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\6\2\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=1676768, ...}) = 0

mmap(NULL, 3783096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52c3b7000

mprotect(0x7fa52c549000, 2097152, PROT_NONE) = 0

mmap(0x7fa52c749000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x192000) = 0x7fa52c749000

mmap(0x7fa52c74f000, 14776, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa52c74f000

close(3)                                = 0

open("/usr/lib64/libXext.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P9\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=73304, ...}) = 0

mmap(NULL, 2169144, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52c1a5000

mprotect(0x7fa52c1b6000, 2093056, PROT_NONE) = 0

mmap(0x7fa52c3b5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7fa52c3b5000

close(3)                                = 0

open("/usr/lib64/libXmu.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20j\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=107256, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d15a000

mmap(NULL, 2203704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52bf8a000

mprotect(0x7fa52bfa3000, 2093056, PROT_NONE) = 0

mmap(0x7fa52c1a2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7fa52c1a2000

mmap(0x7fa52c1a4000, 56, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa52c1a4000

close(3)                                = 0

open("/usr/lib64/libXpm.so.4", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\2601\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=72736, ...}) = 0

mmap(NULL, 2168048, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52bd78000

mprotect(0x7fa52bd89000, 2093056, PROT_NONE) = 0

mmap(0x7fa52bf88000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7fa52bf88000

close(3)                                = 0

open("/usr/lib64/libSM.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=30856, ...}) = 0

mmap(NULL, 2126192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52bb70000

mprotect(0x7fa52bb77000, 2093056, PROT_NONE) = 0

mmap(0x7fa52bd76000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fa52bd76000

close(3)                                = 0

open("/usr/lib64/libICE.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@N\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=98064, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d159000

mmap(NULL, 2207872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52b954000

mprotect(0x7fa52b96b000, 2093056, PROT_NONE) = 0

mmap(0x7fa52bb6a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7fa52bb6a000

mmap(0x7fa52bb6c000, 12416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa52bb6c000

close(3)                                = 0

open("/usr/lib64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\245\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=142016, ...}) = 0

mmap(NULL, 2237448, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52b731000

mprotect(0x7fa52b753000, 2093056, PROT_NONE) = 0

mmap(0x7fa52b952000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x21000) = 0x7fa52b952000

close(3)                                = 0

open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\16\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=14448, ...}) = 0

mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52b52d000

mprotect(0x7fa52b52f000, 2097152, PROT_NONE) = 0

mmap(0x7fa52b72f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fa52b72f000

close(3)                                = 0

open("/lib64/libuuid.so.1", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\25\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=18840, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d158000

mmap(NULL, 2113944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52b328000

mprotect(0x7fa52b32c000, 2093056, PROT_NONE) = 0

mmap(0x7fa52b52b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fa52b52b000

close(3)                                = 0

open("/usr/lib64/libbsd.so.0", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0009\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=85152, ...}) = 0

mmap(NULL, 2184240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52b112000

mprotect(0x7fa52b126000, 2093056, PROT_NONE) = 0

mmap(0x7fa52b325000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7fa52b325000

mmap(0x7fa52b327000, 1072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa52b327000

close(3)                                = 0

open("/usr/lib64/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\16\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=14408, ...}) = 0

mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52af0e000

mprotect(0x7fa52af11000, 2093056, PROT_NONE) = 0

mmap(0x7fa52b110000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fa52b110000

close(3)                                = 0

open("/usr/lib64/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\24\0\0\0\0\0\0"..., 832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=22576, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d157000

mmap(NULL, 2117888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa52ad08000

mprotect(0x7fa52ad0d000, 2093056, PROT_NONE) = 0

mmap(0x7fa52af0c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7fa52af0c000

close(3)                                = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d156000

mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d154000

arch_prctl(ARCH_SET_FS, 0x7fa52d154780) = 0

mprotect(0x7fa52c749000, 16384, PROT_READ) = 0

mprotect(0x7fa52b325000, 4096, PROT_READ) = 0

mprotect(0x7fa52af0c000, 4096, PROT_READ) = 0

mprotect(0x7fa52b110000, 4096, PROT_READ) = 0

mprotect(0x7fa52b52b000, 4096, PROT_READ) = 0

mprotect(0x7fa52b72f000, 4096, PROT_READ) = 0

mprotect(0x7fa52b952000, 4096, PROT_READ) = 0

mprotect(0x7fa52bb6a000, 4096, PROT_READ) = 0

mprotect(0x7fa52bd76000, 4096, PROT_READ) = 0

mprotect(0x7fa52ca8d000, 4096, PROT_READ) = 0

mprotect(0x7fa52bf88000, 4096, PROT_READ) = 0

mprotect(0x7fa52ccf5000, 4096, PROT_READ) = 0

mprotect(0x7fa52c3b5000, 4096, PROT_READ) = 0

mprotect(0x7fa52c1a2000, 4096, PROT_READ) = 0

mprotect(0x7fa52cf66000, 4096, PROT_READ) = 0

mprotect(0x603000, 4096, PROT_READ)     = 0

mprotect(0x7fa52d193000, 4096, PROT_READ) = 0

munmap(0x7fa52d15c000, 219645)          = 0

brk(NULL)                               = 0x1300000

brk(0x1321000)                          = 0x1321000

open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3

fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d191000

read(3, "MemTotal:       16309372 kB\nMemF"..., 1024) = 1024

close(3)                                = 0

munmap(0x7fa52d191000, 4096)            = 0

socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3

connect(3, {sa_family=AF_LOCAL, sun_path=@"/tmp/.X11-unix/X0"}, 20) = 0

getpeername(3, {sa_family=AF_LOCAL, sun_path=@"/tmp/.X11-unix/X0"}, [20]) = 0

uname({sysname="Linux", nodename="CPE54ee7529978d-CM0015a349a2c5", ...}) = 0

access("/home/lepagee/.Xauthority", R_OK) = 0

open("/home/lepagee/.Xauthority", O_RDONLY) = 4

fstat(4, {st_mode=S_IFREG|0600, st_size=134, ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa52d191000

read(4, "\1\0\0\36CPE54ee7529978d-CM0015a349a2"..., 4096) = 134

read(4, "", 4096)                       = 0

close(4)                                = 0

munmap(0x7fa52d191000, 4096)            = 0

getsockname(3, {sa_family=AF_LOCAL, NULL}, [2]) = 0

fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)

fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

fcntl(3, F_SETFD, FD_CLOEXEC)           = 0

poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])

writev(3, [{"l\0\v\0\0\0\22\0\20\0\0\0", 12}, {"", 0}, {"MIT-MAGIC-COOKIE-1", 18}, {"\0\0", 2}, {"\324\265P\301\213\206\310\267_\33\221\200\17\4\21\204", 16}, {"", 0}], 6) = 48

recvfrom(3, 0x13056d0, 8, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)

poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN|POLLHUP}])

recvfrom(3, "\0\36\v\0\0\0\10\0", 8, 0, NULL, NULL) = 8

recvfrom(3, "Invalid MIT-MAGIC-COOKIE-1 key\0\0", 32, 0, NULL, NULL) = 32

write(2, "Invalid MIT-MAGIC-COOKIE-1 key", 30Invalid MIT-MAGIC-COOKIE-1 key) = 30

shutdown(3, SHUT_RDWR)                  = 0

close(3)                                = 0

open("/usr/share/X11/XtErrorDB", O_RDONLY) = -1 ENOENT (No such file or directory)

getuid()                                = 1000

geteuid()                               = 1000

getuid()                                = 1000

write(2, "Error: Can't open display: :0\n", 30Error: Can't open display: :0

) = 30

exit_group(1)                           = ?

+++ exited with 1 +++

```

DMESG:

```
[    3.616008] usb 3-7: new full-speed USB device number 3 using xhci_hcd

[    3.781048] usb 3-7: New USB device found, idVendor=138a, idProduct=0017

[    3.781052] usb 3-7: New USB device strings: Mfr=0, Product=0, SerialNumber=1

[    3.781053] usb 3-7: SerialNumber: cc7f03fd6592

[    3.838407] EXT4-fs (sda1): re-mounted. Opts: (null)

[    3.918942] Adding 9352188k swap on /dev/sda3.  Priority:-1 extents:1 across:9352188k SS

[    3.935043] usb 3-11: new full-speed USB device number 4 using xhci_hcd

[    3.951006] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)

[    4.100036] usb 3-11: New USB device found, idVendor=8087, idProduct=07dc

[    4.100039] usb 3-11: New USB device strings: Mfr=0, Product=0, SerialNumber=0

[    4.253055] usb 3-12: new high-speed USB device number 5 using xhci_hcd

[    4.488493] usb 3-12: New USB device found, idVendor=04f2, idProduct=b39a

[    4.488496] usb 3-12: New USB device strings: Mfr=1, Product=2, SerialNumber=0

[    4.488498] usb 3-12: Product: Integrated Camera

[    4.488499] usb 3-12: Manufacturer: SunplusIT INC.

[    4.582191] Linux video capture interface: v2.00

[    4.586775] uvcvideo: Found UVC 1.00 device Integrated Camera (04f2:b39a)

[    4.595321] input: Integrated Camera as /devices/pci0000:00/0000:00:14.0/usb3/3-12/3-12:1.0/input/input17

[    4.595387] usbcore: registered new interface driver uvcvideo

[    4.595388] USB Video Class driver (1.1.1)

[    4.604466] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc00b8, key code 161): Invalid argument

[    4.604471] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc0183, key code 226): Invalid argument

[    4.604475] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc0184, key code 421): Invalid argument

[    4.604478] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc0186, key code 423): Invalid argument

[    4.604481] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc018a, key code 155): Invalid argument

[    4.604484] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc018e, key code 397): Invalid argument

[    4.604486] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc01b6, key code 212): Invalid argument

[    4.604489] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc01bc, key code 430): Invalid argument

[    4.604492] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc0221, key code 217): Invalid argument

[    4.604495] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc0223, key code 172): Invalid argument

[    4.604498] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc022d, key code 418): Invalid argument

[    4.604501] systemd-udevd[2429]: Error calling EVIOCSKEYCODE on device node '/dev/input/event14' (scan code 0xc022e, key code 419): Invalid argument

[    4.639494] random: nonblocking pool is initialized

[    5.789758] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[    5.789878] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[    5.790150] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[    5.981156] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[    5.981425] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[    5.995223] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[    5.998927] IPv6: ADDRCONF(NETDEV_UP): enp0s25: link is not ready

[    6.202354] IPv6: ADDRCONF(NETDEV_UP): enp0s25: link is not ready

[    6.253592] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[   35.135891] wlp3s0: authenticate with c8:d3:a3:54:e7:81

[   35.138896] wlp3s0: send auth to c8:d3:a3:54:e7:81 (try 1/3)

[   35.143910] wlp3s0: authenticated

[   35.144593] wlp3s0: associate with c8:d3:a3:54:e7:81 (try 1/3)

[   35.149327] wlp3s0: RX AssocResp from c8:d3:a3:54:e7:81 (capab=0x431 status=0 aid=6)

[   35.153803] wlp3s0: associated

[   35.153822] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready

[ 2506.856654] snd_hda_intel 0000:00:1b.0: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj.

[11710.222947] PM: Syncing filesystems ... done.

[11710.232011] PM: Preparing system for sleep (mem)

[11710.232404] Freezing user space processes ... (elapsed 0.001 seconds) done.

[11710.234044] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.

[11710.235093] PM: Suspending system (mem)

[11710.235111] Suspending console(s) (use no_console_suspend to debug)

[11710.235337] wlp3s0: deauthenticating from c8:d3:a3:54:e7:81 by local choice (Reason: 3=DEAUTH_LEAVING)

[11710.235546] sd 0:0:0:0: [sda] Synchronizing SCSI cache

[11710.235957] sd 0:0:0:0: [sda] Stopping disk

[11710.236492] e1000e: EEE TX LPI TIMER: 00000011

[11710.997087] PM: suspend of devices complete after 761.804 msecs

[11711.014110] PM: late suspend of devices complete after 17.017 msecs

[11711.016580] ehci-pci 0000:00:1d.0: System wakeup enabled by ACPI

[11711.016970] e1000e 0000:00:19.0: System wakeup enabled by ACPI

[11711.016982] xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI

[11711.017030] ehci-pci 0000:00:1a.0: System wakeup enabled by ACPI

[11711.027992] PM: noirq suspend of devices complete after 13.878 msecs

[11711.028279] ACPI: Preparing to enter system sleep state S3

[11711.079010] ACPI : EC: EC stopped

[11711.079011] PM: Saving platform NVS memory

[11711.079017] Disabling non-boot CPUs ...

[11711.085348] smpboot: CPU 1 is now offline

[11711.103376] smpboot: CPU 2 is now offline

[11711.123067] smpboot: CPU 3 is now offline

[11711.135358] smpboot: CPU 4 is now offline

[11711.153061] smpboot: CPU 5 is now offline

[11711.171360] smpboot: CPU 6 is now offline

[11711.186051] smpboot: CPU 7 is now offline

[11711.194759] ACPI: Low-level resume complete

[11711.194841] ACPI : EC: EC started

[11711.194842] PM: Restoring platform NVS memory

[11711.195365] Enabling non-boot CPUs ...

[11711.203257] x86: Booting SMP configuration:

[11711.203260] smpboot: Booting Node 0 Processor 1 APIC 0x1

[11711.206906]  cache: parent cpu1 should not be sleeping

[11711.207136] CPU1 is up

[11711.227333] smpboot: Booting Node 0 Processor 2 APIC 0x2

[11711.230784]  cache: parent cpu2 should not be sleeping

[11711.231046] CPU2 is up

[11711.246419] smpboot: Booting Node 0 Processor 3 APIC 0x3

[11711.249809]  cache: parent cpu3 should not be sleeping

[11711.250055] CPU3 is up

[11711.259540] smpboot: Booting Node 0 Processor 4 APIC 0x4

[11711.263009]  cache: parent cpu4 should not be sleeping

[11711.263234] CPU4 is up

[11711.280610] smpboot: Booting Node 0 Processor 5 APIC 0x5

[11711.284202]  cache: parent cpu5 should not be sleeping

[11711.284440] CPU5 is up

[11711.296720] smpboot: Booting Node 0 Processor 6 APIC 0x6

[11711.300172]  cache: parent cpu6 should not be sleeping

[11711.300405] CPU6 is up

[11711.306802] smpboot: Booting Node 0 Processor 7 APIC 0x7

[11711.310579]  cache: parent cpu7 should not be sleeping

[11711.310814] CPU7 is up

[11711.329486] ACPI: Waking up from system sleep state S3

[11711.385214] thinkpad_acpi: EC reports that Thermal Table has changed

[11711.438956] acpi LNXPOWER:02: Turning OFF

[11711.442350] xhci_hcd 0000:00:14.0: System wakeup disabled by ACPI

[11711.442593] ehci-pci 0000:00:1a.0: System wakeup disabled by ACPI

[11711.442625] ehci-pci 0000:00:1d.0: System wakeup disabled by ACPI

[11711.452890] PM: noirq resume of devices complete after 11.922 msecs

[11711.454101] PM: early resume of devices complete after 1.151 msecs

[11711.454247] e1000e 0000:00:19.0: System wakeup disabled by ACPI

[11711.454343] usb usb3: root hub lost power or was reset

[11711.454348] usb usb4: root hub lost power or was reset

[11711.455273] rtc_cmos 00:02: System wakeup disabled by ACPI

[11711.457023] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[11711.457302] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[11711.460574] sd 0:0:0:0: [sda] Starting disk

[11711.659175] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[11711.659459] iwlwifi 0000:03:00.0: L1 Enabled - LTR Enabled

[11711.667934] usb 1-1: reset high-speed USB device number 2 using ehci-pci

[11711.667960] usb 2-1: reset high-speed USB device number 2 using ehci-pci

[11711.758676] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)

[11711.759692] ata6: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

[11711.761689] ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded

[11711.761690] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out

[11711.761928] ata1.00: supports DRM functions and may not be fully accessible

[11711.762109] ata1.00: failed to get NCQ Send/Recv Log Emask 0x1

[11711.763403] ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded

[11711.763405] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out

[11711.763639] ata1.00: supports DRM functions and may not be fully accessible

[11711.763817] ata1.00: failed to get NCQ Send/Recv Log Emask 0x1

[11711.763819] ata1.00: configured for UDMA/133

[11711.763923] ata6.00: ACPI cmd e3/00:1f:00:00:00:a0 (IDLE) succeeded

[11711.764122] ata6.00: ACPI cmd e3/00:02:00:00:00:a0 (IDLE) succeeded

[11711.771193] ata6.00: ACPI cmd e3/00:1f:00:00:00:a0 (IDLE) succeeded

[11711.771394] ata6.00: ACPI cmd e3/00:02:00:00:00:a0 (IDLE) succeeded

[11711.773322] ata6.00: configured for UDMA/133

[11711.821995] usb 3-11: reset full-speed USB device number 4 using xhci_hcd

[11712.139060] usb 3-6: reset full-speed USB device number 2 using xhci_hcd

[11712.456075] usb 3-7: reset full-speed USB device number 3 using xhci_hcd

[11712.774069] usb 3-12: reset high-speed USB device number 5 using xhci_hcd

[11712.997087] PM: resume of devices complete after 1542.907 msecs

[11712.997287] PM: Finishing wakeup.

[11712.997288] Restarting tasks ... done.

[11713.189982] e1000e: enp0s25 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None

[11713.189986] e1000e 0000:00:19.0 enp0s25: 10/100 speed: disabling TSO

[11713.190020] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s25: link becomes ready

[11718.594274] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[11743.631991] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[11768.633078] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[11793.634317] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready

[13474.239509] thinkpad_acpi: EC reports that Thermal Table has changed

[14308.231997] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
```

It started happening after an emerge -e @world --deep, but probably due to an update (I often postpone non security critical updates a few months). It isn't related to my CFLAGS, as I recompiled everything with -O2 -pipe and the problem persist. Killing and restarting X "solve" the problem for a few minutes, then the apps start misbehaving again. I currently have the latest kernel. I think it is properly configured.Last edited by Elv13 on Thu May 05, 2016 8:04 pm; edited 1 time in total

----------

## eccerr0r

What are you using to configure your network?  Did your hostname change after a suspend?

Using dhcpcd or busybox or networkmanager or ???

----------

## Elv13

Ah, right, thanks, it indeed went from "lepagee@elepage-laptop" to "lepagee@CPE54ee7529978d-CM0015a349a2c5". I use NetworkManager (it's a laptop). I also have /etc/init.d/hostname to set my hostname at boot. I guess they conflict. Thanks a lot.

----------

