Bug 232887 - xine backend blocks exit()
Summary: xine backend blocks exit()
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: Xine backend (show other bugs)
Version: 4.4.0 (KDE 4.4.2)
Platform: Debian testing Unspecified
: NOR normal
Target Milestone: ---
Assignee: Matthias Kretz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-31 21:15 UTC by Eckhart Wörner
Modified: 2011-01-28 11:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eckhart Wörner 2010-03-31 21:15:19 UTC
Version:            (using KDE 4.3.1)
Installed from:    Debian testing/unstable Packages

This bug has been copied over from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=536231

----

A couple of times, I've had my X server crash, and then found
that Konversation is still running (alive enough that it's not
getting kicked from IRC for inactivity).

The main program thread has called exit(), and processing of the
on-exit cleanup is stuck in Backend's destructor.  It appears to
be waiting for XineThread::event to remove objects from a list,
but in XineThread::event that list is const.

Regards,
Steve


Backend::~Backend()
{
    m_inShutdown = true;

    if (!m_cleanupObjects.isEmpty()) {
        Q_ASSERT(m_thread);
        QCoreApplication::postEvent(m_thread, new Event(Event::Cleanup));
        while (!m_cleanupObjects.isEmpty()) {
            XineThread::msleep(200); // static QThread::msleep, but that one is protected and XineThread is our friend
        }
    }

bool XineThread::event(QEvent *e)
{
    switch (e->type()) {
    case Event::Cleanup:
        e->accept();
        {
            const QList<QObject *> cleanupObjects = Backend::cleanupObjects();
            foreach (QObject *o, cleanupObjects) {
                delete o;
            }
        }
        return true;
    case Event::NewStream:




(gdb) thread apply all bt

Thread 6 (Thread 0x7f3f049a1950 (LWP 6811)):
#0  0x00007f3f19edcded in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f3f08e8fca1 in metronom_sync_loop (this=0x20470e0) at metronom.c:870
#2  0x00007f3f19ed8f7a in start_thread () from /lib/libpthread.so.0
#3  0x00007f3f1c26289d in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f3f03303950 (LWP 6812)):
#0  0x00007f3f1c25a066 in poll () from /lib/libc.so.6
#1  0x00007f3f189a1cc9 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f3f189a1fac in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f3f1d5b84bf in QEventDispatcherGlib::processEvents (this=0x1fdb120, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:324
#4  0x00007f3f1d58d6f2 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f3f1d58dabd in QEventLoop::exec (this=0x7f3f03303030, flags=...) at kernel/qeventloop.cpp:200
#6  0x00007f3f1d4a37e8 in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:487
#7  0x00007f3f090ea634 in Phonon::Xine::XineThread::run (this=0x2047f70) at ../../xine/xinethread.cpp:143
#8  0x00007f3f1d4a6742 in QThreadPrivate::start (arg=0x2047f70) at thread/qthread_unix.cpp:189
#9  0x00007f3f19ed8f7a in start_thread () from /lib/libpthread.so.0
#10 0x00007f3f1c26289d in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f3f028f9950 (LWP 6815)):
#0  0x00007f3f1c25a066 in poll () from /lib/libc.so.6
#1  0x00007f3f028fe849 in my_snd_mixer_wait (data=<value optimized out>) at audio_alsa_out.c:150
#2  ao_alsa_handle_event_thread (data=<value optimized out>) at audio_alsa_out.c:166
#3  0x00007f3f19ed8f7a in start_thread () from /lib/libpthread.so.0
#4  0x00007f3f1c26289d in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f3f020f8950 (LWP 6816)):
#0  0x00007f3f19edcb69 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f3f08ea0ce3 in fifo_peek_int (this_gen=<value optimized out>) at audio_out.c:348
#2  fifo_peek (this_gen=<value optimized out>) at audio_out.c:388
#3  ao_loop (this_gen=<value optimized out>) at audio_out.c:1015
#4  0x00007f3f19ed8f7a in start_thread () from /lib/libpthread.so.0
#5  0x00007f3f1c26289d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f3efbfff950 (LWP 6820)):
#0  0x00007f3f1c25c232 in select () from /lib/libc.so.6
#1  0x00007f3f1d56d936 in QProcessManager::run (this=0x1e179e0) at io/qprocess_unix.cpp:305
#2  0x00007f3f1d4a6742 in QThreadPrivate::start (arg=0x1e179e0) at thread/qthread_unix.cpp:189
#3  0x00007f3f19ed8f7a in start_thread () from /lib/libpthread.so.0
#4  0x00007f3f1c26289d in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f3f20cb3760 (LWP 6807)):
#0  0x00007f3f19edcded in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f3f1d4a6195 in thread_sleep (ti=0x7fff28df1420) at thread/qthread_unix.cpp:298
#2  0x00007f3f1d4a62ee in QThread::msleep (msecs=200) at thread/qthread_unix.cpp:324
#3  0x00007f3f0910de7a in ~Backend (this=0x1fdb5f0, __in_chrg=<value optimized out>) at ../../xine/backend.cpp:108
#4  0x00007f3f1f89b030 in ~FactoryPrivate (this=0x1e34320, __in_chrg=<value optimized out>) at ../../phonon/factory.cpp:199
#5  0x00007f3f1c1cc41d in exit () from /lib/libc.so.6
#6  0x00007f3f1ca29c58 in qt_xio_errhandler () at kernel/qapplication_x11.cpp:707
#7  0x00007f3f1e18ada8 in KApplication::xioErrhandler(_XDisplay*) () from /usr/lib/libkdeui.so.5
#8  0x00007f3f1f57453e in _XIOError (dpy=0x1e1cef0) at ../../src/XlibInt.c:2959
#9  0x00007f3f1f57b83f in process_responses (dpy=0x1e1cef0, wait_for_first_event=0, current_error=0x0, current_request=18446744073709551506) at ../../src/xcb_io.c:240
#10 0x00007f3f1f57c177 in _XEventsQueued (dpy=0x1e1cef0, mode=<value optimized out>) at ../../src/xcb_io.c:256
#11 0x00007f3f1f564e83 in XEventsQueued (dpy=0x1e1cef0, mode=2) at ../../src/Pending.c:44
#12 0x00007f3f1ca64e3c in x11EventSourceCheck (s=0x1e16fd0) at kernel/qguieventdispatcher_glib.cpp:87
#13 0x00007f3f189a145c in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#14 0x00007f3f189a1d11 in ?? () from /usr/lib/libglib-2.0.so.0
#15 0x00007f3f189a1fac in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#16 0x00007f3f1d5b84bf in QEventDispatcherGlib::processEvents (this=0x1df6c90, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:324
#17 0x00007f3f1ca64c7f in QGuiEventDispatcherGlib::processEvents (this=0x7fff28df13a4, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#18 0x00007f3f1d58d6f2 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#19 0x00007f3f1d58dabd in QEventLoop::exec (this=0x7fff28df1800, flags=...) at kernel/qeventloop.cpp:200
#20 0x00007f3f1d58fd84 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#21 0x0000000000460b15 in _start ()
Comment 1 Myriam Schweingruber 2010-04-06 08:57:33 UTC
Hm, is this still valid with KDE SC 4.4.2? KDE 4.3.1 is rather old...
Comment 2 Eckhart Wörner 2010-04-06 14:44:12 UTC
Latest Phonon master suggests the bug is still alive, Backend::cleanupObjects() remains unchanged during the cleanup event execution (http://gitorious.org/phonon/phonon/blobs/master/xine/xinethread.cpp)
Comment 3 Myriam Schweingruber 2011-01-28 11:50:52 UTC
The xine backend will be deprecated soon as it is currently unmaintained. Please use the vlc or gstreamer backend instead.