X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Sat, 4 Sep 2010 11:26:26 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 1.7.5: Occasional failure of CreatePipe or signal handing due to 	thread-unsafe code in cwdstuff::set
Message-ID: <20100904092626.GE16534@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <3C031C390CBF1E4A8CE1F74DE7ECAF3A140684F0AA@MBX8.EXCHPROD.USA.NET> <20100811084926.GC26152@calimero.vinschen.de> <3C031C390CBF1E4A8CE1F74DE7ECAF3A140684F0B0@MBX8.EXCHPROD.USA.NET> <AANLkTimpBCKzUioEarGiKMQbTjN+6s9iDYm_zzZ2Lxr9@mail.gmail.com> <20100812081151.GT14202@calimero.vinschen.de> <3C031C390CBF1E4A8CE1F74DE7ECAF3A158EDA702A@MBX8.EXCHPROD.USA.NET> <20100903073740.GA1749@calimero.vinschen.de> <3C031C390CBF1E4A8CE1F74DE7ECAF3A158EDA702D@MBX8.EXCHPROD.USA.NET>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <3C031C390CBF1E4A8CE1F74DE7ECAF3A158EDA702D@MBX8.EXCHPROD.USA.NET>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Sep  3 16:18, John Carey wrote:
> On Sep 03 12:37 Corinna Vinschen wrote:
> > On Sep  2 23:32, John Carey wrote:
> > > In Aug 17 10:15, Corinna Vinschen wrote:
> > > > I just released 1.7.6-1.
> > > ...
> > > > What changed since Cygwin 1.7.5:
> > > > ================================
> > > >
> > > > - Cygwin handles the current working directory entirely on its own.  The
> > > >   Win32 current working directory is set to an invalid path to be out of
> > > >   the way.  This affects calls to the Win32 file API (CreateFile, etc.).
> > > >   See http://cygwin.com/htdocs/cygwin-ug-net/using.html#pathnames-win32-api
> > >
> > > Thank you very much for the fix!
> > >
> > > I've been running tests against Cygwin 1.7.6, and then 1.7.7,
> > > and those sporadic, non-deterministic failures in CreatePipe
> > > did stop after the 1.7.6 upgrade, and are still gone in 1.7.7.
> > > I think it's been long enough to conclude that it is not just
> > > the non-determinism--it really is fixed, as expected.
> > >
> > > I understand that this issue opened a can of worms;
> > > thanks again for your efforts to overcome those difficulties.
> > 
> > I still don't like the final workaround, which is, to set the Win32 CWD
> > to the Cygwin CWD.  It would be nice if we could revert that change to
> > the pre-1.7.6 behaviour in a Vista-friendly way.  If you ever find out
> > how to make sure that the new handle in the PEB's user parameter block
> > is used even on Vista and later, pray tell me.
> 
> Thus far the only ideas I have come up with are somewhat
> shaky and go well beyond the documented Win32 API.
> (If only there was the equivalent of dup2(), but for Win32
> handles!!!)

ACK.

> Just how much undocumented behavior is
> tolerable, do you think?

Up to XP/2K3, we can simply set the handle in the user parameter block
and be done with it, just as in 1.7.5, but without the Vista workaround.

The problem only starts with Vista.  I have no objections to use
undocumented features, if they work.  If there's any way to replace the
cwd handle with our own *and* keep the Win32 API happy, I'll take it.


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

