polybar: Crash with alsa-lib 1.2.3-1 on ArchLinux

After upgrading and rebuilding polybar with alsa-lib 1.2.3 when I try to use the mouse to adjust volume causes the bar crash

Expected behavior: Volume adjust without bar crashing

Actual behavior: Volume not adjusted and bar crash

Was it working before?

  • Did you also experience this bug in an earlier version of polybar? No

To Reproduce

[bar/tst]
modules-right = volume

[module/volume]
type = internal/volume

format-volume-underline = ${colors.underline}

label-volume-foreground = ${colors.foreground-alt}

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

format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = --
format-muted-underline = #DCDCDC


bar-volume-width = 8
bar-volume-foreground-0 = #FF
bar-volume-foreground-1 = #FF
bar-volume-foreground-2 = #FF
bar-volume-foreground-3 = #FF
bar-volume-foreground-4 = #FF
bar-volume-foreground-5 = #FF
bar-volume-foreground-6 = #FF
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-indicator-foreground = #AA5000
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}

Try to adjust volume using mouse scroll

Polybar Log

double free or corruption (fasttop)
[1]    8562 abort (core dumped)  polybar tst

Environment:

  • WM: i3
  • Distro: ArchLinux
  • 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 

Trace

Starting program: /codes/polybar/build/bin/polybar tst
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
notice: Parsing config file: /home/.config/polybar/config
[New Thread 0x7ffff63c5700 (LWP 8710)]
warn: No monitor specified, using "eDP1"
warn: internal/volume is deprecated, use internal/alsa instead
[New Thread 0x7ffff1bc4700 (LWP 8711)]
[New Thread 0x7ffff13c3700 (LWP 8712)]
[New Thread 0x7ffff0bc2700 (LWP 8713)]
warn: No fonts specified, using fallback font "fixed"
notice: Loaded font "fixed" (name=DejaVu Sans, offset=0, file=/usr/share/fonts/TTF/DejaVuSans.ttf)
warn: Dropping unmatched character  (U+e04e) in ''
[New Thread 0x7fffd3e4e700 (LWP 8722)]
[Thread 0x7fffd3e4e700 (LWP 8722) exited]
double free or corruption (fasttop)

Thread 5 "polybar" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff0bc2700 (LWP 8713)]
0x00007ffff757d355 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff757d355 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7566853 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff75c0878 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007ffff75c7d3a in malloc_printerr () from /usr/lib/libc.so.6
#4  0x00007ffff75c9035 in _int_free () from /usr/lib/libc.so.6
#5  0x00007ffff7c9e806 in ?? () from /usr/lib/libasound.so.2
#6  0x00007ffff7c9724e in snd_config_update_free_global () from /usr/lib/libasound.so.2
#7  0x0000555555ab7be0 in polybar::alsa::mixer::mixer (this=0x7fffdc063290, mixer_selem_name=..., 
    soundcard_name=...) at /home/codes/polybar/src/adapters/alsa/mixer.cpp:23
#8  0x000055555598c64f in polybar::modules::alsa_module::input (this=0x555555c58100, cmd=...)
    at /home/codes/polybar/src/modules/alsa.cpp:236
#9  0x000055555593824f in polybar::controller::process_inputdata (this=0x555555c391c0)
    at /home/codes/polybar/src/components/controller.cpp:398
#10 0x0000555555937d32 in polybar::controller::process_eventqueue (this=0x555555c391c0)
    at /home/codes/polybar/src/components/controller.cpp:348
#11 0x0000555555951923 in std::__invoke_impl<void, void (polybar::controller::*)(), polybar::controller*> (
    __f=@0x555555c9de10: (void (polybar::controller::*)(polybar::controller * const)) 0x555555937b30 <polybar::controller::process_eventqueue()>, __t=@0x555555c9de08: 0x555555c391c0)
    at /usr/include/c++/10.1.0/bits/invoke.h:73
#12 0x0000555555951865 in std::__invoke<void (polybar::controller::*)(), polybar::controller*> (
    __fn=@0x555555c9de10: (void (polybar::controller::*)(polybar::controller * const)) 0x555555937b30 <polybar::controller::process_eventqueue()>) at /usr/include/c++/10.1.0/bits/invoke.h:95
#13 0x00005555559517d5 in std::thread::_Invoker<std::tuple<void (polybar::controller::*)(), polybar::controller*> >::_M_invoke<0ul, 1ul> (this=0x555555c9de08) at /usr/include/c++/10.1.0/thread:264
#14 0x000055555595178e in std::thread::_Invoker<std::tuple<void (polybar::controller::*)(), polybar::controller*> >::operator() (this=0x555555c9de08) at /usr/include/c++/10.1.0/thread:271
#15 0x00005555559516b0 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (polybar::controller::*)(), polybar::controller*> > >::_M_run (this=0x555555c9de00)
    at /usr/include/c++/10.1.0/thread:215
#16 0x00007ffff795ab74 in std::execute_native_thread_routine (__p=0x555555c9de00)
    at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
#17 0x00007ffff7713422 in start_thread () from /usr/lib/libpthread.so.0
#18 0x00007ffff7640bf3 in clone () from /usr/lib/libc.so.6

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Seems to be fixed by upgrading to alsa-lib-1.2.3.1-1.

Fixed for me at least. Can mute, unmute, mute unmute. Increase/decrease volume

Edit: I’m on Archlinux, so have to do yay -Sy alsa-lib and it workss

I can also confirm that version 1.2.3.1 fixes this. I did a bisect between 1.2.3.1 and 1.2.3 and it was commit https://github.com/alsa-project/alsa-lib/commit/20e003a63d14edabd59e40e5d0b8ed2f11f8c9b8 that fixed it. The issue that the commit was supposed to fix is also consistent with the issue here, so I believe this is actually fixed and I will close this issue.

For what it’s worth I’m also using this on arch with an alsa/pulseaudio setup, except the behavior occurs when muting/unmuting—it’d work once before crashing, maybe a second time if you gave it time. This behavior is new after a full system upgrade to alsa-lib 1.2.3-1, so whatever code path muting/unmuting hits is affected as well.

I can’t reproduce this, even with the exact same alsa-lib version. Does this happen consistently for you?

Yes, always happens with alsa-lib 1.2.3-1 version. Earlier today I performed a downgrade to alsa-lib 1.2.2-1 and since then it has been working as intended.

Oh, also how does your sound setup look like? Do you use alsa together with pulseaudio?

I do use pulseaudio but I’m not sure about what you mean with “sound setup” . If you want me to run any command that may help the debug process I’ll do.