delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/20/07:41:47

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 20 Aug 2009 13:41:24 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: find(1) memory leak in cygheap
Message-ID: <20090820114124.GQ32408@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <c8a3efee0908190447l11062bf1waba8ca9df5581468 AT mail DOT gmail DOT com> <20090819140322 DOT GB8713 AT ednor DOT casa DOT cgf DOT cx> <c8a3efee0908190804i4130ecbfp7561934ab2272da8 AT mail DOT gmail DOT com> <c8a3efee0908192309k4e207b4fs662d2c2baae8c0a2 AT mail DOT gmail DOT com> <20090820083926 DOT GJ32408 AT calimero DOT vinschen DOT de> <c8a3efee0908200323v6ffc605cuc74b45533bf99048 AT mail DOT gmail DOT com> <20090820111955 DOT GP32408 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20090820111955.GP32408@calimero.vinschen.de>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com


Oh, btw., please http://cygwin.com/acronyms/#PCYMTNQREAIYR


On Aug 20 13:19, Corinna Vinschen wrote:
> On Aug 20 18:23, Haojun Bao wrote:
> > Great. In fact, I also found this code myself might cause problem in path.h:
> > (we should test if path is NULL, and free it before the memcpy, and
> > other member pointers should also be checked and free-ed first, is it
> > about right?:-)
> 
> Yes and no.  It might look cleaner to free the pointers at this point
> if they are non-NULL, but in fact the operator= is called after the
> path_conv content has been memcpy'ed to another fhandler.  So, if you
> free the pointers, you free the pointers of another file descriptor.
> SEGV's galore!

...which means, path_conv::operator= should only be called for
uninitialized fhandlers.  It would be a bug in Cygwin if it's called on
an already initialized fhandler (with the well known result).


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019