[FFmpeg-devel] Longevity Test Report

Reimar Döffinger Reimar.Doeffinger
Wed Feb 4 12:13:24 CET 2009

On Wed, Feb 04, 2009 at 12:00:53PM +0100, Benjamin Larsson wrote:
> My suggestion to find these kind of problems is to wrap av_malloc in a 
> macro that expands av_malloc to av_leak_malloc(size,__FILE__,__LINE).

There are more than enough tools that do that already, only that most
suck. Please spend your efforts on fixing/improving those general
solutions instead implementing you own and very limited version.
Also the issue is not really a leak otherwise valgrind would probably
work fine (even if a little slow, and not on Windows).

> I know at least one ticket where this kind of tool would have helped 
> alot. Or we could use memwatch.

Neither your suggestions nor memwatch allow to get a backtrace AFAICT.
Considering that, just gdb alone seems to be able to do what you want
and far more (start program with gdb, STRG+C when you want to start
debugging, breakpoint on malloc, see where it hangs more often.
If there are a lot of mallocs, use e.g. "c 100" for continuing to get a
statistical sampling. I am sure more advanced stuff is possible using
conditional breakpoints, but I never had to resort to that)

More information about the ffmpeg-devel mailing list