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

polybar dumped core #2170

Open
fiplox opened this issue Aug 21, 2020 · 3 comments
Open

polybar dumped core #2170

fiplox opened this issue Aug 21, 2020 · 3 comments

Comments

@fiplox
Copy link

fiplox commented Aug 21, 2020

Describe the issue

Polybar v.3.4.3 crashes at least once a day on arch with bspwm. I don't know why it crashes and can't reproduce, I didn't find with what it can be related.

After a crash I get this message at journalctl :
`Process 1196 (polybar) of user 1000 dumped core.

                                               Stack trace of thread 1196:
                                               #0  0x00007f423e1187af __dynamic_cast (libstdc++.so.6 + 0xa17af)
                                               #1  0x0000563393b18ee7 n/a (polybar + 0x25eee7)
                                               #2  0x0000563393b1aa89 _ZNK7polybar10connection14dispatch_eventERKSt10shared_ptrI19xcb_generic_event_tE (polybar + 0x260a89)
                                               #3  0x0000563393a00c8e _ZN7polybar10controller11read_eventsEv (polybar + 0x146c8e)
                                               #4  0x0000563393a064ca _ZN7polybar10controller3runEbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE (polybar + 0x14c4ca)
                                               #5  0x00005633939af397 main (polybar + 0xf5397)
                                               #6  0x00007f423dd56002 __libc_start_main (libc.so.6 + 0x27002)
                                               #7  0x00005633939b1c6e _start (polybar + 0xf7c6e)
                                               
                                               Stack trace of thread 1263:
                                               #0  0x00007f423e6b0cb7 n/a (libcairo.so.2 + 0x69cb7)
                                               #1  0x00007f423e6c06fa n/a (libcairo.so.2 + 0x796fa)
                                               #2  0x00007f423e676160 n/a (libcairo.so.2 + 0x2f160)
                                               #3  0x00007f423e6ce90a cairo_show_text_glyphs (libcairo.so.2 + 0x8790a)
                                               #4  0x0000563393a21360 _ZN7polybar5cairo7font_fc6renderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEdd (polybar + 0x167360)
                                               #5  0x0000563393a1c4fd _ZN7polybar8renderer9draw_textERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE (polybar + 0x1624fd)
                                               #6  0x0000563393a1d207 _ZThn120_N7polybar8renderer2onERKNS_7signals6parser4textE (polybar + 0x163207)
                                               #7  0x0000563393a16e10 _ZN7polybar6parser5parseERKNS_12bar_settingsENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE (polybar + 0x15ce>
                                               #8  0x00005633939c3637 _ZN7polybar3bar5parseEONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb (polybar + 0x109637)
                                               #9  0x00005633939fec9d _ZN7polybar10controller14process_updateEb (polybar + 0x144c9d)
                                               #10 0x0000563393a0442c _ZN7polybar10controller18process_eventqueueEv (polybar + 0x14a42c)
                                               #11 0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #12 0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #13 0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1211:
                                               #0  0x00007f423df05e32 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xfe32)
                                               #1  0x00007f423e140c01 __gthread_cond_wait (libstdc++.so.6 + 0xc9c01)
                                               #2  0x0000563393a29bce n/a (polybar + 0x16fbce)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1262:
                                               #0  0x00007f423df06488 pthread_cond_clockwait (libpthread.so.0 + 0x10488)
                                               #1  0x0000563393a6d535 _ZN7polybar7modules6moduleINS0_11date_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x1b3535)
                                               #2  0x0000563393a6de6d _ZN7polybar7modules12timer_moduleINS0_11date_moduleEE6runnerEv (polybar + 0x1b3e6d)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1212:
                                               #0  0x00007f423de2405f __poll (libc.so.6 + 0xf505f)
                                               #1  0x00007f423e321c14 n/a (libpulse.so.0 + 0xdc14)
                                               #2  0x00007f423e32f059 pa_mainloop_poll (libpulse.so.0 + 0x1b059)
                                               #3  0x00007f423e339301 pa_mainloop_iterate (libpulse.so.0 + 0x25301)
                                               #4  0x00007f423e3393b1 pa_mainloop_run (libpulse.so.0 + 0x253b1)
                                               #5  0x00007f423e32961e n/a (libpulse.so.0 + 0x1561e)
                                               #6  0x00007f423d3add1c n/a (libpulsecommon-13.0.so + 0x1dd1c)
                                               #7  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #8  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1250:
                                               #0  0x00007f423de2feac recv (libc.so.6 + 0x100eac)
                                               #1  0x0000563393b0ee1f _ZN7polybar11socket_util15unix_connection7receiveB5cxx11ElPli (polybar + 0x254e1f)
                                               #2  0x0000563393b0efdb _ZN7polybar11socket_util15unix_connection4peekEm (polybar + 0x254fdb)
                                               #3  0x0000563393a5a90c _ZN7polybar7modules12event_moduleINS0_12bspwm_moduleEE6runnerEv (polybar + 0x1a090c)
                                               #4  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #5  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #6  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1254:
                                               #0  0x00007f423df06488 pthread_cond_clockwait (libpthread.so.0 + 0x10488)
                                               #1  0x0000563393ac1035 _ZN7polybar7modules6moduleINS0_14network_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x2070>
                                               #2  0x0000563393ac188d _ZN7polybar7modules12timer_moduleINS0_14network_moduleEE6runnerEv (polybar + 0x20788d)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1252:
                                               #0  0x00007f423df06488 pthread_cond_clockwait (libpthread.so.0 + 0x10488)
                                               #1  0x0000563393ac8115 _ZN7polybar7modules6moduleINS0_17pulseaudio_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x2>
                                               #2  0x0000563393ac8a71 _ZN7polybar7modules12event_moduleINS0_17pulseaudio_moduleEE6runnerEv (polybar + 0x20ea71)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1255:
                                               #0  0x00007f423df06488 pthread_cond_clockwait (libpthread.so.0 + 0x10488)
                                               #1  0x0000563393ac1035 _ZN7polybar7modules6moduleINS0_14network_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x2070>
                                               #2  0x0000563393ac188d _ZN7polybar7modules12timer_moduleINS0_14network_moduleEE6runnerEv (polybar + 0x20788d)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1256:
                                               #0  0x00007f423de2405f __poll (libc.so.6 + 0xf505f)
                                               #1  0x0000563393b0dd71 _ZN7polybar7io_util9poll_readEii (polybar + 0x253d71)
                                               #2  0x0000563393acb4f7 n/a (polybar + 0x2114f7)
                                               #3  0x0000563393acbcd9 n/a (polybar + 0x211cd9)
                                               #4  0x0000563393acc58d n/a (polybar + 0x21258d)
                                               #5  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #6  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #7  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1257:
                                               #0  0x00007f423de2405f __poll (libc.so.6 + 0xf505f)
                                               #1  0x0000563393b0c789 _ZNK7polybar13inotify_watch4pollEi (polybar + 0x252789)
                                               #2  0x0000563393a4c1aa _ZN7polybar7modules14inotify_moduleINS0_14battery_moduleEE11poll_eventsEv (polybar + 0x1921aa)
                                               #3  0x0000563393a4c947 _ZN7polybar7modules14inotify_moduleINS0_14battery_moduleEE6runnerEv (polybar + 0x192947)
                                               #4  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #5  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #6  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1258:
                                               #0  0x00007f423df06488 pthread_cond_clockwait (libpthread.so.0 + 0x10488)
                                               #1  0x0000563393a47d15 _ZN7polybar7modules6moduleINS0_14battery_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x18dd>
                                               #2  0x0000563393a41d48 _ZN7polybar7modules14battery_module9subthreadEv (polybar + 0x187d48)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1261:
                                               #0  0x00007f423df06488 pthread_cond_clockwait (libpthread.so.0 + 0x10488)
                                               #1  0x0000563393a47d15 _ZN7polybar7modules6moduleINS0_14battery_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x18dd>
                                               #2  0x0000563393a41d48 _ZN7polybar7modules14battery_module9subthreadEv (polybar + 0x187d48)
                                               #3  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #4  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #5  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)
                                               
                                               Stack trace of thread 1260:
                                               #0  0x00007f423de2405f __poll (libc.so.6 + 0xf505f)
                                               #1  0x0000563393b0c789 _ZNK7polybar13inotify_watch4pollEi (polybar + 0x252789)
                                               #2  0x0000563393a4c1aa _ZN7polybar7modules14inotify_moduleINS0_14battery_moduleEE11poll_eventsEv (polybar + 0x1921aa)
                                               #3  0x0000563393a4c947 _ZN7polybar7modules14inotify_moduleINS0_14battery_moduleEE6runnerEv (polybar + 0x192947)
                                               #4  0x00007f423e146b74 execute_native_thread_routine (libstdc++.so.6 + 0xcfb74)
                                               #5  0x00007f423deff422 start_thread (libpthread.so.0 + 0x9422)
                                               #6  0x00007f423de2ebf3 __clone (libc.so.6 + 0xffbf3)`

