X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 5 Dec 2007 12:25:20 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Odd behaviour of __cygwin_environ? Message-ID: <20071205172520.GB3147@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <042c01c836a1$e6c0d1d0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <20071205123104 DOT GH26345 AT calimero DOT vinschen DOT de> <04a001c8374f$a58b1a00$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <20071205153214 DOT GI26345 AT calimero DOT vinschen DOT de> <04a801c83756$90a8b5f0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04a801c83756$90a8b5f0$2e08a8c0@CAM.ARTIMI.COM> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Wed, Dec 05, 2007 at 03:50:31PM -0000, Dave Korn wrote: >On 05 December 2007 15:32, Corinna Vinschen wrote: > >> On Dec 5 15:00, Dave Korn wrote: >>> On 05 December 2007 12:31, Corinna Vinschen wrote: >>>> Keep in mind that the size of the >>>> native environment block is restricted to 32K. >>> >>> I thought when cygexec was in effect the posix environment and >>> commandline were passed around-behind-the-back-of CreateProcess, bypassing >>> that limit? Or does it only handle the commandline but not environment? >> >> It also handles the environment block. Is there a native process in the >> call chain, maybe? > > Nope, it's all cygwin through and through. Big project using >make/gcc/binutils, nothing non-posix. > >> If not, I don't see any other chance than to debug >> this further. spawn_guts() and the build_env() functions might be good >> starting points for that. > > Thanks, that's what I'm trying right now. > > Disappointingly it disappears under strace. That might have been down to >the strace-is-a-win32-process-launching-a-cygwin-process anomaly, which is why >I'm hacking about the dll. Early results suggest that, even though I'm not >launching under strace, but instead enabling it (by calling strace.hello() >during initial_env() if I detect an environment variable in the win32 >environment), the problem still disappears, which makes me suspicious of it >still being a race somehow. I have a vague feeling that I'll regret mentioning this but, if you've built the DLL with --enable-debugging, you can set the CYGWIN_SLEEP environment variable, to some millisecond value that you want the cygwin process to sleep for and then attach to the process using 'strace -p'. You can also set the CYGWIN_DEBUG variable to the name of the program that you want to debug to have a debugger popped up when that program executes. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/