debugging a cygheap leak

Eric Blake
Thu May 1 12:23:00 GMT 2008

The m4 development head has a test where it repeatedly loads and unloads a 
dynamic module using libtool to wrap dlopen() and friends.  This is 
working fine under 1.5.x, with no memory growth after the first reload. 
But in 1.7.0, memory usage continually grows, then the test is crashing 
after about 1700 iterations with a call to api_fatal,

      1 [main] m4 18392
\\?\C:\cygwin\home\eblake\m4-head\build\src\.libs\m4.exe: *** fatal
error - cmalloc would have returned NULL

Any ideas on how to go about debugging this?  It looks like a memory leak 
regression in 1.7.0.  But with my self-built cygwin1.dll and cygwin1.dbg, 
I don't know where to set a breakpoint to catch it - trying 'b api_fatal' 
fails.  Meanwhile, I'll continue trying to come up with a STC that doesn't 
involve the entire m4/libtool wrapper around dlopen.

Don't work too hard, make some time for fun as well!

Eric Blake   

More information about the Cygwin-developers mailing list