Was it working before?
No, always crashed. I even reinstalled arch.

To Reproduce

A minimal but complete config with which the problem occurs:

[colors]
background = #1a1a1a 
background-alt = #464646
foreground = #dfdfdf
foreground-alt = #555
primary = #5aaaff
secondary = #e60053
alert = #bd2c40

[bar/v1]
width = 100%
height = 29
radius = 0.0
fixed-center = false

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

line-size = 3
line-color = #f00

border-size = 0
border-color = #00000000

padding-left = 1
padding-right = 2

module-margin-left = 1
module-margin-right = 2

font-0 = FontAwesome:pixelsize=14;1
font-1 = Fira Code:size=10:weight=bold;1 
font-2 = iconic:pixelsize=14;1
font-3 = icomoon:pixelsize=14;1
font-4 = Material Icons:pixelsize=14;1
font-5 = Symbols Nerd Font:pixelsize=14;2
   
modules-left = bspwm mpd
modules-center = xwindow
modules-right = pulseaudio xkeyboard wlan eth BT battery0 battery1 date

tray-position = right
tray-padding = 2

wm-restack = bspwm

cursor-click = pointer
cursor-scroll = ns-resize

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

[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock

label-layout = %layout%
label-layout-underline = ${colors.secondary}

label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}

[module/bspwm]
type = internal/bspwm

