[mythtv] mythfilldatabas[16844]: segfault at a0 ip 00007fbc0dd7a8e2 sp 00007fbbfd4ec090 error 4 in libmythdb-0.24.so.0.24.0[7fbc0dcce000+13d000]

Michael T. Dean mtdean at thirdcontact.com
Sat Oct 30 19:58:35 UTC 2010


  On 10/30/2010 03:14 PM, James Courtier-Dutton wrote:
> I am trying to work out why this is happening.
> The core dump gives this:
> Program terminated with signal 11, Segmentation fault.
> #0  0x00007fbc0dd7a8e2 in MythCoreContext::ClearSettingsCache
> (this=0xdcab60, myKey=...) at mythcorecontext.cpp:629
> 629         d->m_database->ClearSettingsCache(myKey);
> (gdb) bt
> #0  0x00007fbc0dd7a8e2 in MythCoreContext::ClearSettingsCache
> (this=0xdcab60, myKey=...) at mythcorecontext.cpp:629
> #1  0x00007fbc0dd7cb45 in MythCoreContext::readyRead (this=0xdcab60,
> sock=0xdfa140) at mythcorecontext.cpp:890
> #2  0x00007fbc0dd1f80c in MythSocketThread::ReadyToBeRead
> (this=0xd92720, sock=0xdfa140) at mythsocketthread.cpp:165
> #3  0x00007fbc0dd2234d in MythSocketThread::run (this=0xd92720) at
> mythsocketthread.cpp:352
> #4  0x00007fbc07e9827e in ?? () from /usr/lib/libQtCore.so.4
> #5  0x00007fbc097f6953 in ?? () from /usr/lib/nvidia-current/libGL.so.1
> #6  0x00007fbc09cdb971 in start_thread (arg=<value optimised out>) at
> pthread_create.c:304
> #7  0x00007fbc073e791d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
> #8  0x0000000000000000 in ?? ()

In which app is this happening?  What's occurring when it happens?  Is 
it just:

http://svn.mythtv.org/trac/ticket/7714

> And further analysis means that the segfault is due to d being NULL.
> But d is created in the constructor.
> MythCoreContext::MythCoreContext(const QString&binversion,
>                                   QObject *guiContext)
>      : d(NULL)
> {
>      d = new MythCoreContextPrivate(this, binversion, guiContext);
> }
>
> So, I conclude that this is due to out of memory.
> The problem I have, is what is the correct fix.
> When the new call fails, what is the correct error path?
> One option is just to do this:
>
> void MythCoreContext::ClearSettingsCache(const QString&myKey)
> {
>      if (d)        //<- add this line.
>         d->m_database->ClearSettingsCache(myKey);
> }

Well, if we have no MythContextPrivate, the whole app will fail, so not 
a lot you can do--especially if you're out of memory.  Fail, exit, ...

If m_database is NULL, there may more you can do.

If it's #7714, the proper fix is a bit complex, and we'll probably just 
include http://svn.mythtv.org/trac/changeset/24291 in 0.24 (like we did 
in 0.23) since we don't have time to do (nor want the instability caused 
by the changes required for) the proper fix before release.

Mike


More information about the mythtv-dev mailing list