[mythtv] Seg Fault: AMD64 and PVR350 TV-Out (with potential patch)

Mike Sullivan mike at regexia.com
Wed Oct 20 06:37:49 UTC 2004


Hello,

On my x86-64 Gentoo box, mythfrontend would crash as soon as I tried to
watch TV (with live TV or recordings). I made the backtrace (provided as
gdb_trace.txt) and did a bit of digging. I've provided the changes I've made
to libs/libmythtv/videoout_ivtv.cpp for my system in videoout_ivtv.diff --
the pointer is converted to a long instead of an int, where it was
overflowing before (8 bytes vs 4 bytes for an int *).

My C++ is quite rusty, so I'm not sure if this is a valid way to fix the
issue on normal x86 box (would it just be a waste of a few bytes of
memory?).

Hope this helps! :)

-- Mike
-------------- next part --------------
# gdb mythfrontend
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you 
are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for 
details.
This GDB was configured as "x86_64-pc-linux-gnu"...Using host 
libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /usr/local/bin/mythfrontend
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 26800)]
[New Thread 32769 (LWP 26803)]
[New Thread 16386 (LWP 26804)]
2004-10-15 22:03:53 mythfrontend version: 0.16.20041005-1 www.mythtv.org
2004-10-15 22:03:53 Enabled verbose msgs : important general
[New Thread 32771 (LWP 26807)]
2004-10-15 22:03:54 Registering Internal as a media playback plugin.
2004-10-15 22:03:55 Starting media monitor.
[New Thread 49156 (LWP 26808)]
[New Thread 65541 (LWP 26810)]
2004-10-15 22:03:58 Connecting to backend server: 127.0.0.1:6543 (try 1 
of 5)
2004-10-15 22:03:58 Using protocol version 14
2004-10-15 22:03:59 Using protocol version 14
2004-10-15 22:03:59 Using protocol version 14
[New Thread 81926 (LWP 26813)]
[New Thread 98311 (LWP 26814)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 81926 (LWP 26813)]
0x0000002a97eee290 in memset () from /lib/libc.so.6
(gdb) thread apply all bt full

Thread 8 (Thread 98311 (LWP 26814)):
#0  0x0000002a97f2bdc6 in select () from /lib/libc.so.6
No symbol table info available.
#1  0x0000002a974dbd49 in QSocketDevice::waitForMore(int, bool*) const 
()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#2  0x0000002a9648a3fd in RemoteFile::Read(void*, int) (this=0x7366c0,
    data=0x2aa4fed010, size=128000) at remotefile.cpp:240
        recv = 0
        sent = 128000
        zerocnt = 1
        error = false
        response = false
        strlist = {<QValueList<QString>> = {sh = 0x71f0e0}, <No data 
fields>}
#3  0x0000002a95a1ac7d in RingBuffer::safe_read(RemoteFile*, void*, 
unsigned) (
    this=0x7cdf50, rf=0x7366c0, data=0x2aa4fed010, sz=128000)
    at RingBuffer.cpp:604
        ret = 0
#4  0x0000002a95a1b5e5 in RingBuffer::ReadAheadThread() (this=0x7cdf50)
    at RingBuffer.cpp:823
        totfree = 128000
        ret = 128000
---Type <return> to continue, or q <return> to quit---
        used = 512001
#5  0x0000002a95a1b38b in RingBuffer::startReader(void*) (type=0x7cdf50)
    at RingBuffer.cpp:762
        rbuffer = (RingBuffer *) 0x7cdf50
#6  0x0000002a978fee3e in pthread_start_thread () from 
/lib/libpthread.so.0
No symbol table info available.
#7  0x0000002a978feedd in pthread_start_thread_event ()
   from /lib/libpthread.so.0
No symbol table info available.
#8  0x0000002a97f31c83 in clone () from /lib/libc.so.6
No symbol table info available.

