From owner-cvs-all Sat Mar 16 18:55:56 2002 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id B790E37B402; Sat, 16 Mar 2002 18:55:50 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id NAA06422; Sun, 17 Mar 2002 13:55:48 +1100 Date: Sun, 17 Mar 2002 13:57:24 +1100 (EST) From: Bruce Evans X-X-Sender: To: Greg Lehey Cc: Jens Schweikhardt , , Subject: Re: cvs commit: src/share/man/man4 ng_pptpgre.4 In-Reply-To: <20020317130517.C35248-100000@gamplex.bde.org> Message-ID: <20020317134715.U35416-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 17 Mar 2002, I wrote: > That may be, but ispell is not man's best friend: > > $ man ispell > Segmentation fault (core dumped) > > The bug seems to be in libz. Upgrading to the previous version of libz > fixes it. The following patch (obtained from the upgrade) fixes "man ispell" (but may break libz). %%% Index: infcodes.c =================================================================== RCS file: /home/ncvs/src/lib/libz/infcodes.c,v retrieving revision 1.3 diff -u -2 -r1.3 infcodes.c --- infcodes.c 11 Mar 2002 22:36:26 -0000 1.3 +++ infcodes.c 17 Mar 2002 02:41:53 -0000 @@ -201,5 +201,5 @@ case COPY: /* o: copying bytes in window, waiting for space */ f = q - c->sub.copy.dist; - while (f < s->window) /* modulo window size-"while" instead */ + if (f < s->window) /* modulo window size-"while" instead */ f += s->end - s->window; /* of "if" handles invalid distances */ while (c->len) %%% The while loop caused some pointer to become invalid. I think the bug is really in gcc. The register hildng 's' seemed to get clobbered to (s->end - s->window) so 's' was invalid after 1 iteration. With an "if" instead of a "while", gcc generates simpler code with line numbers that are actually correct and without the register clobber. Compiling the unpatched version with -O0 also unbreaks "man ispell". Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message