ws-icon-0 = 1;
ws-icon-1 = 2;
ws-icon-2 = 3;
ws-icon-3 = 4;
ws-icon-4 = 5;
ws-icon-5 = 6;

label-focused = %icon%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

label-occupied = %icon%
label-occupied-padding = 2

label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

label-empty = %icon%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2

label-separator = 

[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0

format-connected = <label-connected>
format-connected-underline = #9f78e1
label-connected = "%{A1:kitty -e nmtui:}%{A}"

format-disconnected = ""

[module/eth]
type = internal/network
interface = enp5s0
interval = 3.0

format-connected-underline = #55aa55
format-connected-prefix = ""
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%

format-disconnected =

[module/BT]
type = custom/script
exec = /home/fiplox/.config/polybar/bluetooth.sh
format-underline = #55aa99
tail = true
click-left = /home/fiplox/.config/polybar/bluetooth.sh --toggle &

[module/date]
type = internal/date
interval = 5

date-alt =" %Y-%m-%d"

time ="%H:%M"
time-alt =%H:%M:%S

format-underline = #0a6cf5

label = %time%%date%

[module/pulseaudio]
type = internal/pulseaudio

format-volume = <label-volume> <bar-volume>
label-volume =  

label-volume-foreground = ${root.foreground}

label-muted = 
label-muted-foreground = #666

bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-underline = #55aa55
bar-volume-indicator-font = 2
bar-volume-fill = -
bar-volume-fill-font = 4
bar-volume-empty = -
bar-volume-empty-font = 4
bar-volume-empty-foreground = ${colors.foreground-alt}
bar-volume-empty-underline = #55aa55
bar-volume-fill-underline = #55aa55

[module/battery0]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98

format-charging = <label-charging>
format-charging-underline = #ffb52a

format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}

format-full = 
format-full-underline = ${self.format-charging-underline}

label-charging =  %percentage%%
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground}

[module/battery1]
type = internal/battery
battery = BAT1
adapter = AC
full-at = 98

format-charging = <label-charging>
format-charging-underline = #ffb52a

format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}

label-charging =  %percentage%%
format-full = 
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground}

[settings]
screenchange-reload = true

Polybar Log

Post everything polybar outputs to the terminal when you run it and the issue occurs below