Thread 7 (Thread 81926 (LWP 26813)):
#0  0x0000002a97eee290 in memset () from /lib/libc.so.6
No symbol table info available.
#1  0x0000002a95b653a1 in VideoOutputIvtv::Init(int, int, float, 
unsigned long,int, int, int, int, unsigned long) (this=0x791100, 
width=720, height=480,
    aspect=1.33333004, winid=37749042, winx=0, winy=0, winw=1600, 
winh=1200,
    embedid=0) at videoout_ivtv.cpp:207
        fbdev = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x754a50,
  static shared_null = 0x60f930}
---Type <return> to continue, or q <return> to quit---
        fbstate = {status = 13, alpha = 0}
        igfb = {mem = 0xffffff0001e89000, size = 1382400, sizex = 720,
  sizey = 480}
        pagesize = 4096
        fbno = 0
        pagemask = -4096
#2  0x0000002a9599df40 in NuppelVideoPlayer::InitVideo() (this=0x78cea0)
    at NuppelVideoPlayer.cpp:399
        widget = (struct QWidget *) 0x740bd0
#3  0x0000002a959a40bf in NuppelVideoPlayer::StartPlaying() 
(this=0x78cea0)
    at NuppelVideoPlayer.cpp:1653
        output_video = 182931431232
        decoder_thread = 0
        pausecheck = 0
#4  0x0000002a95a3bc2d in SpawnDecode(void*) (param=0x78cea0)
    at tv_play.cpp:201
        nvp = (NuppelVideoPlayer *) 0x78cea0
#5  0x0000002a978fee3e in pthread_start_thread () from 
/lib/libpthread.so.0
No symbol table info available.
#6  0x0000002a978feedd in pthread_start_thread_event ()
   from /lib/libpthread.so.0
No symbol table info available.
#7  0x0000002a97f31c83 in clone () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
No symbol table info available.

Thread 6 (Thread 65541 (LWP 26810)):
#0  0x0000002a97f09875 in nanosleep () from /lib/libc.so.6
No symbol table info available.
#1  0x0000002a97f2c588 in usleep () from /lib/libc.so.6
No symbol table info available.
#2  0x0000002a95a41530 in TV::StartPlayerAndRecorder(bool, bool) (
    this=0x75bc80, startPlayer=true, startRecorder=true) at 
tv_play.cpp:803
No locals.
#3  0x0000002a95a4071b in TV::HandleStateChange() (this=0x75bc80)
    at tv_play.cpp:661
        filesize = 5368709120
        smudge = 104857600
        name = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x794fa0,
  static shared_null = 0x60f930}
        changed = true
        tmpInternalState = kState_WatchingLiveTV
        statename = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x7b0a80,
---Type <return> to continue, or q <return> to quit---
  static shared_null = 0x60f930}
        origname = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x790020,
  static shared_null = 0x60f930}
#4  0x0000002a95a435d9 in TV::RunTV() (this=0x75bc80) at 
tv_play.cpp:1084
        progress = 0
        keypressed = (QKeyEvent *) 0x75bc80
        updatecheck = 3
#5  0x0000002a95a42fbd in TV::EventThread(void*) (param=0x75bc80)
    at tv_play.cpp:1027
        thetv = (class TV *) 0x75bc80
#6  0x0000002a978fee3e in pthread_start_thread () from 
/lib/libpthread.so.0
No symbol table info available.
#7  0x0000002a978feedd in pthread_start_thread_event ()
   from /lib/libpthread.so.0
No symbol table info available.
#8  0x0000002a97f31c83 in clone () from /lib/libc.so.6
No symbol table info available.

Thread 5 (Thread 49156 (LWP 26808)):
#0  0x0000002a97904b75 in nanosleep () from /lib/libpthread.so.0
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#1  0x0000002a9790158f in __pthread_timedsuspend_new ()
   from /lib/libpthread.so.0
No symbol table info available.
#2  0x0000002a978fe0ad in pthread_cond_timedwait_relative ()
   from /lib/libpthread.so.0
No symbol table info available.
#3  0x0000002a972d3785 in QThread::exit() () from 
/usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#4  0x0000002a972d38a4 in QThread::msleep(unsigned long) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#5  0x0000002a9653a3a9 in MonitorThread::run() (this=0x687730)
    at mythmediamonitor.cpp:76
