From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o9RJT1wB024514 for ; Wed, 27 Oct 2010 15:29:03 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1PBBgC-0006ar-1b; Wed, 27 Oct 2010 21:29:00 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1PBBgC-0007JO-03; Wed, 27 Oct 2010 21:29:00 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1PBBgB-0006sH-VH; Wed, 27 Oct 2010 21:28:59 +0200 Received: from schwarze by usta.de with local (Exim 4.71) (envelope-from ) id 1PBBgB-0000dY-Im; Wed, 27 Oct 2010 21:28:59 +0200 Date: Wed, 27 Oct 2010 21:28:59 +0200 From: Ingo Schwarze To: Joachim Schipper Cc: discuss@mdocml.bsd.lv Subject: Re: mandoc assert()s on .Os \& Message-ID: <20101027192859.GJ16057@iris.usta.de> References: <20101027125726.GA16344@polymnia.joachimschipper.nl> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101027125726.GA16344@polymnia.joachimschipper.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Hi Joachim, Joachim Schipper wrote on Wed, Oct 27, 2010 at 02:57:27PM +0200: > .Dd Oct 27, 2010 > .Dt SOMETHING 1 LOCAL > .Os \& [...] > I *think* it's legal, And you are right. Try mandoc -Tlint mandoc -Ttree on it. The parser is perfectly happy with that code. When the parsing backend is happy and the rendering frontend fails, that's never right. And when anything crashes, even less so. > assertion "p->rmargin > p->offset" failed: file > "/usr/src/usr.bin/mandoc/term.c", line 145, function "term_flushln" Wow. Impressing. That's the oldest mandoc bug i can remember being found. This particular off-by-one was committed in term.c rev. 1.3, on Sat Feb 21 14:56:58 2009 UTC (20 months ago). That's before i became an OpenBSD developer. At that time, i had no idea i would ever work on mandoc. The file term.c, and in particular the function term_flushln(), is probably the one i have changed most, to the point that Kristaps has grown afraid of touching it. It seems like i have always taken special care to preserve that particular bug, all the way through several major reorganizations. Thanks for reporting, i have fixed it in OpenBSD right away. OK to commit to bsd.lv, too? Yours, Ingo Index: term.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.53 diff -u -p -r1.53 term.c --- term.c 2 Oct 2010 15:11:54 -0000 1.53 +++ term.c 27 Oct 2010 19:17:14 -0000 @@ -142,7 +142,7 @@ term_flushln(struct termp *p) * an indentation, but can be, for tagged lists or columns, a * small set of values. */ - assert (p->rmargin > p->offset); + assert (p->rmargin >= p->offset); dv = p->rmargin - p->offset; maxvis = (int)dv > p->overstep ? dv - (size_t)p->overstep : 0; dv = p->maxrmargin - p->offset; -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv