This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]