No locals.
#6  0x0000002a972d3494 in QThreadInstance::start(void*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#7  0x0000002a978fee3e in pthread_start_thread () from 
/lib/libpthread.so.0
No symbol table info available.
#8  0x0000002a978feedd in pthread_start_thread_event ()
   from /lib/libpthread.so.0
No symbol table info available.
#9  0x0000002a97f31c83 in clone () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
No symbol table info available.

Thread 4 (Thread 32771 (LWP 26807)):
#0  0x0000002a9790419f in read () from /lib/libpthread.so.0
No symbol table info available.
#1  0x0000002a98091e1b in lirc_nextcode (code=0x2a9a74be48)
    at lirc_client.c:1493
        packet_size = 100
        end_len = 0
        len = -512
        end = 0x0
        c = 112 'p'
#2  0x0000002a9653d2b5 in LircClient::Process() (this=0x680990) at 
lirc.cpp:67
        code = 0x0
        ir = 0x0
        ret = 0
#3  0x0000002a964fe49a in SpawnLirc (param=0x71a4e0) at 
mythdialogs.cpp:52
        main_window = (MythMainWindow *) 0x71a4e0
        config_file = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x6807f0,
  static shared_null = 0x60f930}
        program = {static null = {
---Type <return> to continue, or q <return> to quit---
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x752c80,
  static shared_null = 0x60f930}
        cl = (class LircClient *) 0x680990
#4  0x0000002a978fee3e in pthread_start_thread () from 
/lib/libpthread.so.0
No symbol table info available.
#5  0x0000002a978feedd in pthread_start_thread_event ()
   from /lib/libpthread.so.0
No symbol table info available.
#6  0x0000002a97f31c83 in clone () from /lib/libc.so.6
No symbol table info available.

Thread 3 (Thread 16386 (LWP 26804)):
#0  0x0000002a979015de in __pthread_sigsuspend () from 
/lib/libpthread.so.0
No symbol table info available.
#1  0x0000002a97901460 in __pthread_wait_for_restart_signal ()
   from /lib/libpthread.so.0
No symbol table info available.
#2  0x0000002a978fde81 in pthread_cond_wait at GLIBC_2.2.5 ()
   from /lib/libpthread.so.0
No symbol table info available.
#3  0x0000002a97564010 in QWaitCondition::wait(unsigned long) ()
   from /usr/qt/3/lib/libqt-mt.so.3
---Type <return> to continue, or q <return> to quit---
No symbol table info available.
#4  0x0000002a9647b7e3 in MythContext::waitPrivRequest() const 
(this=0x63c090)
    at mythcontext.cpp:1663
No locals.
#5  0x00000000004288fc in run_priv_thread (data=0x0) at main.cpp:639
No locals.
#6  0x0000002a978fee3e in pthread_start_thread () from 
/lib/libpthread.so.0
No symbol table info available.
#7  0x0000002a978feedd in pthread_start_thread_event ()
   from /lib/libpthread.so.0
No symbol table info available.
#8  0x0000002a97f31c83 in clone () from /lib/libc.so.6
No symbol table info available.

Thread 2 (Thread 32769 (LWP 26803)):
#0  0x0000002a97f2a36a in poll () from /lib/libc.so.6
No symbol table info available.
#1  0x0000002a978feb04 in __pthread_manager () from /lib/libpthread.so.0
No symbol table info available.
#2  0x0000002a978fed10 in __pthread_manager_event () from 
/lib/libpthread.so.0
No symbol table info available.
#3  0x0000002a97f31c83 in clone () from /lib/libc.so.6
No symbol table info available.
---Type <return> to continue, or q <return> to quit---

Thread 1 (Thread 16384 (LWP 26800)):
#0  0x0000002a97f09875 in nanosleep () from /lib/libc.so.6
No symbol table info available.
#1  0x0000002a97f2c588 in usleep () from /lib/libc.so.6
No symbol table info available.
#2  0x0000000000425d33 in startTV() () at main.cpp:293
        tv = (class TV *) 0x75bc80
        timer = {ds = 79439009}
        tryTV = false
        tryRecorder = false
        quitAll = false
        showDialogs = true
#3  0x0000000000425e7a in TVMenuCallback(void*, QString&) 
(data=0x63c090,
    selection=@0x7b55a0) at main.cpp:331
        sel = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x7bb920,
  static shared_null = 0x60f930}
