NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.15k stars 14.18k forks source link

xorg freezes on nixos unstable #80639

Closed turboMaCk closed 4 years ago

turboMaCk commented 4 years ago

Describe the bug My friend (@kubaracek) and I are both experiencing similar problem with NixOS. Xorg desktop seems to freez mostly randomly. This started to happen to me about a 2 weeks back after upgrade of system from nixos-unstable channel. Today I made another upgrade which seems to make it even worse. During last 3 hours I had 3 freezes of desktop and had to always reboot the system.

First I thought it might be Brave browser messing something up since I've seen there were some ad_reward.cc errors in the log prior to freez. But now I see errors related to GLX and issue with X connection to :0.

To Reproduce unknown

Expected behavior should not freezes

Screenshots none

Additional context This is my xserver configuration. I'm using compton with glx backend but jakub does not.

His configuration is also public.

This is the log from around one such event (freez in xautolock):

``` Feb 20 14:00:26 nixos systemd-logind[1539]: Power key pressed. Feb 20 14:00:26 nixos kernel: i915 0000:00:02.0: Resetting rcs0 for hang on rcs0 Feb 20 14:00:27 nixos xss-lock[1818]: xlock: xio_error Feb 20 14:00:27 nixos kernel: traps: xss-lock[1818] trap int3 ip:7f5bcc052c75 sp:7ffc3e214e00 error:0 in libglib-2.0.so.0.6200.4[7f5bcc019000+80000] Feb 20 14:00:27 nixos redshift[1815]: Location is temporarily unavailable; Using previous location until it becomes available... Feb 20 14:00:27 nixos xautolock[1817]: X connection to :0 broken (explicit kill or server shutdown). Feb 20 14:00:27 nixos xss-lock[1818]: X connection lost; exiting. Feb 20 14:00:27 nixos urxvtd[1816]: urxvt: X connection to ':0' broken, unable to recover, exiting. Feb 20 14:00:27 nixos pulseaudio[1770]: X connection to :0 broken (explicit kill or server shutdown). Feb 20 14:00:27 nixos systemd[1691]: xautolock.service: Main process exited, code=exited, status=1/FAILURE Feb 20 14:00:27 nixos systemd[1691]: xautolock.service: Failed with result 'exit-code'. Feb 20 14:00:27 nixos systemd[1691]: urxvtd.service: Main process exited, code=exited, status=1/FAILURE Feb 20 14:00:27 nixos systemd[1691]: urxvtd.service: Failed with result 'exit-code'. Feb 20 14:00:27 nixos xmonad[1819]: polybar|warn: Termination signal received, shutting down... Feb 20 14:00:27 nixos systemd-coredump[13791]: Failed to connect to coredump service: Connection refused Feb 20 14:00:27 nixos systemd[1691]: xss-lock.service: Main process exited, code=dumped, status=5/TRAP Feb 20 14:00:27 nixos systemd[1691]: xss-lock.service: Failed with result 'core-dump'. Feb 20 14:00:27 nixos systemd-coredump[13792]: Failed to connect to coredump service: Connection refused Feb 20 14:00:27 nixos systemd[1691]: emacs.service: Main process exited, code=dumped, status=6/ABRT Feb 20 14:00:27 nixos systemd[1691]: emacs.service: Failed with result 'core-dump'. Feb 20 14:00:27 nixos systemd[1691]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE Feb 20 14:00:27 nixos systemd[1691]: pulseaudio.service: Failed with result 'exit-code'. Feb 20 14:00:27 nixos systemd[1691]: xautolock.service: Service RestartSec=100ms expired, scheduling restart. Feb 20 14:00:27 nixos systemd[1691]: xautolock.service: Scheduled restart job, restart counter is at 1. Feb 20 14:00:27 nixos systemd[1691]: emacs.service: Service RestartSec=100ms expired, scheduling restart. Feb 20 14:00:27 nixos systemd[1691]: emacs.service: Scheduled restart job, restart counter is at 1. Feb 20 14:00:27 nixos systemd[1691]: Stopped Emacs: the extensible, self-documenting text editor. Feb 20 14:00:27 nixos systemd[1691]: Starting Emacs: the extensible, self-documenting text editor... Feb 20 14:00:27 nixos systemd[1691]: Stopped xautolock service. Feb 20 14:00:27 nixos systemd[1691]: Started xautolock service. Feb 20 14:00:27 nixos xautolock[13794]: Couldn't connect to :0 Feb 20 14:00:27 nixos systemd[1691]: xautolock.service: Main process exited, code=exited, status=1/FAILURE Feb 20 14:00:27 nixos systemd[1691]: xautolock.service: Failed with result 'exit-code'. ```

List of things I believe to be same in our setups:

Metadata

my machine:

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.17, NixOS, 20.03pre212208.8130f3c1c2b (Markhor)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.2`
 - channels(root): `"nixos-20.03pre212208.8130f3c1c2b, nixos-hardware"`
 - channels(marek): `"nixos-20.03pre212208.8130f3c1c2b"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

his machine (seems identical):

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.17, NixOS, 20.03pre212208.8130f3c1c2b (Markhor)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.2`
 - channels(root): `"nixos-20.03pre212208.8130f3c1c2b, nixos-hardware"`
 - channels(jakub): `"nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
vcunat commented 4 years ago

It might be unrelated, but some Intel GPUs have relatively frequent issues with 5.4 kernels. If it seems so, I'd recommend switching e.g. back to 4.19 in those cases. EDIT: cross-link with more discussion: https://github.com/NixOS/nixpkgs/pull/78713

turboMaCk commented 4 years ago

@vcunat it actually might be it! I'm also using i915. I'll try to downgrade the kernelPackages and report here later if it helped.

turboMaCk commented 4 years ago

it's been a few days and I haven't got any freezes after downgrading kernelPackages - closing. Thanks @vcunat for pointing me in the right direction!