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: <41B9F259.4000903@kleckner.net> Date: Fri, 10 Dec 2004 11:00:41 -0800 From: Jim Kleckner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: cygwin-gcc-fopen bug? (Purify) References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Dave Korn wrote: >>-----Original Message----- >>From: cygwin-owner On Behalf Of Lester Ingber >>Sent: 10 December 2004 16:14 ... > Your code has a bug: a stray pointer or array overwrite that is trashing some > memory. The only reason you get away with it on Solaris is by sheer luck; > either the stack or heap layout is different, or the random uninitialised > contents of a variable point somewhere harmless or something like that. > > Since you can see a NUL (heh, NULL != NUL you know!) appearing in the middle > of the name string, you could always set a gdb watchpoint on it to see exactly > when it gets stomped and what instruction is doing it. We used to use Purify to find these sorts of problems often just by running the program once. Unfortunately for us using cygwin, Purify appears to have moved toward a firm dependence on VC. Also, it is quite expensive. However, since you say that you use Solaris you may be able to use it on that platform. Often, the trial period is all you need to find that pesky problem (and probably a host of others in the process...). Info: http://tinyurl.com/54fg6 Trial for Unix: http://tinyurl.com/6vle6 Trial for Win: http://tinyurl.com/4t8mf One concern is that I recall that they may not be using their very strong "object code insertion" technique on Unix any longer and, without that, Purify becomes fairly similar to BoundsChecker. Has anyone out there gotten either Purify or BoundsChecker to work with Cygwin? I'll wager that if you could, Purify would pinpoint a lot of tricky issues extremely quickly. Maybe a tool to munge the symbol table into VC-compatible form? Jim -- 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/