1.7.5: Occasional failure of CreatePipe or signal handing due to thread-unsafe code in cwdstuff::set

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Aug 12 16:26:00 GMT 2010


On Aug 12 12:14, Christopher Faylor wrote:
> On Thu, Aug 12, 2010 at 06:07:27PM +0200, Corinna Vinschen wrote:
> >On Aug 12 11:51, Christopher Faylor wrote:
> >> On XP, at least, we could set the current directory to '//?/PIPE'.
> >> That causes CreateFile to fail.  I used the program below to test
> >> that.
> >> 
> >>   sh-3.2$ ./setdir '//?/PIPE'
> >>   SetCurrentDirectory succeeded
> >>   CreateFile failed, 123
> >> 
> >> I'll try that on other systems to see if it still behaves predictably.
> >
> >Works fine on W7 if you specify \\?\PIPE\, with the trailing backslash.
> >Without trailing backslash it fails:
> >
> > $ ./setdir '\\?\PIPE'
> > SetCurrentDirectory faile, 123
> >
> > $ ./setdir '\\?\PIPE\'
> > CreateFile failed, 2
> >
> >That sounds like a neat solution.  I would never have expected that
> >SetCurrentDirectory works for the pipe FS.
> 
> Thanks for testing.  As is always the case, I've just found that my
> virtual machines have all stopped working so I couldn't quickly test
> this myself.  I'm rebuilding my kernel now.  Then I'll find that a bunch
> of other stuff has broken.  Then I'll rebuild that.  So, sometime
> mid-next-week I'll be able to actually try this myself.
> 
> Btw, I found this by stepping through the //?/Global??/ namespace
> as shown by the sysinternals Winobj utility.

Yeah, Winobj is one of my favorite tools.  Nevertheless, I would
never have expected... etc.

Btw:

  SetCurrentDirectory ("//?/PIPE/");
  CreateFile ("../C:/foo", ...);

works.  Go figure!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list