gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9600: Add comment about valgrind


From: Benjamin Wolsey
Subject: Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9600: Add comment about valgrind issue
Date: Wed, 27 Aug 2008 21:21:57 +0200

> +    // FIXME: for some odd reason, on rare occasions deleting this
> buffer
> +    // makes valgrind complain. It looks like memory corruption
> caused by something
> +    // else, but neither valgrind nor GDB can find it. We could
> always not delete
> +    // the buffer to keep valgrind happy, but then we leak memory. As
> the problem
> +    // appears to be that _buffer has a bogus address that doesn't
> match any allocated
> +    // Element, we assume this is a bug in our test case, but add
> comment here to be
> +    // paranoid.
>      delete _buffer;
>      delete[] _name;
>  }

The only other place _buffer (and _name) are explicitly deleted is in
element::clear(), isn't it? So if it's not a memory corruption, then it
might be because the pointers are not set to NULL after deleting there,
so that the delete in the dtor could possibly try deleting deleted data.

Holding _buffer in an auto_ptr would of course mean never having to
delete it (or explicitly initialize it), with in this case negligible
overhead. On the other hand, I've only just looked at the code and don't
have a very clear idea of data ownership :)

bwy

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]