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

David Jarvie djarvie at
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 

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

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 

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/
#8  0xb6460018 in abort () from /lib/i686/cmov/
#9  0xb6fe8915 in qt_message_output () from /opt/qt-4.4.3/lib/
#10 0xb6fe89c6 in qFatal () from /opt/qt-4.4.3/lib/
#11 0xb6fe8a55 in qt_assert () from /opt/qt-4.4.3/lib/
#12 0xb259cb7a in Backend (this=0xb310c100, parent=0x0) at 
#13 0xb259d2bc in qt_plugin_instance () at 
#14 0xb70b69ba in QPluginLoader::instance () from 
#15 0xb26a6c77 in Phonon::KdePlatformPlugin::createBackend (this=0x9af5628, 
newService={d = 0xb17aa11c}) at 
#16 0xb26a7fee in Phonon::KdePlatformPlugin::createBackend (this=0x9af5628) at 
#17 0xb7c53a91 in Phonon::FactoryPrivate::createBackend (this=0x9afa8b8) at 
#18 0xb7c54943 in Phonon::Factory::backend (createWhenNull=true) at 
#19 0xb7c435ac in Phonon::MediaNodePrivate::backendObject (this=0xb3108000) at 
#20 0xb7c40b95 in Phonon::MediaObject::setCurrentSource (this=0xb3102938, 
newSource=@0xb17aa340) at 
#21 0x080fa5a1 in AudioThread::run (this=0x9afb180) at 
#22 0xb6fefa60 in ?? () from /opt/qt-4.4.3/lib/

David Jarvie.
KAlarm author and maintainer.

More information about the kde-multimedia mailing list