X-Spam-Check-By: sourceware.org Date: Fri, 26 May 2006 21:24:09 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Cygwin: texi2dvi stumbles over texinfo.tex [attn texinfo maintainer] Message-ID: <20060527012409.GA18215@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <041d01c67e6e$a7fff670$a501a8c0 AT CAM DOT ARTIMI DOT COM> <200605242003 DOT k4OK3dj01609 AT f7 DOT net> <20060525063820 DOT GA6327 AT iam DOT uni-bonn DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk 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 Note-from-DJ: This may be spam On Fri, May 26, 2006 at 09:33:12PM +0000, Eric Blake wrote: >cgf wrote: > >> >0022FF88 61005EB3 (00000000, 00000000, 00000000, 00000000) >> >> That's apparently a call to mktemp, although I can't tell what's causing >> the problem. > >Well, looking at the source to the cygwin distribution of texinfo, it is >pretty obvious: > > >$ diff -u texindex.c.orig texindex.c >--- texindex.c.orig 2004-04-11 11:56:47.001000000 -0600 >+++ texindex.c 2005-10-07 08:43:50.001000000 -0600 >@@ -99,6 +99,9 @@ > /* Directory to use for temporary files. On Unix, it ends with a slash. */ > char *tempdir; > >+/* Basename for temp files inside of tempdir. */ >+char *tempbase; >+ > /* Number of last temporary file. */ > int tempcount; > >@@ -190,6 +193,11 @@ > > decode_command (argc, argv); > >+ /* XXX mkstemp not appropriate, as we need to have somewhat predictable >+ * names. But race condition was fixed, see maketempname. >+ */ >+ tempbase = mktemp ("txidxXXXXXX"); >+ >... > >OOPS!!!! Calm down, please. >The texinfo maintainer, in their modifications to upstream texindex, is >passing a READ-ONLY string to mktemp, and is deserving of their crash >(although cygwin could perhaps handle it more gracefully, perhaps by >returning NULL on a fault so that at least the stack trace is not in >the middle of cygwin1.dll). But if you are going to go to the effort >of modifications, use mkstemp instead (mktemp is insecure, after all). >I would further argue that maketempname should use the O_BINARY flag to >open(), unless texindex can handle text mounts gracefully. Can we get >a new texinfo release soon with this fixed? This patch is actually not mine. I don't remember exactly where it came from, but google shows a similar patch circulating in a couple of distributions. 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/