delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/05/26/11:30:55

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type; q=dns; s=default; b=N/+kWMq1nCjeI1HszoOe6UYv/Ejmm
RIKJA3yeMPjWMZVVmkpLlwxWq5vTkXlt8Jq8sSGvUbB+xFLGSF6Fx6W6XpPY7ZiJ
bNNFlN+p/gsUoyWWHnK6XG1riB58XmdoCO0FRdCkdmsgX5lKke8yy9oraiaDBBT4
IuL0ICDfVDbTF0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type; s=default; bh=tB0nc4Ix3YRLFnJnYRF5/J/qudQ=; b=TXf
TArx/NfXlXMh7jqAdSsPp0N7GaKPW1bjx3SSAObjsLaaCCQVmYQAMv3l9ScglIv9
t92dBKVik7tuZlc+Na2XHH/P4Ri98OtAtmtgoGK94hBfxNeXtpZoiBjD5i0E0A20
JNBm1VArS7m/87uvyOrWTX55/lc1xMBJDkX5DmSo=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-ob0-f173.google.com
X-Received: by 10.60.159.5 with SMTP id wy5mr25968422oeb.58.1401118236616; Mon, 26 May 2014 08:30:36 -0700 (PDT)
MIME-Version: 1.0
From: Abhijit Bhattacharjee <itabhijitb AT gmail DOT com>
Date: Mon, 26 May 2014 20:59:56 +0530
Message-ID: <CANMjiJqz6uJ7pp=iS5FK_ZnS9nxCT1fY+EndcgzPan7sv2pXJA@mail.gmail.com>
Subject: Bash silently truncates the Command Line when called programatically via CreateProcess as MAXPATHLEN was reduced to 8192 from 16384
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On a typical configuration, we use gmake on windows as the build
system. GMAKE calls the Cygwin bash in order to invoke the MSVS
compiler in-order to satisfy the dependency if a rule to call the
compiler is present.
Now, for certain modules, the command line was seemingly getting
truncated. On investigating further it revealed the reason for the
truncation was because in the glob.cc, MAXPATHLEN was now defined as
8192 so, when bash was compiled with the changed crt code, the problem
started to emerge.

Now, it also seems that there was a discussion
(https://cygwin.com/ml/cygwin-patches/2012-q1/msg00037.html) where
Corinna mentioned about decreasing the size to 4096 and later
increasing it to 8192. Unfortunately, for our case, 8192 is low a
limit and ideally the previous limit of 16384 was working perfectly.

The Argument that Corinna placed was because the default stack size is
2 Megs  and sizeof(Char)==8, a local array of 8* 16384  would be too
strenuous for the stack.

It was still not clear to me as to why?

1. The Temporary buffer was not allocated on heap?
2. Why the entire argument (both quoted and non-quoted string) was
passed to the glob module. If instead, the argument string could had
been tokeinized  as interleaving quoted and non-quoted string, the
restriction imposed on the argument length would be alleviated. What I
am envisaging is, currently in the globify module, you are escaping
all the quoted characters to demarcate from the non-quoted characters
before calling glob once, so that the glob can only expand non-quoted
sub-string. Instead, if we could call glob multiple times whenever we
encounter a sub-string of non-quoted string, wouldn't it be cleaner?


In any case, as of now, for the time being I have increased the size
of MAXPATHLEN back to 16384  and recompiled the cygwin followed by
bash but am looking forward for a solution from your end, as this is
dirty, difficult to maintain, and likely to break in the future as our
cygwin build is different from what we have in the repository.



Rgrds,
Abhijit

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019