Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-ID: <20031122002949.29224.qmail@web41402.mail.yahoo.com> Date: Fri, 21 Nov 2003 16:29:49 -0800 (PST) From: Lloyd Lewins Subject: Re: 1.5.5: SEGV in calloc before start of main To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Well I figured out the problem. The application defines its own heap management routines (malloc, free, realloc). However it does NOT define calloc. The existance of an application defined malloc causes malloc_wrappers to vector dll calloc calls to the application. However, since the application doesn't define calloc, the stub immediately calls the wrapper version again. An infinite recursion results, ensuing in a segv. I suggest that the wrappers would be more robust if they checked for the existance of all the routines they plan to call (including free) -- and at least generated a helpful error message (this was a pain for a non-cygwin expert to debug!) I am a little uncomfortable with the idea that the startup code makes calls into the application (malloc etc) before the application is fully initialized (and before it has a chance to initialize itself in main). However, I guess that is one of the hazards of writing your own "system calls" (malloc etc). Lloyd Lewins __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- 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/