Bug 351505

Summary: pulseaudio -k causes Plasma to crash
Product: [Plasma] plasma-pa Reporter: Victor B. Gonzalez <bugs.kde.org.id324>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: bhush94, bwalk, dougt901-2012, johnoshaugh, kde, lenar, mensoif_gerard, plasma-bugs
Priority: NOR Keywords: drkonqi
Version: 5.4.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 5.4.2
Sentry Crash Report:

Description Victor B. Gonzalez 2015-08-20 06:57:36 UTC
Application: plasmashell (5.3.95)

Qt Version: 5.5.0
Operating System: Linux 4.1.6-200.fc22.x86_64 x86_64
Distribution: "Fedora release 22 (Twenty Two)"

-- Information about the crash:
All I have to do 99% of the time is just run "pulseaudio -k". BOOM, here we are. Good luck!

The crash can be reproduced every time.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f637ba63900 (LWP 21054))]

Thread 13 (Thread 0x7f635a0a1700 (LWP 21056)):
#0  0x00007f63734712fd in poll () from /lib64/libc.so.6
#1  0x00007f63798aa182 in _xcb_conn_wait () from /lib64/libxcb.so.1
#2  0x00007f63798abc77 in xcb_wait_for_event () from /lib64/libxcb.so.1
#3  0x00007f635c9a7999 in QXcbEventReader::run() () from /lib64/libQt5XcbQpa.so.5
#4  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#5  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 12 (Thread 0x7f63533ea700 (LWP 21061)):
#0  0x00007f637346cfad in read () from /lib64/libc.so.6
#1  0x00007f636b5eff75 in ?? () from /usr/lib64/nvidia/tls/libnvidia-tls.so.352.30
#2  0x00007f636e5d0b00 in g_wakeup_acknowledge () from /lib64/libglib-2.0.so.0
#3  0x00007f636e58c8b4 in g_main_context_check () from /lib64/libglib-2.0.so.0
#4  0x00007f636e58cd60 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#5  0x00007f636e58cecc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#6  0x00007f63742b4dab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#7  0x00007f637425bdaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#8  0x00007f63740785a4 in QThread::exec() () from /lib64/libQt5Core.so.5
#9  0x00007f6378340245 in QQmlThreadPrivate::run() () from /lib64/libQt5Qml.so.5
#10 0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#11 0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#12 0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7f634afe6700 (LWP 21077)):
#0  0x00007f637348a64f in __libc_enable_asynccancel () from /lib64/libc.so.6
#1  0x00007f637346cfa2 in read () from /lib64/libc.so.6
#2  0x00007f636b5eff75 in ?? () from /usr/lib64/nvidia/tls/libnvidia-tls.so.352.30
#3  0x00007f636e5d0b00 in g_wakeup_acknowledge () from /lib64/libglib-2.0.so.0
#4  0x00007f636e58c8b4 in g_main_context_check () from /lib64/libglib-2.0.so.0
#5  0x00007f636e58cd60 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#6  0x00007f636e58cecc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#7  0x00007f63742b4dab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#8  0x00007f637425bdaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#9  0x00007f63740785a4 in QThread::exec() () from /lib64/libQt5Core.so.5
#10 0x00007f6378340245 in QQmlThreadPrivate::run() () from /lib64/libQt5Qml.so.5
#11 0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#12 0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#13 0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7f6349586700 (LWP 21080)):
#0  0x00007f63734712fd in poll () from /lib64/libc.so.6
#1  0x00007f636e58cdbc in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#2  0x00007f636e58cecc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007f63742b4dab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007f637425bdaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007f63740785a4 in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007f6378340245 in QQmlThreadPrivate::run() () from /lib64/libQt5Qml.so.5
#7  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#8  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#9  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7f6343bd7700 (LWP 21081)):
#0  0x00007f637208c540 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f637b17d494 in QTWTF::TCMalloc_PageHeap::scavengerThread() () from /lib64/libQt5Script.so.5
#2  0x00007f637b17d4d9 in QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /lib64/libQt5Script.so.5
#3  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7f634106b700 (LWP 21082)):
#0  0x00007f636e5d1ec9 in g_mutex_lock () from /lib64/libglib-2.0.so.0
#1  0x00007f636e58cda2 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#2  0x00007f636e58cecc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007f63742b4dab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007f637425bdaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007f63740785a4 in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007f6378ee3616 in QQuickPixmapReader::run() () from /lib64/libQt5Quick.so.5
#7  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#8  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#9  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7f62b7166700 (LWP 21084)):
#0  0x00007f637208c540 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f637407e7db in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQt5Core.so.5
#2  0x00007f6378f587de in QSGRenderThread::processEventsAndWaitForMore() () from /lib64/libQt5Quick.so.5
#3  0x00007f6378f59063 in QSGRenderThread::run() () from /lib64/libQt5Quick.so.5
#4  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#5  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7f62afbff700 (LWP 21085)):
#0  0x00007f637208c540 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f637407e7db in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQt5Core.so.5
#2  0x00007f6378f587de in QSGRenderThread::processEventsAndWaitForMore() () from /lib64/libQt5Quick.so.5
#3  0x00007f6378f59063 in QSGRenderThread::run() () from /lib64/libQt5Quick.so.5
#4  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#5  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f62a6723700 (LWP 21089)):
#0  0x00007f637208c540 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f637407e7db in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQt5Core.so.5
#2  0x00007f6378f587de in QSGRenderThread::processEventsAndWaitForMore() () from /lib64/libQt5Quick.so.5
#3  0x00007f6378f59063 in QSGRenderThread::run() () from /lib64/libQt5Quick.so.5
#4  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#5  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f629a16c700 (LWP 21557)):
#0  0x00007f637348a64f in __libc_enable_asynccancel () from /lib64/libc.so.6
#1  0x00007f63734712f2 in poll () from /lib64/libc.so.6
#2  0x00007f636e58cdbc in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#3  0x00007f636e58cecc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#4  0x00007f63742b4dab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007f637425bdaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#6  0x00007f63740785a4 in QThread::exec() () from /lib64/libQt5Core.so.5
#7  0x00007f629bdbb397 in KCupsConnection::run() () from /lib64/libkcupslib.so
#8  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#9  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f6290b9a700 (LWP 21567)):
#0  0x00007f637208c540 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f637407e7db in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQt5Core.so.5
#2  0x00007f6378f587de in QSGRenderThread::processEventsAndWaitForMore() () from /lib64/libQt5Quick.so.5
#3  0x00007f6378f59063 in QSGRenderThread::run() () from /lib64/libQt5Quick.so.5
#4  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#5  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f628bdf9700 (LWP 21568)):
#0  0x00007f637208c540 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f637407e7db in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQt5Core.so.5
#2  0x00007f6378f587de in QSGRenderThread::processEventsAndWaitForMore() () from /lib64/libQt5Quick.so.5
#3  0x00007f6378f59063 in QSGRenderThread::run() () from /lib64/libQt5Quick.so.5
#4  0x00007f637407d54e in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#5  0x00007f6372087555 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f637347cb9d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f637ba63900 (LWP 21054)):
[KCrash Handler]
#5  0x00007f636e5d1ec5 in g_mutex_lock () from /lib64/libglib-2.0.so.0
#6  0x00007f636e58a563 in g_source_remove_poll () from /lib64/libglib-2.0.so.0
#7  0x00007f63663450e1 in glib_io_free () from /lib64/libpulse-mainloop-glib.so.0
#8  0x00007f63658bb849 in delete_events () from /usr/lib64/pulseaudio/libpulsecommon-6.0.so
#9  0x00007f63658bbe3e in pa_iochannel_free () from /usr/lib64/pulseaudio/libpulsecommon-6.0.so
#10 0x00007f63658ce96d in pa_pstream_unlink () from /usr/lib64/pulseaudio/libpulsecommon-6.0.so
#11 0x00007f63665570e6 in context_unlink () from /lib64/libpulse.so.0
#12 0x00007f6366557838 in pa_context_set_state () from /lib64/libpulse.so.0
#13 0x00007f63658cec06 in do_pstream_read_write () from /usr/lib64/pulseaudio/libpulsecommon-6.0.so
#14 0x00007f6366344f7b in dispatch_func () from /lib64/libpulse-mainloop-glib.so.0
#15 0x00007f636e58ca8a in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#16 0x00007f636e58ce20 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#17 0x00007f636e58cecc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#18 0x00007f63742b4d8f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#19 0x00007f637425bdaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#20 0x00007f6374263e6c in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#21 0x0000000000430e63 in main ()

