Opened 14 years ago

Closed 13 years ago

#10133 closed Bug Report - Crash (Unverified)

Memory corruption in mythpreviewgen if mpg file contains errors

Reported by: Lawrence Rust <lvr@…> Owned by: danielk
Priority: minor Milestone: 0.25
Component: MythTV - Mythpreviewgen Version: 0.24.1
Severity: medium Keywords: Memory corruption
Cc: Ticket locked: no

Description

I have noticed several segfaults and aborts logged by mythbackend when running mythpreviewgen. It appears that problems occur if the recording contains errors in the transport stream due to reception problems. I can reliably reproduce the problem with this recording http://www.softsystem.co.uk/download/mythtv/7941_20111029115050.mpg (30MB) when invoked as: mythpreviewgen -v most --infile 7941_20111029115050.mpg

Backtrace attached.

NB there's a bug in mythpreviewgen/main.cpp that needs this patch to specify a filename:

--- a/mythtv/programs/mythpreviewgen/main.cpp
+++ b/mythtv/programs/mythpreviewgen/main.cpp
@@ -98,7 +98,7 @@ int preview_helper(const QString &_chanid, const QString &star
 
     uint chanid = _chanid.toUInt();
     QDateTime recstartts = myth_dt_from_string(starttime);
-    if (!chanid || !recstartts.isValid())
+    if (!QFileInfo(infile).isReadable() && (!chanid || !recstartts.isValid()))
         ProgramInfo::ExtractKeyFromPathname(infile, chanid, recstartts);
 
     ProgramInfo *pginfo = NULL;

Attachments (1)

mythpreviewgen-gdb.txt (65.5 KB) - added by Lawrence Rust <lvr@…> 14 years ago.

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by Lawrence Rust <lvr@…>

Attachment: mythpreviewgen-gdb.txt added

comment:1 Changed 13 years ago by danielk

Milestone: unknown0.25
Owner: set to danielk
Status: newaccepted

comment:2 Changed 13 years ago by danielk

Resolution: Unverified
Status: acceptedclosed

First thanks for the report.

However if this patch fixes anything it appears that may just a side-effect of breaking something else. As I read it the logic is saying if the chanid or recording start time are not valid and the file is not readable then we should extract the chanid and recording start time from the filename. But it would seem to me that it is immaterial at this point whether the file is readable and moreover if it is you would want to extract those keys so you could generate a preview.

I can't download the sample so I can't reproduce the underlying issue and the backtrace doesn't pinpoint the problem issue well enough in this case. If you still have the sample please make it available again and I'll reopen the ticket and look at the underlying issue here.

Note: See TracTickets for help on using tickets.