warn: pulseaudio: using default sink alsa_output.pci-0000_06_00.6.analog-stereo

Environment:

  • WM: bspwm
  • Distro: arch
  • Output of polybar -vvv:
    polybar 3.4.3

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

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

Build type: Release
Compiler: /usr/bin/c++
Compiler flags: -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -Wpedantic -O3 -DNDEBUG
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now

@stertingen
Copy link

I dont't know whether this is related, but I also have weird crashes every few days. There's a core dump attached: polybar.dump.gz

Config
;==========================================================
;
;
;   ██████╗  ██████╗ ██╗  ██╗   ██╗██████╗  █████╗ ██████╗
;   ██╔══██╗██╔═══██╗██║  ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
;   ██████╔╝██║   ██║██║   ╚████╔╝ ██████╔╝███████║██████╔╝
;   ██╔═══╝ ██║   ██║██║    ╚██╔╝  ██╔══██╗██╔══██║██╔══██╗
;   ██║     ╚██████╔╝███████╗██║   ██████╔╝██║  ██║██║  ██║
;   ╚═╝      ╚═════╝ ╚══════╝╚═╝   ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝
;
;
;   To learn more about how to configure Polybar
;   go to https://github.com/polybar/polybar
;
;   The README contains a lot of information
;
;==========================================================

[colors]
background = #e52f343f
background-alt = ${colors.background}
foreground = #dfdfdf
foreground-alt = #5c616c
primary = #5294e2
secondary = #ffb52a
alert = #f27835

[bar/topbar]
; Tell the Window Manager not to configure the window.
; Use this to detach the bar if your WM is locking its size/position.
; Note: With this most WMs will no longer reserve space for 
; the bar and it will overlap other windows. You need to configure
; your WM to add a gap where the bar will be placed.
override-redirect = false

; Put the bar at the bottom of the screen
bottom = false

; Prefer fixed center position for the `modules-center` block. 
; The center block will stay in the middle of the bar whenever
; possible. It can still be pushed around if other blocks need
; more space.
; When false, the center block is centered in the space between 
; the left and right block.
fixed-center = true

; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
width = 100%
height = 27

; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in an offset in the x or y direction 
; of 50% minus 10 pixels
offset-x = 0
offset-y = 0

; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
background = ${colors.background}

; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
foreground = ${colors.foreground}

; Value used for drawing rounded corners
; Note: This shouldn't be used together with border-size because the border 
; doesn't get rounded. For this to work you may also need to enable 
; pseudo-transparency or use a compositor like compton.
; Individual top/bottom values can be defined using:
;   radius-{top,bottom}
radius = 0

; Under-/overline pixel size and argb color
; Individual values can be defined using:
;   {overline,underline}-size
;   {overline,underline}-color
line-size = 2
line-color = ${colors.primary}

; Values applied to all borders
; Individual side values can be defined using:
;   border-{left,top,right,bottom}-size
;   border-{left,top,right,bottom}-color
; The top and bottom borders are added to the bar height, so the effective
; window height is:
;   height + border-top-size + border-bottom-size
; Meanwhile the effective window width is defined entirely by the width key and
; the border is placed within this area. So you effectively only have the
; following horizontal space on the bar:
;   width - border-right-size - border-left-size
; border-size can be defined as pixel value (e.g. 35) or percentage (e.g. 50%),
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in 50% minus 10 pixels. The percentage is relative
; to the monitor width or height depending on the border direction. 
border-size = 4
border-bottom-size = 2
border-color = #00000000

; Number of spaces to add at the beginning/end of the bar
; Individual side values can be defined using:
;   padding-{left,right}
padding = 1

; Number of spaces to add before/after each module
; Individual side values can be defined using:
;   module-margin-{left,right}
module-margin = 2

; Fonts are defined using <font-name>;<vertical-offset>
; Font names are specified using a fontconfig pattern.
;   font-0 = NotoSans-Regular:size=8;2
;   font-1 = MaterialIcons:size=10
;   font-2 = Termsynu:size=8;-1
;   font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details
font-0 = Roboto:size=9;1
font-1 = FontAwesome5Free:size=10;1
font-2 = FontAwesome5FreeSolid:size=10;1

