[vdr] Crash in cDvbSubtitleConverter::Action()

Klaus Schmidinger Klaus.Schmidinger at tvdr.de
Thu Aug 15 13:25:33 CEST 2013


On 15.08.2013 13:18, Klaus Schmidinger wrote:
> On 14.08.2013 22:14, Ville Skyttä wrote:
>> Hello,
>>
>> I'm occasionally seeing crashes in cDvbSubtitleConverter::Action(),
>> example backtrace below. Unfortunately I don't have a reliable
>> reproducer nor am I even sure if this happens on VDR startup or
>> shutdown, but I think it's one of those, maybe the latter :)
>>
>> Perhaps something like this would avoid it (guessing, haven't tried
>> anything yet):
>>
>> -           if (cDvbSubtitleBitmaps *sb = bitmaps->First()) {
>> +           if (cDevice::PrimaryDevice() && cDvbSubtitleBitmaps *sb =
>> bitmaps->First()) {
>
> A cDvbSubtitleConverter is only created for replay on the primary
> device. So when the primary device is destroyed when shutting down VDR,
> its destructor first deletes the dvbSubtitleConverter:
>
> cDevice::~cDevice()
> {
>    Detach(player);
>    DetachAllReceivers();
>    delete liveSubtitle;
>    delete dvbSubtitleConverter;
> }
>
> The destructor of cDvbSubtitleConverter in turn does a Cancel(3), which
> stops its Action() loop.
> Are you getting any log messages that stopping the "subtitleConverter"
> thread didn't work?
>
> Besides, the additional check you suggested wouldn't make any difference,
> because the static cDevice::primaryDevice pointer is never set back to NULL
> at shutdown. Maybe we should add
>
>    if (this == primaryDevice)
>       primaryDevice = NULL;
>
> at the end of cDevice::~cDevice(), but since shutting down the devices is pretty
> much the last thing done when leaving VDR I don't think this is going to make much
> of a difference.
>
> Klaus

Sorry, I guess my 'grep' was a little too coarse before, so I missed

void cDevice::Shutdown(void)
{
   deviceHooks.Clear();
   primaryDevice = NULL; // <<<<<<<<<<<<<<<<<<< this!
   for (int i = 0; i < numDevices; i++) {
       delete device[i];
       device[i] = NULL;
       }
}

So primaryDevice is set to NULL after all, but apparently too early.
I'll move that into the destructor of cDevice (see above), which should fix
your crash.

Maybe you can give this a try and let me know whether it helps.

Klaus


>> #0  0x0000000000000000 in ?? ()
>> No symbol table info available.
>> #1  0x00007fcebbe30636 in cDvbSubtitleConverter::Action
>> (this=0x7fcea0381cd0) at dvbsubtitle.c:935
>>          STC = <optimized out>
>>          Delta = <optimized out>
>>          sb = 0x7fcea0333bd0
>>          ThreadLock = {thread = 0x7fcea0381cd0, locked = true}
>>          WaitMs = 100
>>          LastSetupLevel = 0
>>          Timeout = {begin = 15644639}
>> #2  0x00007fcebbea234f in cThread::StartThread (Thread=0x7fcea0381cd0)
>> at thread.c:262
>> No locals.
>> #3  0x00007fcebb6f0c53 in start_thread () from /lib64/libpthread.so.0
>> No symbol table info available.
>> #4  0x00007fceba11213d in clone () from /lib64/libc.so.6
>> No symbol table info available.
>
> _______________________________________________
> vdr mailing list
> vdr at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



More information about the vdr mailing list