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

Torbjörn Jansson torbjorn.jansson at mbox200.swipnet.se
Sun Oct 31 14:39:08 UTC 2010

> On Sat, Oct 30, 2010 at 5:35 PM, James Courtier-Dutton
> <james.dutton at gmail.com> wrote:
> > I am not exactly sure what "ClearSettingsCache" is for.
> > My if (d) makes this fail to call "ClearSettingsCache" if the object
> > has been destroyed and thus no segfault.
> > Do we actually want "ClearSettingsCache" to succeed, and therefore
> > require the object to not get destroyed until after the
> > "ClearSettingsCache" has happened?
> As the ClearSettingsCache is being done during shutdown, and the very
> next thing we do is exit, it's kinda pointless to worry about it not
> running.  The race condition exists between closing the socket and
> receiving that message from it.  It should be perfectly fine to do the
> if (d) around that, especially while we try to track down a nice way
> to avoid the race condition.  The if (d) won't hit if the private data
> class instance has been destroyed (and nulled out!), which should only
> happen during shutdown, and it's a fairly cheap check (compare
> register to 0).

I suspect the object is being called after it is destroyed.
"if (d)" or similar check for NULL may fix it but I would not consider this
the proper fix and may hide the real problem and come back as other odd
crashes later.

For example, let's say the object is destroyed and any member variables set
to NULL.
That memory then gets used for something else so the "if (d)" check fails
and now you try to do stuff with a garbage pointer (=crash)

More information about the mythtv-dev mailing list