Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Wed, 27 Jun 2001 02:42:03 -0400
From: Christopher Faylor <cgf@redhat.com>
To: cygwin@cygwin.com
Subject: Re: pthreads works, sorta
Message-ID: <20010627024203.A20077@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <EA18B9FA0FE4194AA2B4CDB91F73C0EF7A0C@itdomain002.itdomain.net.au> <030b01c0fed5$afbfddd0$c9823bd5@dima> <20010627023128.R19058@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.11i
In-Reply-To: <20010627023128.R19058@redhat.com>; from cgf@redhat.com on Wed, Jun 27, 2001 at 02:31:28AM -0400

On Wed, Jun 27, 2001 at 02:31:28AM -0400, Christopher Faylor wrote:
>On Wed, Jun 27, 2001 at 02:51:13PM +0800, Dmitry Timoshkov wrote:
>>"Robert Collins" <robert.collins@itdomain.com.au> wrote:
>>
>>[skipped]
>>
>>> What does all this mean? We need to catch invalid memroy access, and
>>> ValidQuery was supplied by Chris as a tool to do that.
>>
>>In a multithreaded environment VirtualQuery, IsBad* and similar approaches
>>are wrong. It can't be guaranteed that after a successful test that memory
>>will be still accessable.
>
>They are not necessarily wrong if they are controlled by appropriate mutexes.
>The file handling code should be protected this way.   I don't know about
>the thread code, though.

Actually, this is wrong.  I was assuming that access to an object X would
only be by well-behaved manipulators of object X.  It's possible for a rogue
thread to do something odd with a wild pointer and still screw up memory.

So SEH is the only safe way to handle this.  However, I don't think that SEH
will actually work in the Cygwin DLL.

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/

