Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcb fatal error[Bug]: #2798

Closed
4 tasks done
Betweenthelines opened this issue Aug 22, 2022 · 24 comments · Fixed by #2813
Closed
4 tasks done

xcb fatal error[Bug]: #2798

Betweenthelines opened this issue Aug 22, 2022 · 24 comments · Fixed by #2813

Comments

@Betweenthelines
Copy link

Betweenthelines commented Aug 22, 2022

Checklist

  • I have read the appropriate section in the contributing guidelines
  • I believe this issue is a problem with polybar itself and not a misconfiguration on my part
  • I have checked the known issues page for this problem.
  • I have followed the debugging guide to narrow down the problem to a minimal config.

Steps to reproduce

polybar

Minimal config

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[colors]
BG =  #0C0E14
BG1 = #263035
BG2 = #2B353A
BG3 = #303A3F
BG4 = #353F44
BG5 = #3A4449
BG6 = #3F494E
BGA = #5C6F7B
FG = #C4C7C5
AC = #4DD0E1
BLACK = #000000
WHITE = #FFFFFF
RED = #EC7875
GREEN = #61C766
YELLOW = #FDD835
BLUE = #42A5F5
PURPLE = #BA68C8
CYAN = #4DD0E1
TEAL = #00B19F
AMBER = #FBC02D
ORANGE = #E57C46
BROWN = #AC8476
GRAY = #8C8C8C
BLUEGRAY = #6D8895
PINK = #EC407A
LIME = #B9C244
INDIGO = #6C77BB

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[bar/mybar]
monitor = eDP-1
width = 100%
height = 24pt
radius = 6
;screenchange-reload = true

pseudo-transparency = true
transparency = true
; dpi = 96

background = ${colors.BG}
foreground = ${colors.FG}

line-size = 3pt

;border-size = 1pt
;border-color = #FFFFFF

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.BG}

font-0 = monospace;2
font-1 = FontAwesome:size=10;1
font-2 = Iosevka Nerd Font:size=10;1
font-3 = Material Design Icons Desktop:size=10;1


modules-left = xworkspaces xwindow
modules-center = date brightness
modules-right = filesystem pulseaudio cpu memory wlan eth 
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true

; tray-position = right

; wm-restack = generic
; wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

[module/xworkspaces]
type = internal/xworkspaces
pin-workspaces = true
enable-click = true
enable-scroll = true
icon-0 = 1;
icon-1 = 2;
icon-2 = 3;
icon-3 = 4;
icon-4 = 5;
icon-default = 
format = <label-state>
format-background = ${colors.BG}
format-font = 1
label-monitor = %name%
label-active = 
label-active-foreground = ${colors.PINK}
label-occupied = 
label-occupied-foreground = ${colors.CYAN}
label-urgent = 
label-urgent-foreground = ${colors.GREEN}
label-empty = %icon%
label-empty-foreground = ${colors.CYAN}
label-active-padding = 1
label-urgent-padding = 1
label-occupied-padding = 1
label-empty-padding = 1

