From owner-freebsd-current@freebsd.org Thu Jul 18 15:00:24 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D721DAA70C for ; Thu, 18 Jul 2019 15:00:24 +0000 (UTC) (envelope-from schwarze@usta.de) Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [IPv6:2a00:1398:9:f712::810d:e751]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C75118C253; Thu, 18 Jul 2019 15:00:23 +0000 (UTC) (envelope-from schwarze@usta.de) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1ho7tL-0002Vw-Au; Thu, 18 Jul 2019 17:00:20 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1ho7tK-0000mc-Nx; Thu, 18 Jul 2019 17:00:18 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1ho7tJ-0005dj-H6; Thu, 18 Jul 2019 17:00:17 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 593b7e10; Thu, 18 Jul 2019 17:00:18 +0200 (CEST) Date: Thu, 18 Jul 2019 17:00:18 +0200 From: Ingo Schwarze To: Baptiste Daroussin , Eygene Ryabinkin Cc: freebsd-current@FreeBSD.org, tech@mandoc.bsd.lv Subject: Re: [CFT][patch] mandoc: don't segfault on empty tbl(1) continuation blocks Message-ID: <20190718150018.GB67545@athene.usta.de> References: <20190716193124.yrrntrtah22aky5n@phoenix.codelabs.ru> <20190717071201.beem6et6dybhby7m@ivaldir.net> <20190717103942.fkunwe3utxvmdc5n@void.codelabs.ru> <20190717111655.eyq673itr76fj224@ivaldir.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190717111655.eyq673itr76fj224@ivaldir.net> User-Agent: Mutt/1.8.0 (2017-02-23) X-Rspamd-Queue-Id: C75118C253 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-0.79 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-0.70)[-0.696,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.968,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[usta.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.41)[0.411,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[1.5.7.e.d.0.1.8.0.0.0.0.0.0.0.0.2.1.7.f.9.0.0.0.8.9.3.1.0.0.a.2.list.dnswl.org : 127.0.11.2]; MX_GOOD(-0.01)[scc-spamtrap-always-defer.scc.kit.edu,scc-mailin-cn-01.scc.kit.edu,scc-mailin-cs-01.scc.kit.edu]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:34878, ipnet:2a00:1398::/32, country:DE]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.22)[ipnet: 2a00:1398::/32(-0.62), asn: 34878(-0.49), country: DE(-0.01)] X-Mailman-Approved-At: Thu, 18 Jul 2019 16:25:50 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 15:00:24 -0000 Hi Baptiste, hi Eygene, Baptiste Daroussin wrote on Wed, Jul 17, 2019 at 01:16:56PM +0200: > On Wed, Jul 17, 2019 at 01:39:42PM +0300, Eygene Ryabinkin wrote: >> but I believe that 'cpp' still can be NULL and will try to see >> if it is triggerable. I'm not sure what you mean here. Do you think that in tbl_hrule(), there is a possibility that *cpp might still be accessed even though cpp =3D=3D NULL? If so, where and how exactly? As far as i can see, cpp can indeed easily be NULL anywhere in=20 tbl_hrule(), but it seems to me that for each access, !=3D NULL is checked immediately before. If you still see a potential problem somewhere, please do speak up. The table formatting logic is indeed complicated, so it's not inconceivable that i still missed an edge case. > As for the test case, the best would be that this test ends up > incorporated in the upstream testsuite Done, see the commit below. Yours, Ingo Log Message: ----------- new test for an empty text block; from rea@ via bapt@ (FreeBSD) Modified Files: -------------- mandoc/regress/tbl/data: Makefile Added Files: ----------- mandoc/regress/tbl/data: block_empty.in block_empty.out_ascii Revision Data ------------- --- /dev/null +++ regress/tbl/data/block_empty.in @@ -0,0 +1,19 @@ +.\" $OpenBSD: block_empty.in,v 1.1 2019/07/18 14:38:47 schwarze Exp $ +.TH TBL-DATA-BLOCK_EMPTY 1 "July 17, 2019" +.SH NAME +tbl-data-block_empty \- empty text block +.SH DESCRIPTION +normal text +.TS +|l|l|. +_ +A test +_ +table T{ +T} +_ +.TE +.SH AUTHORS +.MT rea@FreeBSD.org +Eygene Ryabinkin +.ME --- /dev/null +++ regress/tbl/data/block_empty.out_ascii @@ -0,0 +1,22 @@ +TBL-DATA-BLOCK_EMPTY(1) General Commands Manual TBL-DATA-BLOCK_EMPT= Y(1) + + + +N=08NA=08AM=08ME=08E + tbl-data-block_empty - empty text block + +D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N + normal text + + +------+------+ + |A | test | + +------+------+ + |table | | + +------+------+ + +A=08AU=08UT=08TH=08HO=08OR=08RS=08S + Eygene Ryabinkin + + + +OpenBSD July 17, 2019 TBL-DATA-BLOCK_EMPT= Y(1) Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/tbl/data/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -Lregress/tbl/data/Makefile -Lregress/tbl/data/Makefile -u -p -r1.4 -r= 1.5 --- regress/tbl/data/Makefile +++ regress/tbl/data/Makefile @@ -1,6 +1,7 @@ -# $OpenBSD: Makefile,v 1.4 2017/07/04 20:59:17 schwarze Exp $ +# $OpenBSD: Makefile,v 1.5 2019/07/18 14:38:47 schwarze Exp $ =20 -REGRESS_TARGETS =3D blankline block_unclosed block_width block_wrap empty= insert +REGRESS_TARGETS =3D blankline block_empty block_unclosed block_width +REGRESS_TARGETS +=3D block_wrap empty insert LINT_TARGETS =3D block_unclosed empty insert =20 # groff-1.22.3 defect: