polybar icon indicating copy to clipboard operation
polybar copied to clipboard

polybar crashes and dumps core when interacting with module/pulseaudio after `pulseaudio -k`

Open sysfsss opened this issue 3 years ago • 1 comments

Possibly related to #2170 since it's window manager agnostic, and has the word pulse throughout the trace. Also #1580

polybar crash scenario primed when pulseaudio user daemon is restarted

Today I had a fuzzy audio issue with pulseaudio. I use an aggregate device via the paprefs program, which lets you set up a simultaneous output interface. Note that I also have pavucontrol running, which is a systray icon for controlling pulseaudio.

In order to clear it up, I ran pulseaudio -k as my normal user, which kills the running daemon and allows it to restart. This fixed my audio issue, but it broke polybar in that when I now interact with polybar's volume slider, it crashes and coredumps. The first time it happened during my i3 session, it completely froze my entire machine for a good 30-40 seconds (audio kept playing, so it was strange), and there were some graphical glitches - as for user input during the issue, no mouse cursor control, no numlock toggle, couldn't even Ctrl-Alt-F{1..7}, Ctrl-Alt-Del, or sysrq-trigger (LAlt-LShift-PrintScr+R,E,I,S,U,B)

Pretty severe. No idea why it took that long to coredump.

Here's a snippet similar to the other posted issue:

