baskerville / bspwm

A tiling window manager based on binary space partitioning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bspwm Hung on select() and Become Unresponsive

walwan opened this issue · comments

commented

description

I am (randomly) experiencing an issue similar to #1398 #1318 #683 where

  1. the mouse moves, but no click on other application windows takes effect, except when clicking on polybar (I use the bspwm plugin on polybar and I can switch desktop by clicking the numbers on polaybar. I can interact with other polaybar plugins as well.);
  2. no window would respond to keyboard inputs. But I can switch tty with ctrl+alt+FnX.

The difference between my case and previous issues are

  1. there is no bspc command that gets stuck;
  2. I am not using player-mpris-tail scripts in polybar;
  3. the running state of bspwm is not T as in #1146;
  4. I am not aware of any use of bspc subscribe --fifo.

troubleshooting steps tried

I previously suspect the freezing is caused by a particular key press/combination, so I used screenkey to log all my key presses. It turns out to be rather irrelevant to what I pressed before wm freezes. Another interesting thing is that after the wm freezes, if I press any key combination with super or ctrl (like super + h), the screenkey will only show the second key pressed (like 'h' in the case of super + h).

I tried to switch to tty and restart the wm with bspc, but the problem existed after a restart. Killing polybar did not help either.

I am currently using a bspwm with debug symbols, and the backtrace shows the execution is in select() as shown below

(gdb) attach 1844
Attaching to process 1844
Reading symbols from /usr/bin/bspwm...
Reading symbols from /usr/lib/libxcb.so.1...
(No debugging symbols found in /usr/lib/libxcb.so.1)
Reading symbols from /usr/lib/libxcb-util.so.1...
(No debugging symbols found in /usr/lib/libxcb-util.so.1)
Reading symbols from /usr/lib/libxcb-keysyms.so.1...
(No debugging symbols found in /usr/lib/libxcb-keysyms.so.1)
Reading symbols from /usr/lib/libxcb-icccm.so.4...
(No debugging symbols found in /usr/lib/libxcb-icccm.so.4)
Reading symbols from /usr/lib/libxcb-ewmh.so.2...
(No debugging symbols found in /usr/lib/libxcb-ewmh.so.2)
Reading symbols from /usr/lib/libxcb-randr.so.0...
(No debugging symbols found in /usr/lib/libxcb-randr.so.0)
Reading symbols from /usr/lib/libxcb-xinerama.so.0...
(No debugging symbols found in /usr/lib/libxcb-xinerama.so.0)
Reading symbols from /usr/lib/libxcb-shape.so.0...
(No debugging symbols found in /usr/lib/libxcb-shape.so.0)
Reading symbols from /usr/lib/libc.so.6...
(No debugging symbols found in /usr/lib/libc.so.6)
Reading symbols from /usr/lib/libXau.so.6...
(No debugging symbols found in /usr/lib/libXau.so.6)
Reading symbols from /usr/lib/libXdmcp.so.6...
(No debugging symbols found in /usr/lib/libXdmcp.so.6)
Reading symbols from /lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

(gdb) bt
0x00007fa9b28c5804 in select () from /usr/lib/libc.so.6

(gdb) bt 1
#0  0x00007fa9b28c5804 in select () from /usr/lib/libc.so.6
#1  0x0000558ab2b938de in main (argc=1, argv=0x7ffe891165f8) at src/bspwm.c:221

(gdb) frame 1
#1  0x0000558ab2b938de in main (argc=1, argv=0x7ffe891165f8) at src/bspwm.c:221
warning: Source file is more recent than executable.
221			if (select(max_fd + 1, &descriptors, NULL, NULL, NULL) > 0) {

(gdb) p max_fd
$1 = 4

(gdb) p descriptors
$2 = {__fds_bits = {24, 0 <repeats 15 times>}}

(gdb) q
Detaching from program: /usr/bin/bspwm, process 1844
[Inferior 1 (process 1844) detached]

The output of lsof -p$(pgrep -x bspwm) seems the same as an normal wm:

COMMAND  PID       USER   FD   TYPE             DEVICE SIZE/OFF    NODE NAME
bspwm   1950   USERNAME  cwd    DIR               0,56     1344     267 /home/USERNAME
bspwm   1950   USERNAME  rtd    DIR               0,33      148     256 /
bspwm   1950   USERNAME  txt    REG               0,33   551824 3710284 /usr/bin/bspwm
bspwm   1950   USERNAME  mem    REG               0,31          3710284 /usr/bin/bspwm (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          3415779 /usr/lib/libXdmcp.so.6.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          3415790 /usr/lib/libXau.so.6.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          2841763 /usr/lib/libc.so.6 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          3415876 /usr/lib/libxcb-shape.so.0.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          3415891 /usr/lib/libxcb-xinerama.so.0.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          3415861 /usr/lib/libxcb-randr.so.0.1.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          2849224 /usr/lib/libxcb-ewmh.so.2.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          2849227 /usr/lib/libxcb-icccm.so.4.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          2849181 /usr/lib/libxcb-keysyms.so.1.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          1343524 /usr/lib/libxcb-util.so.1.0.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          3415909 /usr/lib/libxcb.so.1.1.0 (path dev=0,33)
bspwm   1950   USERNAME  mem    REG               0,31          2841754 /usr/lib/ld-linux-x86-64.so.2 (path dev=0,33)
bspwm   1950   USERNAME    0r  FIFO               0,13      0t0   36992 pipe
bspwm   1950   USERNAME    1w   CHR                1,3      0t0       4 /dev/null
bspwm   1950   USERNAME    2w   REG               0,56    80367 5042552 /home/USERNAME/.local/share/sddm/xorg-session.log
bspwm   1950   USERNAME    3u  unix 0x00000000df3d0dde      0t0   31624 type=STREAM (CONNECTED)
bspwm   1950   USERNAME    4u  unix 0x0000000053b11a60      0t0   31625 /tmp/bspwm_0_0-socket type=STREAM (LISTEN)
bspwm   1950   USERNAME    5u  unix 0x000000002314e97a      0t0   31664 /tmp/bspwm_0_0-socket type=STREAM (CONNECTED)

environment

  • Archlinux x86_64 6.0.11-zen1-1-zen
  • bspwm: latest git commit (527864d)

Thanks in advance!

commented

Oh I just found this should be a normal behavior. Closing the issue.

What do you mean by "normal behavior"?
I'm facing a similar issue of bspwm abruptly freezing, but in my case it only occurs after a long uptime (around 30-40 hours) and I'm dying to figure out a fix for this.