Reported using DrKonqi
Comment 1 David Edmundson 2015-08-22 15:54:57 UTC
>The crash can be reproduced every time.

Tried here. Seems to be fine. 

Can you check against 5.4.0 when that lands in Fedora.
Comment 2 bwalk 2015-09-05 11:52:42 UTC
I can reproduce this in Plasma 5.4.0.
Comment 3 Harald Sitter 2015-09-10 12:38:34 UTC
Git commit 8d36ea6a28b55dfc41cb05e1c09c4364353c4b84 by Harald Sitter.
Committed on 10/09/2015 at 12:37.
Pushed by sitter into branch 'Plasma/5.4'.

do not crash when context gets defunct & implement respawn

context getting lost means we must destory all our references to pulse
objects. however we only nuked them from the map which incidentially didn't
remove them from the models so plasma/kcm would crash when trying to
refresh.

also implement respawn when the context dies, since no data isn't
particularly useful either
REVIEW: 125138
FIXED-IN: 5.4.2
CHANGELOG: Improved handling of PulseAudio disappearing during runtime

M  +21   -11   src/context.cpp
M  +1    -1    src/context.h
M  +6    -1    src/maps.h

http://commits.kde.org/plasma-pa/8d36ea6a28b55dfc41cb05e1c09c4364353c4b84
Comment 4 David Edmundson 2015-09-22 10:44:21 UTC
*** Bug 353009 has been marked as a duplicate of this bug. ***
Comment 5 Victor B. Gonzalez 2015-09-22 16:09:49 UTC
KDE 4.14.11, Plasma 5.4.1, Qt 5.5.0, Kernel 4.1.7 on Fedora 22. I just tried "pulseaudio -k" in a terminal just to see if this bug is truly fixed and unfortunately, Plasma crashed again.
Comment 6 David Edmundson 2015-10-01 06:52:56 UTC
*** Bug 353378 has been marked as a duplicate of this bug. ***
Comment 7 David Edmundson 2015-10-25 11:39:20 UTC
*** Bug 352898 has been marked as a duplicate of this bug. ***
Comment 8 David Edmundson 2015-10-25 11:39:26 UTC
*** Bug 354331 has been marked as a duplicate of this bug. ***
Comment 9 David Edmundson 2015-10-25 11:40:01 UTC
Victor: you're using  Plasma 5.4.1

commit in #2 says
FIXED-IN: 5.4.2
Comment 10 Victor B. Gonzalez 2015-10-25 19:45:49 UTC
Yes, I'm on 5.4.2 and after a couple pulseaudio -k experiments, plasmashell no longer crashes :)

Thanks!