Bug in cmalloc? Was: Re: Problems with: Improvements to fork handling (2/5)

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Sun May 29 16:28:00 GMT 2011

On Sun, May 29, 2011 at 01:51:35AM -0400, Ryan Johnson wrote:
>So, I defined this small function:
>static void break_cmalloc(int depth, int maxdepth) {
>     void* x = cmalloc (HEAP_2_DLL, 32);
>     cfree(x);
>     if (depth < maxdepth)
>         break_cmalloc(depth+1, maxdepth);
>and called it during fork instead of dlls.topsort(), with maxdepth=5. No 
>bug (as expected).
>Then I moved the call to cfree below the recursion, so memory gets freed 
>in reverse order. Bang. Bash goes down and takes mintty with it after 
>briefly flashing 'bad address.' Calling bash from cmd.exe hangs the 
>latter so badly Windows can't kill it (I guess I'll have to reboot).

Thanks for the test case.  I'll investigate later today.


More information about the Cygwin-patches mailing list