Re: [vdr] vdr-2.0.6 crashes at recording start with divide error

2014-10-12 Thread Chris Mayo


On 12/10/14 16:42, Klaus Schmidinger wrote:
> On 12.10.2014 16:30, Chris Mayo wrote:
>> I occasionally see vdr crashing when a recording starts like this:
>>
>> kernel: traps: recording[352] trap divide error ip:4cfeff sp:7fc8e9523e00 
>> error:0 in vdr[40+156000]
>> runvdr[300]: Floating point exception
>>
>> $ gdb /usr/bin/vdr
>> (gdb) disass /m 0x4cfeff
>>
>> 1514in remux.c
>> 0x004cfee6 <+870>:mov0x290(%rbx),%rsi
>> 0x004cfeed <+877>:xor%edx,%edx
>> 0x004cfeef <+879>:mov0x284(%rbx),%ecx
>> 0x004cfef5 <+885>:mov0xc(%rbx),%eax
>> 0x004cfefc <+892>:add0xc(%rsi),%ecx
>> 0x004cfeff <+895>:div%ecx
>> 0x004cff08 <+904>:mov%eax,%ecx
>>
>> Point to this in remux.c?
>> 1514: uint32_t Delta = ptsValues[0] / (framesPerPayloadUnit +  
>> parser->IFrameTemporalReferenceOffset());
> 
> This should fix it:
> 
> --- remux.c 2014/03/08 15:10:24 2.75.1.5
> +++ remux.c 2014/04/13 13:59:21 2.75.1.6
> @@ -1511,7 +1511,12 @@
> for (int i = 0; i < numPtsValues; i++)
> ptsValues[i] = ptsValues[i + 1] - ptsValues[i];
> qsort(ptsValues, numPtsValues, sizeof(uint32_t), 
> CmpUint32);
> -   uint32_t Delta = ptsValues[0] / (framesPerPayloadUnit 
> +  parser->IFrameTemporalReferenceOffset());
> +   int Div = framesPerPayloadUnit;
> +   if (framesPerPayloadUnit > 1)
> +  Div += parser->IFrameTemporalReferenceOffset();
> +   if (Div <= 0)
> +  Div = 1;
> +   uint32_t Delta = ptsValues[0] / Div;
> // determine frame info:
> if (isVideo) {
>if (abs(Delta - 3600) <= 1)
> 
> Klaus
> 

Many thanks. Patch applied. Will take at least a few weeks to be confident of a 
difference.

I guess I should have googled the line of code,
http://www.vdr-portal.de/board17-developer/board97-vdr-core/p1194836-frameratenerkennung-ab-version-2-0-6/

Chris

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] vdr-2.0.6 crashes at recording start with divide error

2014-10-12 Thread Klaus Schmidinger

On 12.10.2014 16:30, Chris Mayo wrote:

I occasionally see vdr crashing when a recording starts like this:

kernel: traps: recording[352] trap divide error ip:4cfeff sp:7fc8e9523e00 
error:0 in vdr[40+156000]
runvdr[300]: Floating point exception

$ gdb /usr/bin/vdr
(gdb) disass /m 0x4cfeff

1514in remux.c
0x004cfee6 <+870>:mov0x290(%rbx),%rsi
0x004cfeed <+877>:xor%edx,%edx
0x004cfeef <+879>:mov0x284(%rbx),%ecx
0x004cfef5 <+885>:mov0xc(%rbx),%eax
0x004cfefc <+892>:add0xc(%rsi),%ecx
0x004cfeff <+895>:div%ecx
0x004cff08 <+904>:mov%eax,%ecx

Point to this in remux.c?
1514: uint32_t Delta = ptsValues[0] / (framesPerPayloadUnit +  
parser->IFrameTemporalReferenceOffset());


This should fix it:

--- remux.c 2014/03/08 15:10:24 2.75.1.5
+++ remux.c 2014/04/13 13:59:21 2.75.1.6
@@ -1511,7 +1511,12 @@
for (int i = 0; i < numPtsValues; i++)
ptsValues[i] = ptsValues[i + 1] - ptsValues[i];
qsort(ptsValues, numPtsValues, sizeof(uint32_t), 
CmpUint32);
-   uint32_t Delta = ptsValues[0] / (framesPerPayloadUnit +  
parser->IFrameTemporalReferenceOffset());
+   int Div = framesPerPayloadUnit;
+   if (framesPerPayloadUnit > 1)
+  Div += parser->IFrameTemporalReferenceOffset();
+   if (Div <= 0)
+  Div = 1;
+   uint32_t Delta = ptsValues[0] / Div;
// determine frame info:
if (isVideo) {
   if (abs(Delta - 3600) <= 1)

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] vdr-2.0.6 crashes at recording start with divide error

2014-10-12 Thread Chris Mayo
I occasionally see vdr crashing when a recording starts like this:

kernel: traps: recording[352] trap divide error ip:4cfeff sp:7fc8e9523e00 
error:0 in vdr[40+156000]
runvdr[300]: Floating point exception

$ gdb /usr/bin/vdr
(gdb) disass /m 0x4cfeff

1514in remux.c
   0x004cfee6 <+870>:   mov0x290(%rbx),%rsi
   0x004cfeed <+877>:   xor%edx,%edx
   0x004cfeef <+879>:   mov0x284(%rbx),%ecx
   0x004cfef5 <+885>:   mov0xc(%rbx),%eax
   0x004cfefc <+892>:   add0xc(%rsi),%ecx
   0x004cfeff <+895>:   div%ecx
   0x004cff08 <+904>:   mov%eax,%ecx

Point to this in remux.c?
1514: uint32_t Delta = ptsValues[0] / (framesPerPayloadUnit +  
parser->IFrameTemporalReferenceOffset());

I don't know how to make it happen.

Chris

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr