Piotr Foltyn | 6 Mar 2012 18:06
Favicon

Changing MAXPATHLEN in glob.cc back to 16384

Hi,

Revision 1.7 of src/winsup/cygwin/glob.cc reduced maximum allowed path length from 16384 to 4096
characters. This is unfortunate because some paths used in my build system can reach 6k characters in
length. Attached patch reinstates 16384 characters limit.

--

-- 
Regards,
Piotr Foltyn

Attachment (maxpathlen.patch): application/octet-stream, 537 bytes
Corinna Vinschen | 7 Mar 2012 11:03
Favicon

Re: Changing MAXPATHLEN in glob.cc back to 16384

On Mar  6 17:06, Piotr Foltyn wrote:
> Hi,
> 
> Revision 1.7 of src/winsup/cygwin/glob.cc reduced maximum allowed path length from 16384 to 4096
characters. This is unfortunate because some paths used in my build system can reach 6k characters in
length. Attached patch reinstates 16384 characters limit.

MAXPATHLEN == PATH_MAX == 4096.  While the OS allows 32K char paths,
we don't support any longer paths than PATH_MAX.  There are other
restrictions in Cygwin based on PATH_MAX.

The problems with the size of MAXPATHLEN in glob.cc are:

- The buffer type is Char, which is defined as uint_fast64_t, which
  is 8 byte.

- The temporary buffers are allocated on the stack.  Each of them takes
  8 * MAXPATHLEN bytes,  32K vs. 128K.  3 of them are always needed,
  plus one MAXPATHLEN bytes buffer.  Additional MAXPATHLEN bytes buffers
  can be created via recursion.

- So the stack pressure just by calling glob and the glob internal
  functions it at least 400K if MAXPATHLEN is 16384.  That's quite a
  lot, given the default stacksizes of 2 Megs for the main thread and 1
  Meg for other threads.

Having said that, I'm willing to try with setting MAXPATHLEN to 8192.
I change that in CVS.

Corinna
(Continue reading)

Piotr Foltyn | 7 Mar 2012 11:37
Favicon

RE: Changing MAXPATHLEN in glob.cc back to 16384

Hi,

> Having said that, I'm willing to try with setting MAXPATHLEN to 8192.
> I change that in CVS.
That will help a lot, thank you.

-- 
Regards,
Piotr Foltyn


Gmane