i3 / i3

A tiling window manager for X11
https://i3wm.org/
BSD 3-Clause "New" or "Revised" License
9.54k stars 778 forks source link

Chromium-based applications periodically "freeze" #3698

Closed 0o220 closed 4 years ago

0o220 commented 5 years ago

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

For the past 2–3 months (but never before then, so perhaps this issue began with the i3 upgrade to 4.16.1 on 27 Jan 2019), Chromium-based applications such as qutebrowser and Slack will periodically "freeze", requiring a SIGKILL and restart. I'll be able to move my cursor across the application window, but it won't respond to input from the keyboard or mouse. If I switch to another workspace and then back again, the frozen application's window won't be redrawn—that window will simply continue to display whatever was on the last workspace I just switched from. Affected applications tend to display this behavior at the same time. I've been monitoring application-specific logs without finding any clues to the root cause. This issue appears to be related to #1720.

Expected Behavior

Applications should not freeze.

Reproduction Instructions

I've not been able to trigger this issue manually. It's quite unpredictable. I can go days without it happening—but sometimes, it'll occur several times back-to-back with no apparent cause.

Environment

Output of i3 --moreversion 2>&-:

i3 version: 4.16.1 (2019-01-27)
set $mod Mod4
font pango:monospace 8
floating_modifier $mod
bindsym $mod+Return exec "$HOME/.config/i3/cwd.sh"
bindsym $mod+Shift+q kill
bindsym $mod+d exec dmenu_run
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+g split h
bindsym $mod+v split v
bindsym $mod+f fullscreen toggle
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
set $ws1 "term"
set $ws2 "web"
set $ws3 "chat"
set $ws4 "edit"
set $ws5 "read"
set $ws6 "vm"
set $ws7 "vnc"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+t exec "$HOME/.config/i3blocks/update.sh"
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
mode "resize" {
        bindsym h resize shrink width 10 px or 10 ppt
        bindsym j resize grow height 10 px or 10 ppt
        bindsym k resize shrink height 10 px or 10 ppt
        bindsym l resize grow width 10 px or 10 ppt
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
bar {
        status_command i3blocks
          tray_output none
        font pango:source code pro, 9
}
gaps inner 10
gaps outer 5
bindsym XF86AudioMute         exec amixer -q set Master toggle;      exec pkill -RTMIN+10 i3blocks
bindsym XF86AudioRaiseVolume  exec amixer -q set Master 2dB+ unmute; exec pkill -RTMIN+10 i3blocks
bindsym XF86AudioLowerVolume  exec amixer -q set Master 2dB- unmute; exec pkill -RTMIN+10 i3blocks
bindsym XF86AudioMicMute      exec amixer set Capture toggle;        exec pkill -RTMIN+9 i3blocks
bindsym XF86MonBrightnessDown exec xbacklight -dec 5;                exec pkill -RTMIN+9 i3blocks
bindsym XF86MonBrightnessUp   exec xbacklight -inc 5;                exec pkill -RTMIN+9 i3blocks
exec --no-startup-id feh --bg-fill $HOME/.config/img.png
new_window 1pixel
bindsym $mod+shift+z exec i3lock -tfi $HOME/.config/img.png
exec --no-startup-id redshift -l `cat $HOME/.config/i3blocks/coord.txt | tr -d '\n'` &
exec --no-startup-id $HOME/.dropbox-dist/dropboxd &
bindsym Shift+$mod+bracketright move workspace to output right
bindsym Shift+$mod+bracketleft move workspace to output left
- Linux Distribution & Version: 5.0.7-arch1-1-ARCH x86_64
- Are you using a compositor (e.g., xcompmgr or compton): No
i3bot commented 5 years ago

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

0o220 commented 5 years ago

@ohfill, @KubaJastrz, are you still experiencing this issue?

aksel commented 5 years ago

Happens for me as well, but I haven't been able to reproduce it either.

KubaJastrz commented 5 years ago

Yes, I see it almost everyday for the past few months. As I said here, I'd connect this issue with hardware acceleration in blink-based software. After appending --disable-gpu flag to executables the issue doesn't occur.

For software like Figma, that requires hardware acceleration, you can temporarily solve the bug by killing gpu process:

alias find-gpu='ps aux | grep gpu-process | grep'

function kill-gpu() {
   find-gpu $1 | egrep -o -e "[0-9]+" | head -n 1 | xargs -p kill
}

And just call kill-gpu <process-name> everytime it happens.

JeffLabonte commented 5 years ago

It has happen to me with a bunch of electron apps! Not only with I3 but with Awesome also!

orestisfl commented 5 years ago

Signs point to this being a bug in chromium, someone should find the bug in their tracker or open a new issue there and reply with the link here

but never before then, so perhaps this issue began with the i3 upgrade to 4.16.1 on 27 Jan 2019

4.16.1 included only a handful of regression fixes so this is probably a coincidence.

KubaJastrz commented 5 years ago

I'm fairly certain that this issue started happening after this upgrade: https://pastebin.com/raw/urbwzv6p

KubaJastrz commented 5 years ago

May be related: https://bugs.chromium.org/p/chromium/issues/detail?id=370022

coxley commented 5 years ago

This has been plaguing me for months, as well. Example applications that "freeze":

Funny enough, they still accept keyboard-input but they no longer redraw. It happened once while typing this and was able to ^A, ^C to save the comment :stuck_out_tongue:

One additional anecdote that I haven't seen mentioned is that it only happens when I'm using my laptop as a laptop. If I'm connected to a dock (eg: Lenovo Thunderbolt 3 Dock), then it never happens.

$ hwinfo --gfxcard
22: PCI 02.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.386]
  Unique ID: _Znp.Vg1X6XR+hGA
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Model: "Intel VGA compatible controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x5916 
  SubVendor: pci 0x17aa "Lenovo"
  SubDevice: pci 0x224e 
  Revision: 0x02
  Driver: "i915"
  Driver Modules: "i915"
  Memory Range: 0xeb000000-0xebffffff (rw,non-prefetchable)
  Memory Range: 0x60000000-0x6fffffff (ro,non-prefetchable)
  I/O Ports: 0xe000-0xe03f (rw)
  Memory Range: 0x000c0000-0x000dffff (rw,non-prefetchable,disabled)
  IRQ: 169 (83544423 events)
  Module Alias: "pci:v00008086d00005916sv000017AAsd0000224Ebc03sc00i00"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

