From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fx.arvanta.net (static-213-198-238-194.adsl.eunet.rs [213.198.238.194]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 553b5c92 for ; Sat, 30 Nov 2019 14:39:28 -0500 (EST) Received: from arya.arvanta.net (arya.arvanta.net [10.5.1.6]) by fx.arvanta.net (Postfix) with ESMTP id EE53825AB3 for ; Sat, 30 Nov 2019 20:39:26 +0100 (CET) Date: Sat, 30 Nov 2019 20:39:26 +0100 From: Milan =?utf-8?Q?P=2E_Stani=C4=87?= To: discuss@mandoc.bsd.lv Subject: Segmentation fault on some man pages Message-ID: <20191130193926.GA23904@arya.arvanta.net> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hello, Sorry if this is not right list to post bug report but I can't find where to post it. On Alpine linux (musl libc) we discovered 'Segmentation fault' when running 'man nft' (nftables man page). We have mandoc (named mdocml=1.14.5-r0 in our distribution) and it works fine, except this for 'nft' man page. This is excerpt from 'ltrace man nft': putwchar(9472, 9472, 0x7fe813c0bbab, 0) strcmp(nil, "\\^" --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ I looked in source and found problem in tbl_term.c file. I made crude hack by removing few lines in tbl_term.c and build mandoc again and with these changes it works without (visible to me) problem for man pages I tried and for nft man page. I'm attaching patch I made, but I think it is not proper fix and hope that some of you experienced in this will make proper fix. File I'm attaching is just hint. -- Tia --sdtB3X0nJg68CQEu Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="fix-tbl_term.patch" --- a/tbl_term.c 2019-03-10 10:56:43.000000000 +0100 +++ b/tbl_term.c 2019-11-30 14:38:12.918969863 +0100 @@ -625,8 +626,7 @@ /* Print the horizontal line inside this column. */ lw = cpp == NULL || cpn == NULL || - (cpn->pos != TBL_CELL_DOWN && - (dpn == NULL || strcmp(dpn->string, "\\^") != 0)) + cpn->pos != TBL_CELL_DOWN ? hw : 0; tbl_direct_border(tp, BHORIZ * lw, col->width + col->spacing / 2); @@ -669,8 +669,7 @@ /* The horizontal line inside the next column. */ rw = cpp == NULL || cpn == NULL || - (cpn->pos != TBL_CELL_DOWN && - (dpn == NULL || strcmp(dpn->string, "\\^") != 0)) + cpn->pos != TBL_CELL_DOWN ? hw : 0; /* The line crossing at the end of this column. */ --sdtB3X0nJg68CQEu-- -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv