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

Gavin Hurlbut gjhurlbu at gmail.com
Sun Oct 31 19:07:00 UTC 2010

On Sun, Oct 31, 2010 at 7:39 AM, Torbjörn Jansson
<torbjorn.jansson at mbox200.swipnet.se> wrote:
> 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.

That's precisely what is happening.  There is a message coming in that
requires the private data item "d", but "d" has already been
destroyed, as we are shutting down.  The class that contains it has
not yet been destroyed, but will be very shortly.

> 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)

This won't happen as nothing will be allocated to "d" within that
class.  It's in the teardown process, not in normal operation.  If "d"
is valid, it will be used.  I think this fix is a good short-term fix
until we can work out the race condition and avoid it entirely.

More information about the mythtv-dev mailing list