CLICK TO EXPAND: Process (polybar) crashed and dumped core.
Mar 29 12:41:53 riplr systemd-coredump[52790]: Process 52729 (polybar) of user 1000 dumped core.
                                           
                                           Stack trace of thread 52744:
                                           #0  0x00007f93597f3ef5 raise (libc.so.6 + 0x3cef5)
                                           #1  0x00007f93597dd862 abort (libc.so.6 + 0x26862)
                                           #2  0x00007f9359dbdef5 pa_operation_get_state (libpulse.so.0 + 0x1cef5)
                                           #3  0x0000560bee56f662 _ZN7polybar10pulseaudio8set_muteEb (polybar + 0x289662)
                                           #4  0x0000560bee4f1779 _ZN7polybar7modules17pulseaudio_module5inputERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_ (polybar + 0x20b779)
                                           #5  0x0000560bee42995c _ZN7polybar10controller14forward_actionERKSt5tupleIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_EE (polybar + 0x14395c)
                                           #6  0x0000560bee43447a _ZN7polybar10controller17process_inputdataEv (polybar + 0x14e47a)
                                           #7  0x0000560bee434bd0 _ZN7polybar10controller18process_eventqueueEv (polybar + 0x14ebd0)
                                           #8  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #9  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #10 0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52729:
                                           #0  0x00007f93598adad1 __select (libc.so.6 + 0xf6ad1)
                                           #1  0x0000560bee4286be _ZN7polybar10controller11read_eventsEv (polybar + 0x1426be)
                                           #2  0x0000560bee42edac _ZN7polybar10controller3runEbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE (polybar + 0x148dac)
                                           #3  0x0000560bee3d95a0 main (polybar + 0xf35a0)
                                           #4  0x00007f93597deb25 __libc_start_main (libc.so.6 + 0x27b25)
                                           #5  0x0000560bee3db73e _start (polybar + 0xf573e)
                                           
                                           Stack trace of thread 52730:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                           #2  0x00007f9359bcdbb1 __gthread_cond_wait (libstdc++.so.6 + 0xc9bb1)
                                           #3  0x0000560bee45a79e n/a (polybar + 0x17479e)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52733:
                                           #0  0x00007f93598ab37f __poll (libc.so.6 + 0xf437f)
                                           #1  0x00007f9359dd4654 n/a (libpulse.so.0 + 0x33654)
                                           #2  0x00007f9359dbd9a9 pa_mainloop_poll (libpulse.so.0 + 0x1c9a9)
                                           #3  0x00007f9359dc8281 pa_mainloop_iterate (libpulse.so.0 + 0x27281)
                                           #4  0x00007f9359dc8331 pa_mainloop_run (libpulse.so.0 + 0x27331)
                                           #5  0x00007f9359dd87fe n/a (libpulse.so.0 + 0x377fe)
                                           #6  0x00007f9358d865cc n/a (libpulsecommon-14.2.so + 0x565cc)
                                           #7  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #8  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52735:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                                           #2  0x0000560bee4a8ee2 _ZN7polybar7modules6moduleINS0_9fs_moduleEE11sleep_untilINSt6chrono3_V212system_clockENS5_8durationIlSt5ratioILl1ELl1000000000EEEEEEvNS5_10time_pointIT_T0_EE (polybar + 0x1c2ee2)
                                           #3  0x0000560bee4a90e3 _ZN7polybar7modules12timer_moduleINS0_9fs_moduleEE6runnerEv (polybar + 0x1c30e3)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52734:
                                           #0  0x00007f935999687c read (libpthread.so.0 + 0x1287c)
                                           #1  0x0000560bee58d272 _ZN5i3ipc7i3_recvEi (polybar + 0x2a7272)
                                           #2  0x0000560bee589272 _ZN5i3ipc10connection12handle_eventEv (polybar + 0x2a3272)
                                           #3  0x0000560bee4b387e _ZN7polybar7modules9i3_module9has_eventEv (polybar + 0x1cd87e)
                                           #4  0x0000560bee4b9ee0 _ZN7polybar7modules12event_moduleINS0_9i3_moduleEE6runnerEv (polybar + 0x1d3ee0)
                                           #5  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #6  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #7  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52738:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                                           #2  0x0000560bee498822 _ZN7polybar7modules6moduleINS0_10cpu_moduleEE11sleep_untilINSt6chrono3_V212system_clockENS5_8durationIlSt5ratioILl1ELl1000000000EEEEEEvNS5_10time_pointIT_T0_EE (polybar + 0x1b2822)
                                           #3  0x0000560bee498a23 _ZN7polybar7modules12timer_moduleINS0_10cpu_moduleEE6runnerEv (polybar + 0x1b2a23)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52736:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                                           #2  0x0000560bee4ef1b2 _ZN7polybar7modules6moduleINS0_14network_moduleEE11sleep_untilINSt6chrono3_V212system_clockENS5_8durationIlSt5ratioILl1ELl1000000000EEEEEEvNS5_10time_pointIT_T0_EE (polybar + 0x2091b2)
                                           #3  0x0000560bee4ef3b3 _ZN7polybar7modules12timer_moduleINS0_14network_moduleEE6runnerEv (polybar + 0x2093b3)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52739:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                                           #2  0x0000560bee503732 _ZN7polybar7modules6moduleINS0_18temperature_moduleEE11sleep_untilINSt6chrono3_V212system_clockENS5_8durationIlSt5ratioILl1ELl1000000000EEEEEEvNS5_10time_pointIT_T0_EE (polybar + 0x21d732)
                                           #3  0x0000560bee503933 _ZN7polybar7modules12timer_moduleINS0_18temperature_moduleEE6runnerEv (polybar + 0x21d933)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52740:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                                           #2  0x0000560bee4ca592 _ZN7polybar7modules6moduleINS0_13memory_moduleEE11sleep_untilINSt6chrono3_V212system_clockENS5_8durationIlSt5ratioILl1ELl1000000000EEEEEEvNS5_10time_pointIT_T0_EE (polybar + 0x1e4592)
                                           #3  0x0000560bee4ca793 _ZN7polybar7modules12timer_moduleINS0_13memory_moduleEE6runnerEv (polybar + 0x1e4793)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52741:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993852 pthread_cond_clockwait (libpthread.so.0 + 0xf852)
                                           #2  0x0000560bee4f3e55 _ZN7polybar7modules6moduleINS0_17pulseaudio_moduleEE5sleepENSt6chrono8durationIdSt5ratioILl1ELl1EEEE (polybar + 0x20de55)
                                           #3  0x0000560bee4f5759 _ZN7polybar7modules12event_moduleINS0_17pulseaudio_moduleEE6runnerEv (polybar + 0x20f759)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
                                           
                                           Stack trace of thread 52742:
                                           #0  0x00007f93599999ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                           #1  0x00007f9359993574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                                           #2  0x0000560bee49f082 _ZN7polybar7modules6moduleINS0_11date_moduleEE11sleep_untilINSt6chrono3_V212system_clockENS5_8durationIlSt5ratioILl1ELl1000000000EEEEEEvNS5_10time_pointIT_T0_EE (polybar + 0x1b9082)
                                           #3  0x0000560bee49f283 _ZN7polybar7modules12timer_moduleINS0_11date_moduleEE6runnerEv (polybar + 0x1b9283)
                                           #4  0x00007f9359bd3bc4 execute_native_thread_routine (libstdc++.so.6 + 0xcfbc4)
                                           #5  0x00007f935998d299 start_thread (libpthread.so.0 + 0x9299)
                                           #6  0x00007f93598b6053 __clone (libc.so.6 + 0xff053)
░░ Subject: Process 52729 (polybar) dumped core
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ Documentation: man:core(5)
░░ 
░░ Process 52729 (polybar) crashed and dumped core.
░░ 
░░ This usually indicates a programming error in the crashing program and
░░ should be reported to its vendor as a bug.

I suspect this is due to pulseaudio coming back up with a different handler/descriptor or something like that and polybar's trying to talk to something that's no longer there. Does not persist through re-launch of polybar - ONLY happens if pulseaudio crashes/bounces while polybar is running. If you restart polybar after pulseaudio is back up and running, polybar's volume slider works again.

To repro:

  • Be running polybar with a working volume slider that controls pulseaudio
  • Open a terminal and run pulseaudio -k to bounce pulseaudio
  • Hover over the polybar volume slider and use the scroll wheel to control the volume, and polybar will crash and dump core.

sysfsss avatar Mar 29 '21 17:03 sysfsss

I have the same issue didn't happen to me before I reinstalled my OS tho did you fix it tho?

mei10101 avatar Feb 05 '23 22:02 mei10101