; Modules are added to one of the available blocks
;   modules-left = cpu ram
;   modules-center = xwindow xbacklight
;   modules-right = ipc clock
modules-left = i3
modules-center = date
modules-right = filesystem cpu temperature memory eth wlan battery pulseaudio

; Position of the system tray window
; If empty or undefined, tray support will be disabled
; NOTE: A center aligned tray will cover center aligned modules
;
; Available positions:
;   left
;   center
;   right
;   none
tray-position = right

; Background color for the tray container 
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
; By default the tray container will use the bar
; background color.
;tray-background = #0063ff

; Pad the sides of each tray icon
tray-padding = 1

; Restack the bar window and put it above the
; selected window manager's root
;
; Fixes the issue where the bar is being drawn
; on top of fullscreen window's
;
; Currently supported WM's:
;   bspwm
;   i3 (requires: `override-redirect = true`)
;wm-restack =

; Fallback click handlers that will be called if
; there's no matching module handler found.
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev

; Requires polybar to be built with xcursor support (xcb-util-cursor)
; Possible values are:
; - default   : The default pointer as before, can also be an empty string (default)
; - pointer   : Typically in the form of a hand
; - ns-resize : Up and down arrows, can be used to indicate scrolling
cursor-click = pointer

[global/wm]
; Adjust the _NET_WM_STRUT_PARTIAL top value
;   Used for top aligned bars
margin-bottom = 0

; Adjust the _NET_WM_STRUT_PARTIAL bottom value
;   Used for bottom aligned bars
margin-top = 0

[settings]
; The throttle settings lets the eventloop swallow up til X events
; if they happen within Y millisecond after first event was received.
; This is done to prevent flood of update event.
;
; For example if 5 modules emit an update event at the same time, we really
; just care about the last one. But if we wait too long for events to swallow
; the bar would appear sluggish so we continue if timeout
; expires or limit is reached.
;throttle-output = 5
;throttle-output-for = 10

; Time in milliseconds that the input handler will wait between processing events
;throttle-input-for = 30

; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events
screenchange-reload = true

; Compositing operators
; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
;compositing-background = source
;compositing-foreground = over
;compositing-overline = over
;compositing-underline = over
;compositing-border = over

; Enables pseudo-transparency for the bar
; If set to true the bar can be transparent without a compositor.
pseudo-transparency = false

[module/i3]
type = internal/i3

; Only show workspaces defined on the same output as the bar
;
; Useful if you want to show monitor specific workspaces
; on different bars
;
; Default: false
pin-workspaces = true

; This will split the workspace name on ':'
; Default: false
strip-wsnumbers = true

; Sort the workspaces by index instead of the default
; sorting that groups the workspaces by output
; Default: false
index-sort = true

; Create click handler used to focus workspace
; Default: true
enable-click = true

; Create scroll handlers used to cycle workspaces
; Default: true
enable-scroll = false

; Wrap around when reaching the first/last workspace
; Default: true
wrapping-scroll = false

; Set the scroll cycle direction 
; Default: true
reverse-scroll = true

; Use fuzzy (partial) matching on labels when assigning 
; icons to workspaces
; Example: code;♚ will apply the icon to all workspaces 
; containing 'code' in the label
; Default: false
fuzzy-match = false

; Available tags:
;   <label-state> (default) - gets replaced with <label-(focused|unfocused|visible|urgent)>
;   <label-mode> (default)
format = <label-state> <label-mode>

; Available tokens:
;   %mode%
; Default: %mode%
label-mode = %mode%
label-mode-padding = 2
label-mode-foreground = #000000
label-mode-background = ${colors.primary}

; focused = Active workspace on focused monitor
; Available tokens:
;   %name%
;   %icon%
;   %index%
;   %output%
; Default: %icon%  %name%
label-focused = %name%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

; unfocused = Inactive workspace on any monitor
; Available tokens:
;   %name%
;   %icon%
;   %index%
;   %output%
; Default: %icon%  %name%
label-unfocused = %name%
label-unfocused-padding = 2

; visible = Active workspace on unfocused monitor
; Available tokens:
;   %name%
;   %icon%
;   %index%
;   %output%
; Default: %icon%  %name%
label-visible = %name%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set
; Available tokens:
;   %name%
;   %icon%
;   %index%
;   %output%
; Default: %icon%  %name%
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