[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%


[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
format-mounted-background = ${colors.BG}
format-mounted-prefix =  
format-mounted-prefix-font = 2
format-mounted-prefix-foreground = ${colors.ORANGE}
format-unmounted-prefix = 
format-unmounted-prefix-font = 2
format-unmounted-background = ${colors.BG1}
format-unmounted-prefix-foreground = ${colors.ORANGE}


[module/pulseaudio]
type = internal/pulseaudio
format-volume = <ramp-volume> <label-volume>
format-volume-background = ${colors.BG}
format-muted = <label-muted>
format-muted-prefix = 
format-muted-prefix-font = 2
format-muted-prefix-foreground = ${colors.BGA}
format-muted-background = ${colors.BG}
label-muted = MUTE
label-muted-foreground = ${colors.BGA}
ramp-volume-0 =  
ramp-volume-1 = 
ramp-volume-2 = 
ramp-volume-3 =  
ramp-volume-font = 2
ramp-volume-foreground = ${colors.INDIGO}
label-volume = %percentage%%


[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
label-layout = %layout%
label-layout-foreground = ${colors.primary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}




[module/memory]
type = internal/memory
interval = 2
format-prefix = ""
format-prefix-foreground = ${colors.BLUE}
label = " %mb_used%"

[module/cpu]
type = internal/cpu
interval = 2
format = <label>
format-prefix =  
format-prefix-font = 2
format-prefix-foreground = ${colors.YELLOW}
format-background = ${colors.BG}
label = %percentage:2%%


[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected

[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#F0C674}%{F-} %essid% %downspeed%%{A}
interval = 1.0
accumulate-stats = true
unknown-as-up = true
format-connected = <ramp-signal> <label-connected>
format-connected-background = ${colors.BG}
format-disconnected = <label-disconnected>
format-disconnected-prefix = ""
format-disconnected-prefix-font = 2
format-disconnected-foreground = ${colors.BGA}
format-disconnected-background = ${colors.BG}
label-disconnected = %{ifname%%essid% }
; Only applies if <ramp-signal> is used
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.PURPLE}
ramp-signal-font = 2


[module/eth]
inherit = network-base
interface-type = wired
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%

[module/date]
type = internal/date
interval = 1
time = %I:%M %p
time-alt = %b %d, %G
format = <label>
format-prefix = ""
format-prefix-font = 2
format-prefix-foreground = ${colors.CYAN}
format-background = ${colors.BG}
label = %time%




[module/brightness]
type = internal/backlight
; Use the following command to list available cards:
; $ ls -1 /sys/class/backlight/
;card = ${system.graphics_card}
card = intel_backlight
enable-scroll = true
format = <ramp> <label>
;format-prefix=
label = %percentage%%
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-3 = 
ramp-4 = 
ramp-5 = 
ramp-6 = 
ramp-7 = 
ramp-8 = 
ramp-9 = 
ramp-foreground = ${colors.TEAL}






[settings]
screenchange-reload = true
pseudo-transparency = true

; vim:ft=dosini

Polybar log

notice: Parsing config file: /home/dreaming/.config/polybar/config.ini
notice: Listening for IPC messages (PID: 4684)
notice: Loading module 'xworkspaces' of type 'internal/xworkspaces'
notice: Loading module 'xwindow' of type 'internal/xwindow'
notice: Loading module 'date' of type 'internal/date'
notice: Loading module 'brightness' of type 'internal/backlight'
notice: Loading module 'filesystem' of type 'internal/fs'
notice: Loading module 'pulseaudio' of type 'internal/pulseaudio'
notice: pulseaudio: using default sink alsa_output.pci-0000_00_1f.3.analog-stereo
notice: Loading module 'cpu' of type 'internal/cpu'
notice: Loading module 'memory' of type 'internal/memory'
notice: Loading module 'wlan' of type 'internal/network'
notice: module/wlan: Discovered wireless interface wlp1s0
notice: Loading module 'eth' of type 'internal/network'
error: Disabling module "eth" (reason: No interface found for type 'wired')
notice: Loaded 9 modules
notice: Loaded font "monospace" (name=Noto Sans Mono, offset=2, file=/usr/share/fonts/noto/NotoSansMono-Regular.ttf)
notice: Loaded font "FontAwesome:size=10" (name=FontAwesome, offset=1, file=/usr/share/fonts/awesome-terminal-fonts/fontawesome-regular.ttf)
notice: Loaded font "Iosevka Nerd Font:size=10" (name=Iosevka, offset=1, file=/usr/share/fonts/TTF/Iosevka Nerd Font Complete.ttf)
notice: Loaded font "Material Design Icons Desktop:size=10" (name=Noto Sans, offset=1, file=/usr/share/fonts/noto/NotoSans-Regular.ttf)
error: background_manager: Failed to copy slice of root pixmap (XCB_MATCH (8))
error: Fatal Error in eventloop: XCB_MATCH (8)
notice: Termination signal received, shutting down...
error: /home/main-builder/pkgwork/src/polybar/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked
➜  ~ 
➜  ~ polybar 
notice: Parsing config file: /home/dreaming/.config/polybar/config.ini
notice: Listening for IPC messages (PID: 4700)
notice: Loading module 'xworkspaces' of type 'internal/xworkspaces'
notice: Loading module 'xwindow' of type 'internal/xwindow'
notice: Loading module 'date' of type 'internal/date'
notice: Loading module 'brightness' of type 'internal/backlight'
notice: Loading module 'filesystem' of type 'internal/fs'
notice: Loading module 'pulseaudio' of type 'internal/pulseaudio'
notice: pulseaudio: using default sink alsa_output.pci-0000_00_1f.3.analog-stereo
notice: Loading module 'cpu' of type 'internal/cpu'
notice: Loading module 'memory' of type 'internal/memory'
notice: Loading module 'wlan' of type 'internal/network'
notice: module/wlan: Discovered wireless interface wlp1s0
notice: Loading module 'eth' of type 'internal/network'
error: Disabling module "eth" (reason: No interface found for type 'wired')
notice: Loaded 9 modules
notice: Loaded font "monospace" (name=Noto Sans Mono, offset=2, file=/usr/share/fonts/noto/NotoSansMono-Regular.ttf)
notice: Loaded font "FontAwesome:size=10" (name=FontAwesome, offset=1, file=/usr/share/fonts/awesome-terminal-fonts/fontawesome-regular.ttf)
notice: Loaded font "Iosevka Nerd Font:size=10" (name=Iosevka, offset=1, file=/usr/share/fonts/TTF/Iosevka Nerd Font Complete.ttf)
notice: Loaded font "Material Design Icons Desktop:size=10" (name=Noto Sans, offset=1, file=/usr/share/fonts/noto/NotoSans-Regular.ttf)
error: background_manager: Failed to copy slice of root pixmap (XCB_MATCH (8))
error: Fatal Error in eventloop: XCB_MATCH (8)
notice: Termination signal received, shutting down...
error: /home/main-builder/pkgwork/src/polybar/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked

Expected behavior

polybar should work with bars launched

Actual behavior

I don't fully know how but it gives error about xcb error

Window Manager and Version

xfwm4 4.16.1-3

Linux Distribution

Arch linux

Polybar version

polybar 3.6.3-60-g6ccecbfc

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /usr/sbin/c++
Compiler flags: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wsuggest-override
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wall -Wextra -Wpedantic -Wsuggest-override  -Wall -Wextra -Wpedantic -Wsuggest-override

Additional Context / Screenshots

screenshot_2022-08-22-10_1920x1080

@Betweenthelines
Copy link
Author

It was working last night. I updated and it just broke

@patrick96
Copy link
Member

How are you setting your wallpaper image?

@Chesirethot
Copy link

How are you setting your wallpaper image?

It's through xfconf query xfce4 xfdesktop

@patrick96
Copy link
Member

Hmm, I'm guessing when disabling pseudo-transparency in the [settings] section, this no longer happens, right?

@Betweenthelines
Copy link
Author

Hmm, I'm guessing when disabling pseudo-transparency in the [settings] section, this no longer happens, right?

It did not solve the problem it still crashes with same problem. I use picom but even after killing picom and disabling it. It crashes nonetheless.

I dont fully understand this line also
error: /home/main-builder/pkgwork/src/polybar/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked

@Chesirethot
Copy link

Ok so a new discovery. Whenever I set my background through feh and then use polybar it works but will crash again if launched again. So everytime feh has to be used.
I am using xfce so feh is actually meaningless to me.
I think background_manager is detecting something else below xfdesktop channel which is not letting polybar launch unhindered.

@patrick96
Copy link
Member

It did not solve the problem it still crashes with same problem. I use picom but even after killing picom and disabling it. It crashes nonetheless.

Are you using the config you posted above? I don't see any way for this error to happen with this config. It theoretically can only happen with pseudo-transparency or with a tray.
Are you sure you disabled pseudo-transparency in the [settings] section?

I dont fully understand this line also
error: /home/main-builder/pkgwork/src/polybar/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked

That's just an internal error caused by the previous errors, it's not really relevant.


Alright, if setting the background with feh doesn't crash polybar, it means that polybar makes some wrong assumptions about the way the wallpaper is set and xfce4 violates those assumptions.

Can you run polybar with trace logging (polybar -l trace ...) and post the log output of that?
I think I know what the issue is, but I need to confirm (I suspect the wallpaper pixmap depth doesn't match the root window depth).

Could you also post the output of the following command? xdpyinfo | grep "depth of root window"

@Betweenthelines
Copy link
Author

Actually I updated system and it started working.
output of xdpyinfo | grep "depth of root window" is depth of root window: 24 planes

@Betweenthelines
Copy link
Author

For more clarifications I still use xfdesktop to set wallpaper and now the system works flawlessly. Earlier I had to run killall -HUP xfdesktop around 6-7 times to kill xfdesktop then have feh choose my background. Only then polybar ran. And yes I had to kill it all 7 times for it to work

@patrick96
Copy link
Member

So you never experiences this issue again? Do you know which packages you updated? Especially the xfce ones?

@Betweenthelines
Copy link
Author

Update broke again. My linux updated through a cron script and this time xfdesktop update broke polybar again

@patrick96
Copy link
Member

In that case, can you post the output of polybar crashing with trace logging?

Also, can you figure out which packages where upgraded (and between which versions)?

@Betweenthelines
Copy link
Author

Betweenthelines commented Sep 4, 2022

It gives the same error

notice: Parsing config file: /home/dreaming/.config/polybar/config.ini
notice: Listening for IPC messages (PID: 2796)
notice: Loading module 'xworkspaces' of type 'internal/xworkspaces'
error: Invalid value for "module/xworkspaces.format-background", using default value (reason: The reference ${color.PINK} does not exist (no fallback set))
notice: Loading module 'xwindow' of type 'internal/xwindow'
notice: Loading module 'date' of type 'internal/date'
notice: Loading module 'brightness' of type 'internal/backlight'
notice: Loading module 'filesystem' of type 'internal/fs'
notice: Loading module 'pulseaudio' of type 'internal/pulseaudio'
notice: pulseaudio: using default sink alsa_output.pci-0000_00_1f.3.analog-stereo
notice: Loading module 'cpu' of type 'internal/cpu'
notice: Loading module 'memory' of type 'internal/memory'
notice: Loading module 'wlan' of type 'internal/network'
notice: module/wlan: Discovered wireless interface wlp1s0
notice: Loading module 'eth' of type 'internal/network'
error: Disabling module "eth" (reason: No interface found for type 'wired')
notice: Loaded 9 modules
notice: Loaded font "monospace" (name=Noto Sans Mono, offset=2, file=/usr/share/fonts/noto/NotoSansMono-Regular.ttf)
notice: Loaded font "FontAwesome:size=10" (name=FontAwesome, offset=1, file=/usr/share/fonts/awesome-terminal-fonts/fontawesome-regular.ttf)
notice: Loaded font "Iosevka Nerd Font:size=10" (name=Iosevka, offset=1, file=/usr/share/fonts/TTF/Iosevka Nerd Font Complete.ttf)
notice: Loaded font "Material Design Icons Desktop:size=10" (name=Noto Sans, offset=1, file=/usr/share/fonts/noto/NotoSans-Regular.ttf)
error: background_manager: Failed to copy slice of root pixmap (XCB_MATCH (8))
error: Fatal Error in eventloop: XCB_MATCH (8)
notice: Termination signal received, shutting down...
error: /usr/src/debug/polybar-3.6.3/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked

my last upgraded packages found by
grep -i upgraded /var/log/pacman.log | awk '{print $4}'
are

glibc
libcap
harfbuzz
libjpeg-turbo
llvm-libs
gnutls
sqlite
gcc-libs
python
pacman
archlinux-keyring
binutils
libtool
mesa
archlinux-keyring
ffmpeg
amd-ucode
arc-gtk-theme-git
linux-api-headers
tzdata
iana-etc
xz
lz4
libtiff
babl
file
util-linux-libs
libevent
libtirpc
libtasn1
systemd-libs
util-linux
device-mapper
cryptsetup
libnftnl
iptables
libnghttp2
ca-certificates-mozilla
curl
libelf
systemd
systemd-sysvcompat
libbpf
iproute2
nettle
libsysprof-capture
gnupg
gpgme
libarchive
pacman-mirrorlist
mpfr
libxml2
base
libuv
bind
bluez
bluez-libs
nspr
nss
libnm
gdk-pixbuf2
xorgproto
libxau
pango
librsvg
gtk-update-icon-cache
iso-codes
glib-networking
tracker3
libpciaccess
libdrm
libglvnd
xkeyboard-config
blueman
bluez-utils
breeze-icons-git
btrfs-progs
chaotic-mirrorlist
libbluray
libssh
faudio
firefox
ldns
gcr
git
libheif
netpbm
graphviz
grub
hwloc
imagemagick
intel-ucode
lib32-krb5
lib32-curl
lib32-systemd
lib32-libxml2
lib32-mesa
lib32-faudio
lib32-gnutls
lib32-libnghttp2
lib32-libtiff
lib32-librsvg
libxslt
lib32-libxslt
lib32-vulkan-intel
libatomic_ops
libevdev
libfontenc
libinih
libmm-glib
poppler
xmlsec
libreoffice-fresh
liburcu
libwacom
libwpe
libxcvt
libxfont2
lightdm
linux
linux-firmware-whence
linux-firmware
lvm2
mobile-broadband-provider-info
nano
ndctl
nerd-fonts-fira-code
wpa_supplicant
slang
networkmanager
ninja
openpmix
openmpi
poppler-glib
python-attrs
python-nspektr
python-ordered-set
python-pydantic
python-trove-classifiers
python-validate-pyproject
python-setuptools
qbittorrent
qogir-gtk-theme-git
qt5-base
rsync
suitesparse
taglib
tumbler
webkit2gtk-4.1
whitesur-gtk-theme-git
wine-staging
xdg-user-dirs
xfce4-notifyd
xfce4-panel
xfce4-pulseaudio-plugin
xfdesktop
xfsprogs

@patrick96
Copy link
Member

I need the polybar output with trace logging, it contains some debug information that should be helpful here. You can get that by running the polybar command as you would, but add the -l trace commandline arguments.

grep -i upgraded /var/log/pacman.log | awk '{print $4}'

This command generally gives you all packages you ever upgraded (or at least since you last deleted pacman.log).

@Betweenthelines
Copy link
Author

Betweenthelines commented Sep 4, 2022

output of polybar -l trace is

❯ polybar -l trace
notice: Parsing config file: /home/dreaming/.config/polybar/config.ini
- config_parser: Parsing /home/dreaming/.config/polybar/config.ini
- config: Inheriting keys from "network-base" in "module/eth"
- config: Inheriting keys from "network-base" in "module/wlan"
* Created legacy ipc fifo at '/tmp/polybar_mqueue.3838'
* Opening ipc socket at '/run/user/1000/polybar/ipc.3838.sock'
notice: Listening for IPC messages (PID: 3838)
* Loaded monitor eDP1 (1920x1080+0+0)
* Configured DPI = 96x96
* Bar geometry: 1920x32+0+0; Borders: 0,0,0,0
- bar: Attach X event sink
- bar: Attach signal receiver
- controller: Setup user-defined modules
notice: Loading module 'xworkspaces' of type 'internal/xworkspaces'
error: Invalid value for "module/xworkspaces.format-background", using default value (reason: The reference ${color.PINK} does not exist (no fallback set))
notice: Loading module 'xwindow' of type 'internal/xwindow'
notice: Loading module 'date' of type 'internal/date'
notice: Loading module 'brightness' of type 'internal/backlight'
- module/brightness: Attach inotify at /sys/class/backlight/intel_backlight/actual_brightness
notice: Loading module 'filesystem' of type 'internal/fs'
notice: Loading module 'pulseaudio' of type 'internal/pulseaudio'
- pulseaudio: started mainloop
notice: pulseaudio: using default sink alsa_output.pci-0000_00_1f.3.analog-stereo
notice: Loading module 'cpu' of type 'internal/cpu'
notice: Loading module 'memory' of type 'internal/memory'
notice: Loading module 'wlan' of type 'internal/network'
notice: module/wlan: Discovered wireless interface wlp1s0
notice: Loading module 'eth' of type 'internal/network'
- module/eth: Deconstructing
error: Disabling module "eth" (reason: No interface found for type 'wired')
notice: Loaded 9 modules
* Starting application
- controller: Main thread id = 1
* Starting module/xworkspaces
* Starting module/xwindow
* Starting module/date
* Starting module/brightness
- module/date: Thread id = 2
* Starting module/filesystem
- module/brightness: Thread id = 3
* Starting module/pulseaudio
- module/filesystem: Thread id = 4
* Starting module/cpu
- module/pulseaudio: Thread id = 5
* Starting module/memory
- module/cpu: Thread id = 6
* Starting module/wlan
- module/memory: Thread id = 7
* Entering event loop (thread-id=1)
- bar: Create renderer
- module/wlan: Thread id = 8
- renderer: Get TrueColor visual
- renderer: Allocate colormap
- renderer: Allocate output window
- renderer: Allocate window pixmaps
- renderer: Allocate graphic contexts
- renderer: Allocate alignment blocks
- renderer: Allocate cairo components
- renderer: Load fonts
notice: Loaded font "monospace" (name=Noto Sans Mono, offset=2, file=/usr/share/fonts/noto/NotoSansMono-Regular.ttf)
notice: Loaded font "FontAwesome:size=10" (name=FontAwesome, offset=1, file=/usr/share/fonts/awesome-terminal-fonts/fontawesome-regular.ttf)
notice: Loaded font "Iosevka Nerd Font:size=10" (name=Iosevka, offset=1, file=/usr/share/fonts/TTF/Iosevka Nerd Font Complete.ttf)
notice: Loaded font "Material Design Icons Desktop:size=10" (name=Noto Sans, offset=1, file=/usr/share/fonts/noto/NotoSans-Regular.ttf)
- Activate root background manager
- background_manager: Finding root visual
- background_manager: Got root visual with depth 24
- background_manager: Allocating pixmap
- background_manager: Allocating graphics context
- background_manager: Allocating cairo surface
- background_manager: Fetching pixmap
- background_manager: root pixmap (16777290:32) 1920x1080+0+0
- background_manager: Copying from root pixmap (16777290:32) 1920x32+0+0
error: background_manager: Failed to copy slice of root pixmap (XCB_MATCH (8))
error: Fatal Error in eventloop: XCB_MATCH (8)
* Eventloop finished
notice: Termination signal received, shutting down...
- controller: Detach signal receiver
- controller: Stop modules
* module/xworkspaces: Stopping
- module/xworkspaces: Release sleep lock
* Deconstruction of module/xworkspaces took 0 ms.
* module/xwindow: Stopping
- module/xwindow: Release sleep lock
* Deconstruction of module/xwindow took 0 ms.
* module/date: Stopping
- module/date: Release sleep lock
* Deconstruction of module/date took 0 ms.
* module/brightness: Stopping
- module/brightness: Release sleep lock
* Deconstruction of module/brightness took 980 ms.
* module/filesystem: Stopping
- module/filesystem: Release sleep lock
* Deconstruction of module/filesystem took 0 ms.
* module/pulseaudio: Stopping
- module/pulseaudio: Release sleep lock
* Deconstruction of module/pulseaudio took 0 ms.
* module/cpu: Stopping
- module/cpu: Release sleep lock
* Deconstruction of module/cpu took 0 ms.
* module/memory: Stopping
- module/memory: Release sleep lock
* Deconstruction of module/memory took 0 ms.
* module/wlan: Stopping
- module/wlan: Release sleep lock
* Deconstruction of module/wlan took 0 ms.
- module/filesystem: Deconstructing
- module/pulseaudio: Deconstructing
- module/cpu: Deconstructing
- module/memory: Deconstructing
- module/wlan: Deconstructing
- module/date: Deconstructing
- module/brightness: Deconstructing
- module/xworkspaces: Deconstructing
- module/xwindow: Deconstructing
- ipc: Removing named pipe at: /tmp/polybar_mqueue.3838
error: /usr/src/debug/polybar-3.6.3/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked
* Waiting for spawned processes to end
* Reached end of application...

patrick96 added a commit to patrick96/polybar that referenced this issue Sep 4, 2022
The background_manager used the root window depth for creating its
pixmaps, but when the root pixmap has a different depth, this causes the
copy_area_checked call to fail and crash the bar.

We now load the root pixmap before finding the visual and creating the
slice pixmaps.

Fixes polybar#2798
patrick96 added a commit to patrick96/polybar that referenced this issue Sep 4, 2022
The background_manager used the root window depth for creating its
pixmaps, but when the root pixmap has a different depth, this causes the
copy_area_checked call to fail and crash the bar.

We now load the root pixmap before finding the visual and creating the
slice pixmaps.

Fixes polybar#2798
@patrick96
Copy link
Member

Thanks, my hunch was right. I think I was able to fix the issue in #2813. Do you mind trying out the fix and telling me if it worked?

@Betweenthelines
Copy link
Author

I am sorry if I sound rude but I cannot build it from source I will update you when it gets rolled on aur polybar-git

@patrick96
Copy link
Member

No worries. I can provide you a PKGBUILD that directly builds my PR, then you can install it with makepkg -sri.

I'd rather first check that the fix works before merging it.

@patrick96
Copy link
Member

Alright, here is the PKGBUILD which will create the package for my PR:

# Maintainer: Patrick Ziegler <p.ziegler96@gmail.com>
_pkgname=polybar
pkgname="${_pkgname}-git"
pkgver=3.5.6
pkgrel=1
pkgdesc="A fast and easy-to-use status bar"
# aarch64 is not officially supported by polybar, it is only listed here for convenience
arch=("i686" "x86_64" "aarch64")
url="https://github.com/polybar/polybar"
license=("MIT")
depends=("libuv" "cairo" "xcb-util-image" "xcb-util-wm" "xcb-util-xrm"
         "xcb-util-cursor" "alsa-lib" "libpulse" "libmpdclient" "libnl"
         "jsoncpp" "curl")
optdepends=("i3-wm: i3 module support")
makedepends=("cmake" "git" "python" "pkg-config" "python-sphinx"
             "python-packaging" "i3-wm")
backup=("etc/polybar/config.ini")
provides=("polybar")
conflicts=("polybar")
source=("${_pkgname}::git+https://github.com/patrick96/polybar.git#branch=fix/2798-root-pixmap-depth")
sha256sums=("SKIP")

pkgver() {
  git -C "${_pkgname}" describe --long --tags | sed "s/-/.r/;s/-/./g"
}

prepare() {
  git -C "${_pkgname}" submodule update --init --recursive
  mkdir -p "${_pkgname}/build"
}

build() {
  cd "${_pkgname}/build" || exit 1
  # Force cmake to use system python (to detect xcbgen)
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
  cmake --build .
}

package() {
  cmake --build "${_pkgname}/build" --target install -- DESTDIR="${pkgdir}"
  install -Dm644 "${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
}

@Betweenthelines
Copy link
Author

Just tested it yes. It works flawlessly. no xcb error. Thank you very much.

@patrick96
Copy link
Member

Thanks a lot for testing it out. I will merge the PR now.

patrick96 added a commit that referenced this issue Sep 5, 2022
The background_manager used the root window depth for creating its
pixmaps, but when the root pixmap has a different depth, this causes the
copy_area_checked call to fail and crash the bar.

We now load the root pixmap before finding the visual and creating the
slice pixmaps.

Fixes #2798
@absolutelynothelix
Copy link

@patrick96, we're encountered the same issue in picom. if you're interested, it's because xfdesktop (a part of xfce) always sets root pixmap's depth to 32. see linked above pull request for more details.

@patrick96
Copy link
Member

@absolutelynothelix Thanks for the insight. I never though about the root pixmap (_XROOTPMAP_ID, etc.) actually being the background pixmap for the root window and thus requiring the same depth. I always assumed there was some special handling for wallpapers.

@absolutelynothelix
Copy link

absolutelynothelix commented Dec 26, 2022

@patrick96, it turned out to be a little bit more complicated. xfdesktop creates it's desktop window, manages it and sets the _XROOTPMAP_ID atom to it's (desktop window's) pixmap, while utilities like feh, hsetroot, nitrogen, etc. are managing the real root window and it's (root window's) pixmap. and now it makes sense that you can't use the root window's visual, you have to use the desktop window's visual or obtain a visual from a pixmap _XROOTPMAP_ID points to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants