Changes between Initial Version and Version 1 of Ticket #11410


Ignore:
Timestamp:
Feb 19, 2013, 6:01:43 AM (11 years ago)
Author:
Raymond Wagner
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11410

    • Property Priority changed from major to minor
    • Property Severity changed from high to medium
  • Ticket #11410 – Description

    initial v1  
    11Witnessed mpeg recordings with vbi occasionally hanging at finish (causing the backend in general to hang) and under gdb saw:
    22
     3{{{
    34Thread 3 (Thread 0x7fbd69ffb700 (LWP 8322)):
    45#0  0x00007fbd8bf7a61c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
     
    2021#5  0x00007fbd8b5399cd in clone () from /lib64/libc.so.6
    2122#6  0x0000000000000000 in ?? ()
     23}}}
    2224
    2325Looking at mpegrecorder.cpp:
    2426
     27{{{
    25281113        LOG(VB_RECORD, LOG_INFO, LOC + "run finishing up");
    26291114   
     
    41441129   
    42451130        FinishRecording();
     46}}}
    4347
    4448Line 1119 signals the vbi thread to stop reading and exit, however, the encoder is signaled to stop *before* this on line 1115.  Thus it is possible for the vbi thread to return from select, try to read data from the vbi fd and then block on the read because the vbi fd is no longer returning data (has been stopped).
     
    4650Simple solution seems to be to swap the order, i.e. signal vbi thread to stop reading before stopping the encoder.  I have no idea if there are any unforeseen consequences to this though..... comments?
    4751
     52{{{
    4853diff --git a/mythtv/libs/libmythtv/mpegrecorder.cpp b/mythtv/libs/libmythtv/mpegrecorder.cpp
    4954index b158513..35644af 100644
     
    6772         vbi_thread->wait();
    6873lines 1-20/20 (END)
     74}}}