From patchwork Sun Oct 12 15:42:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 26417 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1XdLHm-0005xc-3e; Sun, 12 Oct 2014 17:42:18 +0200 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1XdLHj-0005xI-JQ for vdr@linuxtv.org; Sun, 12 Oct 2014 17:42:16 +0200 X-tubIT-Incoming-IP: 188.40.50.18 Received: from racoon.tvdr.de ([188.40.50.18]) by mail.tu-berlin.de (exim-4.72/mailfrontend-8) with esmtps [TLSv1:AES256-SHA:256] for id 1XdLHi-0007m5-k8; Sun, 12 Oct 2014 17:42:15 +0200 Received: from dolphin.tvdr.de (dolphin.tvdr.de [192.168.100.2]) by racoon.tvdr.de (8.14.5/8.14.5) with ESMTP id s9CFgDwq011076 for ; Sun, 12 Oct 2014 17:42:13 +0200 Received: from [192.168.100.11] (falcon.tvdr.de [192.168.100.11]) by dolphin.tvdr.de (8.14.4/8.14.4) with ESMTP id s9CFg77l011008 for ; Sun, 12 Oct 2014 17:42:07 +0200 Message-ID: <543AA14F.2090207@tvdr.de> Date: Sun, 12 Oct 2014 17:42:07 +0200 From: Klaus Schmidinger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: vdr@linuxtv.org References: <28619607.68531412528710169.JavaMail.defaultUser@defaultHost> <14512.89951412536196145.JavaMail.defaultUser@defaultHost> <543A908E.9010604@gmail.com> In-Reply-To: <543A908E.9010604@gmail.com> X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.10.12.153032 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793 autolearn=no Subject: Re: [vdr] vdr-2.0.6 crashes at recording start with divide error X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org 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[400000+156000] > runvdr[300]: Floating point exception > > $ gdb /usr/bin/vdr > (gdb) disass /m 0x4cfeff > > 1514 in remux.c > 0x00000000004cfee6 <+870>: mov 0x290(%rbx),%rsi > 0x00000000004cfeed <+877>: xor %edx,%edx > 0x00000000004cfeef <+879>: mov 0x284(%rbx),%ecx > 0x00000000004cfef5 <+885>: mov 0xc(%rbx),%eax > 0x00000000004cfefc <+892>: add 0xc(%rsi),%ecx > 0x00000000004cfeff <+895>: div %ecx > 0x00000000004cff08 <+904>: mov %eax,%ecx > > Point to this in remux.c? > 1514: uint32_t Delta = ptsValues[0] / (framesPerPayloadUnit + parser->IFrameTemporalReferenceOffset()); This should fix it: Klaus --- 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)