[module/date]
type = internal/date

; Seconds to sleep between updates
; Default: 1.0
interval = 1

; See "https://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = " %Y-%m-%d"

; Optional time format
time = " %H:%M:%S"

; Available tags:
;   <label> (default)
format = <label>
format-underline = ${colors.primary}

; Available tokens:
;   %date%
;   %time%
; Default: %date%
label = %date% %{O10} %time%

[module/filesystem]
type = internal/fs

; Mountpoints to display
mount-0 = /

; Seconds to sleep between updates
; Default: 30
interval = 30

; Available tags:
;   <label-mounted> (default)
;   <bar-free>
;   <bar-used>
;   <ramp-capacity>
format-mounted = <label-mounted>

; Available tags:
;   <label-unmounted> (default)
format-unmounted = <label-unmounted>

; Available tokens:
;   %mountpoint%
;   %type%
;   %fsname%
;   %percentage_free%
;   %percentage_used%
;   %total%
;   %free%
;   %used%
; Default: %mountpoint% %percentage_free%%
label-mounted = " %mountpoint%: %free% free"

; Available tokens:
;   %mountpoint%
; Default: %mountpoint% is not mounted
label-unmounted = " %mountpoint%: not mounted"

[module/cpu]
type = internal/cpu

; Seconds to sleep between updates
; Default: 1
interval = 1

; Available tags:
;   <label> (default)
;   <bar-load>
;   <ramp-load>
;   <ramp-coreload>
format = <label>

; Available tokens:
;   %percentage% (default) - total cpu load averaged over all cores
;   %percentage-sum% - Cumulative load on all cores
;   %percentage-cores% - load percentage for each core
;   %percentage-core[1-9]% - load percentage for specific core
label = " %percentage%%"

[module/temperature]
type = internal/temperature

; Seconds to sleep between updates
; Default: 1
interval = 0.5

; Thermal zone to use
; To list all the zone types, run 
; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done
; Default: 0
thermal-zone = 0

; Full path of temperature sysfs path
; Use `sensors` to find preferred temperature source, then run
; $ for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
; to find path to desired file
; Default reverts to thermal zone setting
;hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input

; Base temperature for where to start the ramp (in degrees celsius)
; Default: 0
base-temperature = 20

; Threshold temperature to display warning label (in degrees celsius)
; Default: 80
warn-temperature = 80

; Whether or not to show units next to the temperature tokens (°C, °F)
; Default: true
units = true

; Available tags:
;   <label> (default)
;   <ramp>
format = <ramp> <label>

; Available tags:
;   <label-warn> (default)
;   <ramp>
format-warn = <ramp> <label-warn>

; Available tokens:
;   %temperature% (deprecated)
;   %temperature-c%   (default, temperature in °C)
;   %temperature-f%   (temperature in °F)
label = %temperature-c%

; Available tokens:
;   %temperature% (deprecated)
;   %temperature-c%   (default, temperature in °C)
;   %temperature-f%   (temperature in °F)
label-warn = %temperature-c%
label-warn-foreground = ${colors.alert}

; Requires the <ramp> tag
; The icon selection will range from `base-temperature` to `warn-temperature`,
; temperatures above `warn-temperature` will use the last icon
; and temperatures below `base-temperature` will use `ramp-0`
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-3 = 
ramp-4 = 

[module/memory]
type = internal/memory

; Seconds to sleep between updates
; Default: 1
interval = 1

; Available tags:
;   <label> (default)
;   <bar-used>
;   <bar-free>
;   <ramp-used>
;   <ramp-free>
;   <bar-swap-used>
;   <bar-swap-free>
;   <ramp-swap-used>
;   <ramp-swap-free>
format = <label>

; Available tokens:
;   %percentage_used% (default)
;   %percentage_free%
;   %gb_used%
;   %gb_free%
;   %gb_total%
;   %mb_used%
;   %mb_free%
;   %mb_total%
;   %percentage_swap_used%
;   %percentage_swap_free%
;   %mb_swap_total%
;   %mb_swap_free%
;   %mb_swap_used%
;   %gb_swap_total%
;   %gb_swap_free%
;   %gb_swap_used%

label = " %percentage_used%%"

[module/eth]
type = internal/network

; Name of the network interface to display. You can get the names of the
; interfaces on your machine with `ip link`
; Wireless interfaces often start with `wl` and ethernet interface with `eno` or `eth`
interface = enp0s25

; Seconds to sleep between updates
; Default: 1
interval = 3.0

; Test connectivity every Nth update
; A value of 0 disables the feature
; NOTE: Experimental (needs more testing)
; Default: 0
;ping-interval = 3

; @deprecated: Define min width using token specifiers (%downspeed:min% and %upspeed:min%)
; Minimum output width of upload/download rate
; Default: 3
;udspeed-minwidth = 5

; Accumulate values from all interfaces
; when querying for up/downspeed rate
; Default: false
;accumulate-stats = true

; Consider an `UNKNOWN` interface state as up.
; Some devices like USB network adapters have 
; an unknown state, even when they're running
; Default: false
;unknown-as-up = true

; Available tags:
;   <label-connected> (default)
;   <ramp-signal>
format-connected = <label-connected>

; Available tags:
;   <label-disconnected> (default)
format-disconnected = <label-disconnected>

; Available tags:
;   <label-connected> (default)
;   <label-packetloss>
;   <animation-packetloss>
format-packetloss = <animation-packetloss> <label-packetloss>

; All labels support the following tokens:
;   %ifname%    [wireless+wired]
;   %local_ip%  [wireless+wired]
;   %local_ip6% [wireless+wired]
;   %essid%     [wireless]
;   %signal%    [wireless]
;   %upspeed%   [wireless+wired]
;   %downspeed% [wireless+wired]
;   %linkspeed% [wired]

; Default: %ifname% %local_ip%
label-connected = " %local_ip%"

; Default: (none)
label-disconnected = " -"
label-disconnected-foreground = ${colors.secondary}

; Default: (none)
label-packetloss = %local_ip%

; Only applies if <animation-packetloss> is used
animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = ${colors.alert}
animation-packetloss-1 = 
animation-packetloss-1-foreground = ${colors.foreground}
; Framerate in milliseconds
animation-packetloss-framerate = 500

[module/wlan]
type = internal/network

; Name of the network interface to display. You can get the names of the
; interfaces on your machine with `ip link`
; Wireless interfaces often start with `wl` and ethernet interface with `eno` or `eth`
interface = wlp3s0

; Seconds to sleep between updates
; Default: 1
interval = 3.0

; Test connectivity every Nth update
; A value of 0 disables the feature
; NOTE: Experimental (needs more testing)
; Default: 0
;ping-interval = 3

; @deprecated: Define min width using token specifiers (%downspeed:min% and %upspeed:min%)
; Minimum output width of upload/download rate
; Default: 3
;udspeed-minwidth = 5

; Accumulate values from all interfaces
; when querying for up/downspeed rate
; Default: false
;accumulate-stats = true

; Consider an `UNKNOWN` interface state as up.
; Some devices like USB network adapters have 
; an unknown state, even when they're running
; Default: false
;unknown-as-up = true

; Available tags:
;   <label-connected> (default)
;   <ramp-signal>
format-connected = <ramp-signal> <label-connected>

; Available tags:
;   <label-disconnected> (default)
format-disconnected = <label-disconnected>

; Available tags:
;   <label-connected> (default)
;   <label-packetloss>
;   <animation-packetloss>
format-packetloss = <animation-packetloss> <label-connected>

; All labels support the following tokens:
;   %ifname%    [wireless+wired]
;   %local_ip%  [wireless+wired]
;   %local_ip6% [wireless+wired]
;   %essid%     [wireless]
;   %signal%    [wireless]
;   %upspeed%   [wireless+wired]
;   %downspeed% [wireless+wired]
;   %linkspeed% [wired]

; Default: %ifname% %local_ip%
label-connected = %local_ip% (%essid%)

; Default: (none)
label-disconnected = " -"
label-disconnected-foreground = ${colors.secondary}

; Default: (none)
;label-packetloss = %essid%
;label-packetloss-foreground = #eefafafa

; Only applies if <ramp-signal> is used
ramp-signal-0 = 

