[mythtv] mythfilldatabas[16844]: segfault at a0 ip 00007fbc0dd7a8e2 sp 00007fbbfd4ec090 error 4 in libmythdb-0.24.so.0.24.0[7fbc0dcce000+13d000]
James Courtier-Dutton
james.dutton at gmail.com
Sat Oct 30 19:14:58 UTC 2010
Hi,
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 ?? ()
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);
}
Kind Regards
James
More information about the mythtv-dev
mailing list