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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=tHqZzIygtv8Bnz3Z2OpLPP8XP/XERTy4CHNDTiFSO0VOH7/Q4Zcfc KZC8WiLcIkUwMxghvDiyQftBmE8dUkOMdU3Q5NozE9Ga/RUPTPP9SiXihla8WS40 xByLH0+riAfJ0GHgO03XAJQH//7iBwF68NO7uinTAM0eZfJ4rSE7yo= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=P1R7TZdQRrvWtlRKhWAnjxWx+Qw=; b=vE9FZd8SnP2PwmwI3iqiqMQnI6LR oGowyaA3RBF7LMO0Whofibm9VNgb4AxL8+zkVolJ2qvqamrfIX0W3jFCfJKxT1FQ UcDOKmMterE4866d+Xas0y7Y8e6h+Dpcp67YCpT/Q7FIAo/giDaDUKzeixKra+e5 ZTYbEmXn58zNF28= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: mho-02-ewr.mailhop.org X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18GzZYbLwCnTsd39kXjQPz+ Date: Mon, 26 May 2014 16:08:57 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Bash silently truncates the Command Line when called programatically via CreateProcess as MAXPATHLEN was reduced to 8192 from 16384 Message-ID: <20140526200857.GA3903@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) On Mon, May 26, 2014 at 08:59:56PM +0530, Abhijit Bhattacharjee wrote: >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. If you're using Cygwin's make it will not truncate paths if it is running cygwin programs. Not sure what MSVS is. >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? The source code comes from FreeBSD. Managing this on the heap would mean a rewrite and would have its own problems. Since this isn't really an issue when Cygwin calls Cygwin programs it likely isn't really high on anyone's priority list. >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? I don't really know what you're talking about but patches are always better than word descriptions. It sounds like you're using a non-Cygwin make to call a Cygwin process. If that is the case then it seems like the trivial fix is "Don't Do That" (tm) cgf -- 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