Opened 14 years ago

Closed 13 years ago

#10616 closed Bug Report - Crash (Fixed)

mythtranscode segfaults if called with --fifoinfo

Reported by: furti@… Owned by: beirdo
Priority: minor Milestone: 0.26
Component: MythTV - Mythtranscode Version: 0.25-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by beirdo)

please find the full backtrace attached.

/opt/dvb/mythtv/mythtv# gdb -c /var/crash/core_mythtranscode.14020 -se `which mythtranscode`
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/local/bin/mythtranscode...done.
[New LWP 14020]
[New LWP 14028]
[New LWP 14033]
[New LWP 14034]
[New LWP 14031]
[New LWP 14032]
[New LWP 14022]
[New LWP 14026]
[New LWP 14021]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Core was generated by `mythtranscode --fifoinfo --profile autodetect --chanid 29724 --starttime 200812'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f0a7ae760aa in PlayerContext::StopPlaying (this=0x23d6a20) at playercontext.cpp:483
483         player->StopPlaying();
(gdb) 


/opt/dvb/mythtv/mythtv# mythtranscode --version
Please attach all output as a file in bug reports.
MythTV Version : v0.25-23-g00a2d87
MythTV Branch : fixes/0.25
Network Protocol : 72
Library API : 0.25.20120408-1
QT Version : 4.7.4
Options compiled in:
 linux debug use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_php using_dvb using_frontend using_hdhomerun using_ceton using_hdpvr using_iptv using_ivtv using_joystick_menu using_libcrypto using_lirc using_mheg using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_v4l2 using_x11 using_xv using_bindings_perl using_bindings_php using_mythtranscode using_opengl using_vdpau using_ffmpeg_threads using_live using_mheg

Attachments (2)

backtrace.txt (6.8 KB ) - added by furti@… 14 years ago.
10616-v1.patch (20.9 KB ) - added by danielk 14 years ago.
Attempt at better fix.

Download all attachments as: .zip

Change History (14)

by furti@…, 14 years ago

Attachment: backtrace.txt added

comment:1 by beirdo, 14 years ago

Owner: set to beirdo
Status: newassigned

comment:2 by beirdo, 14 years ago

Description: modified (diff)

comment:3 by furti@…, 14 years ago

I tried to dig further, this prevents segfaulting ... a small next step

diff --git a/mythtv/programs/mythtranscode/main.cpp b/mythtv/programs/mythtranscode/main.cpp
index 8036dfd..2287d88 100644
--- a/mythtv/programs/mythtranscode/main.cpp
+++ b/mythtv/programs/mythtranscode/main.cpp
@@ -596,7 +596,7 @@ int main(int argc, char *argv[])
 
     if (fifo_info)
     {
-        delete transcode;
+//        delete transcode;
         return GENERIC_EXIT_OK;
     }

comment:4 by beirdo, 14 years ago

Turns out that we have far too many things freeing player_ctx in the code that runs before that. I could either put in "player_ctx = NULL;" after each delete, or do it the simpler way. I went for the simpler way.

comment:5 by Gavin Hurlbut <ghurlbut@…>, 14 years ago

Resolution: fixed
Status: assignedclosed

In c5a9262355a51b2d2b0465234d79b527c3907e84/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:6 by beirdo, 14 years ago

Milestone: unknown0.26

comment:7 by beirdo, 14 years ago

Milestone: 0.260.25.1

comment:8 by Gavin Hurlbut <ghurlbut@…>, 14 years ago

In 9cb904e9b9998ea94eadba4db54c0af10dc893f0/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

by danielk, 14 years ago

Attachment: 10616-v1.patch added

Attempt at better fix.

comment:9 by danielk, 14 years ago

Resolution: fixed
Status: closednew

Gavin, when I saw the QPointer<> fix I suspected there was a deeper problem here and there is. A PlayerContext takes ownership of the MythPlayer and input RingBuffer, but we're keeping pointers to them in Transcode which become invalid as soon as the PlayerContext is deleted. I've attached a patch which both manages the PlayerContext pointer and makes sure we don't keep any pointers to delete MythPlayer and RingBuffer instances around.

I haven't tested this patch at all. If you would like me to take ownership of this ticket let me know, otherwise I'm pretty sure you can use this as is.

comment:10 by beirdo, 14 years ago

That does look workable. I'll look at incorporating it tonight.

comment:11 by Daniel Kristjansson <danielk@…>, 13 years ago

In 4a3581db9acf059142143426caf46e91cbe96153/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:12 by beirdo, 13 years ago

Milestone: 0.25.10.26
Resolution: Fixed
Status: newclosed

Having heard no follow-up problems with Daniel's rework, I'm closing this.

Note: See TracTickets for help on using tickets.