Crash when Phonon::MediaObject::setCurrentSource() called twice

David Jarvie djarvie at kde.org
Sat Jun 13 20:34:54 BST 2009


I'm getting a crash in KAlarm when it creates two concurrent MediaObject 
instances, when it calls setCurrentSource() on the second one. The MediaObject 
instances are created in separate threads, the code sequence being in each 
case:

Phonon::MediaSource source(audioFile);
mAudioObject = new Phonon::MediaObject();
mAudioObject->setCurrentSource(source);

The crash occurs in Phonon::Xine::Backend::Backend(), at the first line

Q_ASSERT(s_instance == 0);

Can somebody give me some advice as to why this is going wrong, and what to do 
about it. Is it the case that Phonon can't handle two MediaObjects in 
different threads?

This is making KAlarm unusable for some users, so I'd really appreciate some 
help.

The crash backtrace is:

Thread 9 (Thread 0xb17aab90 (LWP 1518)):
[KCrash Handler]
#6  0xb7f36424 in __kernel_vsyscall ()
#7  0xb645e640 in raise () from /lib/i686/cmov/libc.so.6
#8  0xb6460018 in abort () from /lib/i686/cmov/libc.so.6
#9  0xb6fe8915 in qt_message_output () from /opt/qt-4.4.3/lib/libQtCore.so.4
#10 0xb6fe89c6 in qFatal () from /opt/qt-4.4.3/lib/libQtCore.so.4
#11 0xb6fe8a55 in qt_assert () from /opt/qt-4.4.3/lib/libQtCore.so.4
#12 0xb259cb7a in Backend (this=0xb310c100, parent=0x0) at 
/home/david/src/svn/4.2/kdesupport/phonon/xine/backend.cpp:74
#13 0xb259d2bc in qt_plugin_instance () at 
/home/david/src/svn/4.2/kdesupport/phonon/xine/backend.cpp:53
#14 0xb70b69ba in QPluginLoader::instance () from 
/opt/qt-4.4.3/lib/libQtCore.so.4
#15 0xb26a6c77 in Phonon::KdePlatformPlugin::createBackend (this=0x9af5628, 
newService={d = 0xb17aa11c}) at 
/home/david/src/svn/4.2/kdebase/runtime/phonon/platform_kde/kdeplatformplugin.cpp:154
#16 0xb26a7fee in Phonon::KdePlatformPlugin::createBackend (this=0x9af5628) at 
/home/david/src/svn/4.2/kdebase/runtime/phonon/platform_kde/kdeplatformplugin.cpp:203
#17 0xb7c53a91 in Phonon::FactoryPrivate::createBackend (this=0x9afa8b8) at 
/home/david/src/svn/4.2/kdesupport/phonon/phonon/factory.cpp:118
#18 0xb7c54943 in Phonon::Factory::backend (createWhenNull=true) at 
/home/david/src/svn/4.2/kdesupport/phonon/phonon/factory.cpp:416
#19 0xb7c435ac in Phonon::MediaNodePrivate::backendObject (this=0xb3108000) at 
/home/david/src/svn/4.2/kdesupport/phonon/phonon/medianode.cpp:62
#20 0xb7c40b95 in Phonon::MediaObject::setCurrentSource (this=0xb3102938, 
newSource=@0xb17aa340) at 
/home/david/src/svn/4.2/kdesupport/phonon/phonon/mediaobject.cpp:230
#21 0x080fa5a1 in AudioThread::run (this=0x9afb180) at 
/home/david/src/svn/4.2/kdepim/kalarm/messagewin.cpp:1191
#22 0xb6fefa60 in ?? () from /opt/qt-4.4.3/lib/libQtCore.so.4

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/kalarm



More information about the kde-multimedia mailing list