[mythtv] MythMusic CDdecoder crash

Daniel Kristjansson danielk at cuymedia.net
Wed Jun 20 12:36:15 UTC 2007

On Wed, 2007-06-20 at 16:38 +1000, Nigel Pearson wrote:
> Mac OS X port, so this is my own fault :-)
> but returning a valid MetaData object from
> *CdDecoder::getLastMetadata() causes:

> Exception:  EXC_BAD_ACCESS (0x0001)
> Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

> Thread 4 Crashed:
> 0   qt-mt                    	0xb22d6ea0 QString::operator=(QString  
> const&) + 16

> Anyone who is more familiar with MythMusic and
> the MetaData class know what's going on?

I'm not familiar with the MythMusic MetaData
class, but it looks like more than one thread
was using the same QString value without mutex
protection. When you pass a string between
threads you need to assign it using QDeepCopy.
If you wish to use a string in two threads any
access to that string usage needs to be
coordinated with a mutex.

This is a big enough problem in MythTV that
I've considered implementing an MythString
that was just a QString with a QDeepCopy
operator=() and a QMutex for all the thread
unsafe methods in QString.

-- Daniel

More information about the mythtv-dev mailing list