; Only applies if <animation-packetloss> is used
animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = ${colors.alert}
animation-packetloss-1 = 
animation-packetloss-1-foreground = ${colors.foreground}
; Framerate in milliseconds
animation-packetloss-framerate = 500

[module/battery]
type = internal/battery

; This is useful in case the battery never reports 100% charge
full-at = 98

; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC

; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = 5

; see "man date" for details on how to format the time string
; NOTE: if you want to use syntax tags here you need to use %%{...}
; Default: %H:%M:%S
time-format = %H:%M

; Available tags:
;   <label-charging> (default)
;   <bar-capacity>
;   <ramp-capacity>
;   <animation-charging>
format-charging = <ramp-capacity> <label-charging>

; Available tags:
;   <label-discharging> (default)
;   <bar-capacity>
;   <ramp-capacity>
;   <animation-discharging>
format-discharging = <ramp-capacity> <label-discharging>

; Available tags:
;   <label-full> (default)
;   <bar-capacity>
;   <ramp-capacity>
format-full = <ramp-capacity> <label-full>

; Available tokens:
;   %percentage% (default) - is set to 100 if full-at is reached
;   %percentage_raw%
;   %time%
;   %consumption% (shows current charge rate in watts)
label-charging =  %percentage%%

; Available tokens:
;   %percentage% (default) - is set to 100 if full-at is reached
;   %percentage_raw%
;   %time%
;   %consumption% (shows current discharge rate in watts)
label-discharging =  %percentage%% (%time% left)

; Available tokens:
;   %percentage% (default) - is set to 100 if full-at is reached
;   %percentage_raw%
label-full = %percentage%% (full)

; Only applies if <ramp-capacity> is used
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 

[module/pulseaudio]
type = internal/pulseaudio

; Sink to be used, if it exists (find using `pacmd list-sinks`, name field)
; If not, uses default sink
#sink = alsa_output.pci-0000_12_00.3.analog-stereo

; Use PA_VOLUME_UI_MAX (~153%) if true, or PA_VOLUME_NORM (100%) if false
; Default: true
use-ui-max = true

; Interval for volume increase/decrease (in percent points)
; Default: 5
interval = 5

; Available tags:
;   <label-volume> (default)
;   <ramp-volume>
;   <bar-volume>
format-volume = <ramp-volume> <label-volume>

; Available tags:
;   <label-muted> (default)
;   <ramp-volume>
;   <bar-volume>
format-muted = <label-muted>

; Available tokens:
;   %percentage% (default)
;   %decibels% (unreleased)
label-volume = %percentage%%

; Available tokens:
;   %percentage% (default)
;   %decibels% (unreleased)
label-muted =  0%
label-muted-foreground = ${colors.alert}

; Only applies if <ramp-volume> is used
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 

; Right and Middle click (unreleased)
;click-right = pavucontrol &
;click-middle = 

; vim:ft=dosini

@stertingen
Copy link

Alright, I took a look at this core dump myself with gdb. The reason for this crash is a data race between two threads interacting with the same data structure. (Why needs a bar 16 threads?)

The problem is i3_module::m_workspaces (https://github.com/polybar/polybar/blob/master/include/modules/i3.hpp#L75), which is written to in i3_module::update() (https://github.com/polybar/polybar/blob/master/src/modules/i3.cpp#L124) and read from in i3_module::build() (https://github.com/polybar/polybar/blob/master/src/modules/i3.cpp#L191). The build() method creates an rvalue(?) reference to a std::unique_ptr that is stored in a std::vector (why not store the struct directly in the vector?) and uses that reference to obtain the workspace struct later. As the update() method clears the whole vector, that reference to the unique_ptr is a dangling reference which is dereferenced causing the segault.

Unfortunately, the update() and build() member functions are called from two different threads without a locking mechanism. (according to the stack traces of the different threads in gdb)

So the OP uses bspwm instead of i3 which makes my crash not directly related to the original issue. But I would also assume that data races might be the key to find the cause for that crash.

@sysfsss
Copy link

sysfsss commented Mar 29, 2021

@fiplox Does this only happen if you've bounced the pulseaudio daemon while your polybar is running? I'm having that issue in #2408

Try keeping track of the PID number of /usr/bin/pulseaudio before and after a polybar crash+coredump. I can reproduce this reliably every time.

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

No branches or pull requests

3 participants