X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 29 Feb 2012 09:37:12 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 'more' segment faults with latest cygwin1.dll (1.7.11) Message-ID: <20120229083712.GN23440@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20120227195959 DOT GC7534 AT calimero DOT vinschen DOT de> <1330384952 DOT 6720 DOT 20 DOT camel AT YAAKOV04> <20120228081859 DOT GA23052 AT calimero DOT vinschen DOT de> <1330422189 DOT 404 DOT 18 DOT camel AT YAAKOV04> <20120228102426 DOT GF23052 AT calimero DOT vinschen DOT de> <1330479376 DOT 1848 DOT 35 DOT camel AT YAAKOV04> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1330479376.1848.35.camel@YAAKOV04> User-Agent: Mutt/1.5.21 (2010-09-15) 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 Feb 28 19:36, Yaakov (Cygwin/X) wrote: > On Tue, 2012-02-28 at 11:24 +0100, Corinna Vinschen wrote: > > On Feb 28 03:43, Yaakov (Cygwin/X) wrote: > > > On Tue, 2012-02-28 at 09:18 +0100, Corinna Vinschen wrote: > > > > It's a bug in more, afaics. In case of pressing 'n', the search function > > > > is called with a NULL buf argument. However, the function calls > > > > strlen(buf) without checking buf for NULL. The indentation at this > > > > point in the file looks like this `if (strlen(buf) > 0) {' has been > > > > added as a kind of patch. > > > > > > Yes, I had to patch more(1) to use regcomp/regexec instead of > > > re_comp/re_exec, which we don't have on Cygwin. With your clarification > > > I should be able to fix it easily. > > > > Just an idea, instead of working around them, why not just add them > > to the lib? You could copy the FreeBSD implementation which just > > implements them in terms of the regcomp/regexec API: > > > > http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/lib/libcompat/4.3/re_comp.c?rev=1.1;content-type=text%2Fplain > > I thought of that when I first ported util-linux, but these functions > were already marked legacy in SUSv2 and removed from SUSv3, so I wasn't > sure if we wanted to first add now what most libc's already consider > cruft. > > If you really think this should be added to Cygwin, I could do it, but I > already have a fix for more(1) so I could do without. Uh, that wasn't quite what I meant. With "lib" I meant the "lib" subdir in the util-linux source. I was under the (wrong?) impression that the result of `make' in the lib subdir creates a helper lib which is linked to all executables in the collection. Alternatively you could have pasted them to the end of more.c, but since you have a fix now, it doesn't matter anyway. As for Cygwin, the aforementioned FreeBSD source builds out of the box as part of Cygwin after you defined __DECONST. But, like you, I'm not sure it's such a terrible good idea to add such a long deprecated set of functions. OTOH, Linux provides them as well, just with the extra kick that you have to include regex.h rather than unistd.h as on BSD. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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