Primary display adapter: #22
coxley commented 5 years ago

The ArchLinux wiki for Intel Graphics refers to the previously mentioned chromium issue: https://wiki.archlinux.org/index.php/intel_graphics#DRI3_issues

The recommendation is to change from DRI 3 -> DRI 2. Will see if this works but I don't like that the issue has been open for 5 years and this only started this year for me. 🍺(ツ)

tbabej commented 5 years ago

Also experiencing this with i3 4.16.1 on Fedora 30 (with Chromium, Riot and Keybase).

mattiabiondi commented 5 years ago

Same problem here with i3 4.17.1 on Arch Linux (kernel version 5.3.5). The problem appears with all chromium-based application (Google Chrome, Atom, Boostnote, Discord, Visual Studio).

The ArchLinux wiki for Intel Graphics refers to the previously mentioned chromium issue: https://wiki.archlinux.org/index.php/intel_graphics#DRI3_issues

The recommendation is to change from DRI 3 -> DRI 2. Will see if this works but I don't like that the issue has been open for 5 years and this only started this year for me. 🍺(ツ)

It seems to work for me! But with this solution after some time my touchpad starts freezing until it stops working (everything else continues working). Maybe it's a DRI2 related problem.

coxley commented 5 years ago

@mattiabiondi

But with this solution after some time my touchpad starts freezing until it stops working

As in your touchscreen or the touch/trackpad? Asking because my touch screen stops working periodically and I never associated with this issue. :P

mattiabiondi commented 5 years ago

@coxley

As in your touchscreen or the touch/trackpad? Asking because my touch screen stops working periodically and I never associated with this issue. :P

I was referring to the touch/trackpad, I have a touchscreen too but I didn't try it.

gomily commented 4 years ago

I have also been running into this lately, it triggers very reliably with both chrome and inkscape open for me. I have vertically oriented monitors using xrandr. Inkscape stops drawing/refreshing periodically and then comes back.

i3 version 4.16.1 (2019-01-27) Chrome 78.0.3904.108 (Official Build) (64-bit)

My colleague with exact same versions but horizontal displays don't seem to be suffering any problems and I didn't have problems until I turned both my 1440p monitors vertical.

Edit: Inkscape and chrome still work, but it appears as if they (especially inkscape) stop being redrawn after damage some times until it randomly starts again.

nickclyde commented 4 years ago

I am having this issue as well. I am able to reproduce it consistently - it occurs with Slack any time I receive a direct message. The app receives the message (I hear the ding sound) but the window freezes and won't redraw for about a minute or so. I tried changing my intel driver to use DRI 2 with no success.

 nick@razer > i3 --moreversion 2>&- || i3 --version
Binary i3 version:  4.17.1 (2019-08-30) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.17.1 (2019-08-30) (pid 2362)abort…)
Loaded i3 config: /home/nick/.config/i3/config (Last modified: Tue 10 Dec 2019 08:48:27 AM PST, 98914 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: /usr/bin/i3
- Linux Distribution & Version: 5.4.2-arch1-1-ARCH x86_64
- Are you using a compositor (e.g., xcompmgr or compton): Yes, compton

I used a minimal setup to reproduce the issue and uploaded logs here: https://logs.i3wm.org/logs/5734685623713792.bz2

Hopefully that helps!

mattiabiondi commented 4 years ago

@ClydeDroid are you using a notification daemon? If not, you can try installing one like Dunst.

Also, since I've installed Picom (ex Compton) my problem has disappeared.

nickclyde commented 4 years ago

I am using i3 with KDE, so I kept the Plasma notifications enabled. Now that you mention it, though, the notifications aren't appearing, so maybe that has something to do with the issue.

I am using this fork of picom that allows drawing rounded windows: https://github.com/sdhand/compton

The issue is reproducible with and without compton running, though.

nickclyde commented 4 years ago

@mattiabiondi Installing Dunst fixed the issue!! Thanks a bunch!!

mattiabiondi commented 4 years ago

@mattiabiondi Installing Dunst fixed the issue!! Thanks a bunch!!

@ClydeDroid Perfect! I'm glad it helped :)

noperator commented 4 years ago

After troubleshooting this issue for the better part of a year, I opted to reinstall my OS in hopes that the problem won't reappear. Will report back here if I experience freezing again.

JeffLabonte commented 4 years ago

I am now running NixOS and it works fine. I will report back as well if it happens again! :)

orestisfl commented 4 years ago

I see that there are a lot of related issues regarding freezing in qutebrowser, electron etc:

https://github.com/qutebrowser/qutebrowser/issues/4809 https://github.com/qutebrowser/qutebrowser/issues/4641 https://github.com/electron/electron/issues/21415

Closing as not i3-specific