Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Date: Fri, 7 Sep 2001 21:24:34 -0400 From: Christopher Faylor To: cygwin-developers AT cygwin DOT com Subject: Re: I know CVS is hosed (this time for sure) Message-ID: <20010907212434.B19703@redhat.com> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20010906113843 DOT A30174 AT redhat DOT com> <20010906154534 DOT A32372 AT redhat DOT com> <20010906210535 DOT A8264 AT redhat DOT com> <20010907121943 DOT A27950 AT redhat DOT com> <20010907190951 DOT H17245 AT cygbert DOT vinschen DOT de> <20010907173823 DOT A4187 AT redhat DOT com> <20010908004753 DOT N17245 AT cygbert DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010908004753.N17245@cygbert.vinschen.de> User-Agent: Mutt/1.3.21i On Sat, Sep 08, 2001 at 12:47:53AM +0200, Corinna Vinschen wrote: >On Fri, Sep 07, 2001 at 05:38:23PM -0400, Christopher Faylor wrote: >> On Fri, Sep 07, 2001 at 07:09:51PM +0200, Corinna Vinschen wrote: >> >>>Did this patch work? It seems to for me. >> >> >> >>The last we heard, another similar patch to this one didn't work for >> >>Corinna. >> >> >> >>I'd like to get confirmation that this one works ok. >> > >> >Sorry, it doesn't work for me. I tried the plain version from CVS and >> >the same including the cygheap.cc patch which you've send here. My >> >testcase is a `make' in a Cygwin build tree. This testcase crashes now >> >on a regular basis in /bin/sh. I'm getting the following backtrace in >> >gdb with and without your yesterday's patch in cygheap.cc: >> >> The problem was, as I suspected, due to the zombies allocation. The >> problem is that allocating the zombies array only when needed caused the >> heap to grow while the program was in the process of forking. So, >> when the parent tried to copy the heap to the child during a fork, the >> heap was larger in the parent than in the child. Boom. > >When I read the above description I got a bit pale first... heap grows >while program forks... Yep. The process thread detects that a subprocess has ended and wants to put the subprocess info in the zombie array. Meanwhile, our old friend fork has started a child process and told it that the heap was x bytes long. The subprocess thread grows the heap heap and the parent tries to copy that much to it... I am surprised that it was so easy to reproduce. It seems like it would only happen when something was rapidly forking, but even then... It makes me wonder if there is some unintentional synchronization going on somewhere. >> Corinna and Egor, can you verify if this checkin fixes things. > >That looks awful good now. Phew. Thanks. cgf