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

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Wed Aug 11 15:29:00 GMT 2010


On Wed, Aug 11, 2010 at 05:17:27PM +0200, Corinna Vinschen wrote:
>On Aug 11 10:57, Christopher Faylor wrote:
>> On Wed, Aug 11, 2010 at 10:54:07AM -0400, Christopher Faylor wrote:
>> >4) Break path into convenient chunks and first change to an absolute path
>> >whose length is <= MAXPATHLEN and then change to relative paths whose
>> >lenghts are also <= MAXPATHLEN.
>> >
>> >I thought that this technique worked but maybe I'm mistaken.  If it does,
>> >it would be a foolproof but slow way of cd'ing to a long path.
>> 
>> Actually, it isn't exactly foolproof because it wouldn't be thread-safe
>> with Windows API functions.  We could make it threadsafe with cygwin
>> functions though.
>
>The problem is that it won't work.  The CWD restriction to a path of 259
>chars is an absolute one.

Ok, in that case, I think we should go as deep as possible before
stopping rather than placing someone in some random other directory.
That's seems to be what cmd.exe does, on XP at least.  And, I think
Cygwin programs should still work regardless but Cygwin should set the
cwd for pure-windows programs in deepest possible directory path.

Or, even better, maybe a Windows program should fail entirely if you try
to execute it in a path which is too deep.

cgf



More information about the Cygwin-developers mailing list