Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Wed, 27 Jun 2001 22:21:05 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com, cygwin-patches AT cygwin DOT com Subject: Re: pthreads works, sorta - got it Message-ID: <20010627222105.A29564@redhat.com> Reply-To: cygwin-patches AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, cygwin-patches AT cygwin DOT com References: <20010627012932 DOT I19058 AT redhat DOT com> <20010627013502 DOT K19058 AT redhat DOT com> <008201c0ff0d$8fe3c2a0$806410ac AT local> <009701c0ff0e$4d796400$806410ac AT local> <00e501c0ff14$6ad8dd40$806410ac AT local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <00e501c0ff14$6ad8dd40$806410ac@local>; from robert.collins@itdomain.com.au on Thu, Jun 28, 2001 at 12:21:11AM +1000 On Thu, Jun 28, 2001 at 12:21:11AM +1000, Robert Collins wrote: >Got the bug... attached is a correct patch that doesn't break anything >AFAICT. > >GCC was optimising the variable access when the macro >check_null_empty-path_errno was used, and accessing the memory area _before_ >the readcheck! The overhead of a proper function should be lower than that >of VirtualQueryHowever, so I've made it a function. It could have the guts >of check_null_empty_path copied into it for speed, but that's optional IMO. > >Wed Jun 27 23:30:00 2001 Robert Collins > > * path.h (check_null_empty_path_errno): Convert to a function > prototype. > * path.cc (check_null_empty_path_errno): New function. > (check_null_empty_path): Change from VirtualQuery to IsBadWritePtr. > * resource.cc (getrlimit): Ditto. > (setrlimit): Ditto. > * thread.cc (check_valid_pointer): Ditto. Thanks for the patch. I took it a step further. I renamed the _path stuff to _str for consistency, and created some check_null_invalid_struct* functions. It has been checked in. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/