X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
X-USANET-Received: from gateout02.mbox.net [127.0.0.1] by gateout02.mbox.net via mtad (C8.MAIN.3.65C) 	with ESMTP id 092oiNRnQ7824Mo2; Tue, 14 Sep 2010 17:39:43 -0000
X-USANET-Source: 165.212.120.254 IN   aeolus@electric-cloud.com s1hub4.EXCHPROD.USA.NET
X-USANET-MsgId: XID394oiNRnr3270Xo2
From: John Carey <aeolus@electric-cloud.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Date: Tue, 14 Sep 2010 17:39:41 +0000
Subject: RE: 1.7.5: Occasional failure of CreatePipe or signal handing due to 	thread-unsafe code in cwdstuff::set
Message-ID: <3C031C390CBF1E4A8CE1F74DE7ECAF3A15945FDD80@MBX8.EXCHPROD.USA.NET>
References: <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> <20100904092626.GE16534@calimero.vinschen.de> <3C031C390CBF1E4A8CE1F74DE7ECAF3A158EDA704C@MBX8.EXCHPROD.USA.NET> <20100911103010.GM16534@calimero.vinschen.de> <3C031C390CBF1E4A8CE1F74DE7ECAF3A15945FDD78@MBX8.EXCHPROD.USA.NET>,<20100914081225.GE16534@calimero.vinschen.de>
In-Reply-To: <20100914081225.GE16534@calimero.vinschen.de>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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 14 01:12, Corinna Vinschen wrote:
> On Sep 13 19:47, John Carey wrote:
> > On Sep 11 03:30, Corinna Vinschen:
> > Anyway, it looks to me as if overwriting the path in an existing
> > VistaCwd instance would confuse RtlGetCurrentDirectory_U() and
> > probably other Win32 API functions.  (It may be that the same is
> > true for the handle member; I have not tried to find that out.)
> > Cygwin should probably allocate a new VistaCwd instance,
> > as does the Win32 SetCurrentDirectory() implementation.
>=20
> Hmm, I'm still wondering.  In theory we don't have to replace the
> directory name.  We just have to InterlockedExchange the handle, since
> we only need to replace the original handle which does not allow
> sharing-for-delete with our own handle which does.
>=20
> All other border cases (virtual dir, directory with restricted rights)
> can be rightfully handled by setting the Win32 CWD to \\?\PIPE\ again.
>=20
> That's at least worth a try, isn't it?

Oh, I had thought that you wanted it for long paths
and directories with restricted rights, too.

There's one other issue: the new directory will limit deletion
very briefly, until replaced.  I don't know if that will bother
people as much as the current situation.

-- John

--
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

