Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Buffer Overflows in vdr-1.3.13



Chad Flynt wrote:
> 
> ...
> >> I tried this and actually was able to reproduce this.
> >> Unfortunately it didn't happen any more since I have inserted
> >> a few lines to test something. Will try that again tomorrow.
> >>
> >> If somebody would like to try this:
> >>
> >> --- remux.c     2004/10/16 09:11:52     1.19
> >> +++ remux.c     2004/10/19 16:23:00
> >> @@ -556,6 +556,11 @@
> >>    int resultCount = 0;
> >>    uchar *data = resultBuffer->Get(resultCount);
> >>    if (data) {
> >> +     if (!synced && resultCount > RESULTBUFFERSIZE * 10 / 8) {//XXX
> >> +        dsyslog("clearing resultBuffer before sync");
> >> +        Clear();
> >> +        return NULL;
> >> +        }//XXX
> >>       for (int i = 0; i < resultCount - 3; i++) {
> >>           if (data[i] == 0 && data[i + 1] == 0 && data[i + 2] == 1) {
> >>              int l = 0;
> >>
> >> and let me know whether this message is ever logged, that would be
> >> nice.
> >>
> >> Klaus
> >>
> >>
> >>
> > Thanks for the test code.  I have rebuilt vdr with this patch and now
> > I can not seem to reproduce the buffer overflow either... Could the
> > extra time it takes to process this new code be preventing some kind
> > of race condition?  So far I have not seen any "clearing resultBuffer
> > before sync" messages... I'll keep testing.
> >
> >
> >
> My 2 cents in, I applied the patch and thought all seemed ok, so I went
> ahead and scheduled a few timers of shows like I normally would and let
> it rip.  Got home and VDR was sitting on its back with legs up in the
> air.  Here are my timers.conf and a clipping from my syslog of when it
> crashed.

Well, first of all, this is NOT a "crash"!
A "crash" is when a "segmentation fault" occurs or VDR stops for some
other, unexplained reason.

What we have here is a situation where VDR realizes that something is
going wrong, and it initiates an "emergency exit", which should trigger
a reload of the driver and a restart of VDR.

Did your recordings work after the restart - or don't you use the "runvdr"
(or equivalent) wrapper script that does the restart?

> timers.conf
> 27754497:S119.0W-4100-53-8891-8891:-T-----:1858:2002:99:99:NCIS:Lt. Jane
> Doe Series/Special. Mark Harmon, Sasha Alexander, Michael Weatherly.
> (2004) The team investigates a Navy lieutenant's rape and murder. (CC)
> (Stereo)
> 
> Syslog
> Oct 19 18:58:00 HoochVDR vdr[30499]: file writer thread started
> (pid=30499, tid=475148)
> Oct 19 18:58:00 HoochVDR vdr[30500]: recording thread started
> (pid=30500, tid=491533)
> Oct 19 18:58:00 HoochVDR vdr[30501]: receiver on device 2 thread started
> (pid=30501, tid=507918)
> Oct 19 18:58:00 HoochVDR vdr[30502]: TS buffer on device 2 thread
> started (pid=30502, tid=524303)

There are no buffer overflow messages here, so I would assume
that this was just the already known problem with DVB cards not
delivering _any_ data (whihc may or may not be fixed by some
modifications to the cDvbTuner, for which there are several patches
out there and which I am currently looking at).

The problem we are facing at the moment is that the remuxer's result
buffer runs full and doesn't get emptied any more. Presumably this
happens because it can't get any sync on useful data, hence the
additional debug output.

Klaus

> Oct 19 18:58:31 HoochVDR vdr[30499]: ERROR: video data stream broken
> Oct 19 18:58:31 HoochVDR vdr[30499]: initiating emergency exit
> Oct 19 18:58:31 HoochVDR vdr[30437]: emergency exit requested - shutting
> down
> Oct 19 18:58:31 HoochVDR vdr[30500]: recording thread ended (pid=30500,
> tid=491533)
> Oct 19 18:58:31 HoochVDR vdr[30502]: TS buffer on device 2 thread ended
> (pid=30502, tid=524303)
> Oct 19 18:58:31 HoochVDR vdr[30501]: buffer stats: 26508 (1%) used
> Oct 19 18:58:31 HoochVDR vdr[30501]: receiver on device 2 thread ended
> (pid=30501, tid=507918)
> Oct 19 18:58:31 HoochVDR vdr[30499]: file writer thread ended
> (pid=30499, tid=475148)
> Oct 19 18:58:31 HoochVDR vdr[30437]: cTS2PES got 2995 TS errors, 1186 TS
> continuity errors
> Oct 19 18:58:31 HoochVDR vdr[30437]: cTS2PES got 141 TS errors, 141 TS
> continuity errors
> Oct 19 18:58:31 HoochVDR vdr[30437]: cTS2PES got 148 TS errors, 141 TS
> continuity errors
> Oct 19 18:58:31 HoochVDR vdr[30437]: buffer stats: 26884 (0%) used
> Oct 19 18:58:31 HoochVDR vdr[30437]: timer 1 (9 1858-2002 'NCIS') stop
> Oct 19 18:58:31 HoochVDR vdr[30467]: KBD remote control thread ended
> (pid=30467, tid=98311)
> Oct 19 18:58:31 HoochVDR vdr[30437]: saved setup to /etc/vdr/setup.conf
> Oct 19 18:58:31 HoochVDR vdr[30461]: tuner on device 1 thread ended
> (pid=30461,tid=16386)
> Oct 19 18:58:32 HoochVDR vdr[30462]: Section handler thread ended
> (pid=30462, tid=32771)
> Oct 19 18:58:32 HoochVDR vdr[30464]: tuner on device 2 thread ended
> (pid=30464,tid=49156)
> Oct 19 18:58:32 HoochVDR vdr[30465]: Section handler thread ended
> (pid=30465, tid=65541)
> 
> Let me know if you need any more info!
> 
> Thanks!
> Chad




Home | Main Index | Thread Index