#4  0x0000002a964a972b in ThemedMenuPrivate::handleAction(QString 
const&) (
    this=0x7b5460, action=@0x78b060) at themedmenu.cpp:2128
No locals.
#5  0x0000002a964a7ff6 in ThemedMenuPrivate::keyPressHandler(QKeyEvent*) 
(
---Type <return> to continue, or q <return> to quit---
    this=0x7b5460, e=0x7fbfffef70) at themedmenu.cpp:1958
        it = {node = 0x78b050}
        action = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x6953c0,
  static shared_null = 0x60f930}
        i = 0
        lastbutton = (ThemedButton *) 0x731f60
        oldrow = 0
        handled = true
        actions = {<QValueList<QString>> = {sh = 0x76db50}, <No data 
fields>}
#6  0x0000002a964aacf0 in ThemedMenu::keyPressEvent(QKeyEvent*) (
    this=0x733aa0, e=0x7fbfffef70) at themedmenu.cpp:2323
No locals.
#7  0x0000002a9735cee5 in QWidget::event(QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#8  0x0000002a972de8e2 in QApplication::internalNotify(QObject*, 
QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#9  0x0000002a972de377 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#10 0x0000002a97284233 in QETWidget::translateKeyEvent(_XEvent const*, 
bool) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#11 0x0000002a97280243 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#12 0x0000002a97294545 in QEventLoop::processEvents(unsigned) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#13 0x0000002a972edfe4 in QEventLoop::enterLoop() ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#14 0x0000002a972deac5 in QApplication::enter_loop() ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#15 0x0000002a96506c0f in MythDialog::exec() (this=0x733aa0)
    at mythdialogs.cpp:912
        res = 0
#16 0x000000000042724b in RunMenu(QString) (themedir=
      {static null = {static null = <same as static member of an already 
seen type>, d = 0x60f930, static shared_null = 0x60f930}, d = 0x68cb70, 
static shared_null = 0x60f930}) at main.cpp:488
        exitstatus = 0
---Type <return> to continue, or q <return> to quit---
#17 0x000000000042b848 in main (argc=1, argv=0x7fbffff9d8) at 
main.cpp:1025
        lcd_host = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x64a3f0,
  static shared_null = 0x60f930}
        lcd_port = 13666
        a = <incomplete type>
        logfile = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x649f40,
  static shared_null = 0x60f930}
        verboseString = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x64a220,
  static shared_null = 0x60f930}
        pluginname = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x64a270,
  static shared_null = 0x60f930}
        finfo = {fn = {static null = {
      static null = <same as static member of an already seen type>,
      d = 0x60f930, static shared_null = 0x60f930}, d = 0x64a2e0,
    static shared_null = 0x60f930}, fic = 0x0, cache = true, symLink = 
false}
---Type <return> to continue, or q <return> to quit---
        binname = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x64a330,
  static shared_null = 0x60f930}
        logfd = -1
        fileprefix = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x64a450,
  static shared_null = 0x60f930}
        dir = <incomplete type>
        priv_thread = 16386
        status = 0
        db = (struct QSqlDatabase *) 0x673460
        themename = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x71c190,
  static shared_null = 0x60f930}
        randomtheme = false
        themedir = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x60f930, static shared_null = 0x60f930}, d = 0x68cb70,
  static shared_null = 0x60f930}
        mainWindow = (class MythMainWindow *) 0x71a4e0
---Type <return> to continue, or q <return> to quit---
        pmanager = (MythPluginManager *) 0x680b30
        mon = (class MediaMonitor *) 0x6876d0
        exitstatus = 0
#0  0x0000002a97eee290 in memset () from /lib/libc.so.6
(gdb) quit
The program is running.  Exit anyway? (y or n) y
-------------- next part --------------
A non-text attachment was scrubbed...
Name: videoout_ivtv.diff
Type: application/octet-stream
Size: 615 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20041020/f45c07c8/videoout_ivtv.obj


More information about the mythtv-dev mailing list