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

Jean-Yves Avenard jyavenard at gmail.com
Sun Oct 31 07:06:52 UTC 2010


Hi

On 31 October 2010 11:35, James Courtier-Dutton <james.dutton at gmail.com> wrote:
> The "if (d)" fixed the problem. It was not a out-of-memory problem,
> because I have about 2Gig RAM free in a 4Gig RAM machine.
> mythtv-backend is taking about 760M.
>
> I think it is a much neater solution than
> http://svn.mythtv.org/trac/changeset/24291

One of the fundamental point of using C++ ; is that the pointer
returned can not be null due to memory constraint and it will throw an
exception before this happen.
The only exception to this rule was VC6 that didn't conform to it and
would return 0.

There should be no need to test the returned value ; std::bad_alloc
will be thrown before.

It is usually a good practice to set the pointer to null prior after
calling delete, so you would test for null before the allocation is
performed; not after.

So this rule out the out of memory issue.

JY


More information about the mythtv-dev mailing list