Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Subject: Re: Checking input parameters of syscalls From: Robert Collins To: egor duda In-Reply-To: <1297610035.20010911125836@logos-m.ru> References: <20010910154431 DOT A792 AT dothill DOT com> <20010910222228 DOT X937 AT cygbert DOT vinschen DOT de> <1297610035 DOT 20010911125836 AT logos-m DOT ru> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/0.13 (Preview Release) Date: 11 Sep 2001 21:52:18 +1000 Message-Id: <1000209139.7266.183.camel@lifelesswks> Mime-Version: 1.0 X-OriginalArrivalTime: 11 Sep 2001 11:39:09.0558 (UTC) FILETIME=[5F031160:01C13AB6] On Tue, 2001-09-11 at 18:58, egor duda wrote: > Hi! > > Tuesday, 11 September, 2001 Corinna Vinschen cygwin-patches AT cygwin DOT com wrote: > > CV> Frankly, I don't know. My first guess is to prioritize correctness > CV> over speed ... > > [...] > > Speaking about correctness. I'm planning yet another update to > testsuite and found that many cygwin functions still crash when > application passes an invalid pointer to them, instead of returning > EFAULT. Should we leave this as it is (to avoid possible slowdown) or > sprinkle check_null_empty_str and check_null_invalid_struct all > around? quick testing shows that IsBadWritePtr() function is > quite fast (~10 microsecinds per call on my K6/400MHz), so i think > the latter is the right way to go. > I created check_valid_pointer for jsut this reason in thread.cc I cannot recall _why_ I didn't use the other two, but I recall some reason :}... And yes, IMO such trivial checks are essential for any function that can crash or corrupt cygwin - particularly with the daemon scenario :]. Rob