X-Spam-Check-By: sourceware.org From: "Dave Korn" To: Subject: RE: Intermittent cygwin heap allocation problem Date: Wed, 18 Jan 2006 17:10:27 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <20060118165703.GE15870@trixie.casa.cgf.cx> Message-ID: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Christopher Faylor wrote: > One scenario that I have seen is that a thread gets started when someone > hits CTRL-C while a forked process is starting up. Since only one > thread can execute at a time when a process is in DLL initialization, > the "other" thread's stack gets allocated but it hangs while cygwin > vainly tries to complete its initialization. I say "vainly" because the > initialization is doomed to fail since the other thread's stack has > often been allocated in cygwin's heap area. Hey, I get that CTRL-C one all the time. > 1.5.19 may have aggravated this problem since Corinna's changes to mmap > now use VirtualAlloc'ed space for privately mmapped areas. For some > inexplicable reason, this causes more of this type of collision. I > would swear that once a program uses a memory area in a parent, windows > is much more likely to use that memory for system-like things in the > "forked/execed" child. Well, a heap implementation that caches recently-freed blocks and always inserts them at the head lists might well have that effect! And IIUIC a SEC_IMAGE mapping is in fact not a real paging-based mapping but a bunch of heap-allocated memory (because the sections have to be aligned).... which would certainly explain why the recent-malloc-and-free history of the parent might influence the layout of mapped images in the child. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/