Bug 258105

Summary: benchmarks/stress-ng stress-ng(1) manual page rendering warnings and side-effect
Product: Ports & Packages Reporter: Graham Perrin <grahamperrin>
Component: Individual Port(s)Assignee: Luca Pizzamiglio <pizzamig>
Status: Open ---    
Severity: Affects Some People CC: 0mp, grahamperrin
Priority: --- Keywords: needs-patch
Version: LatestFlags: pizzamig: maintainer-feedback+
Hardware: Any   
OS: Any   
URL: https://github.com/ColinIanKing/stress-ng/blob/master/stress-ng.1
Attachments:
Description Flags
Screenshot: an initial view of `man stress-ng`
none
Patch for stress-ng.1 to place into files/ none

Description Graham Perrin 2021-08-27 22:56:31 UTC
Created attachment 227495 [details]
Screenshot: an initial view of `man stress-ng`

When I first viewed the manual page, I thought that the section number was missing from the head of the page. 

Then, I noticed warnings at the foot of the terminal window. 

Eventually, I realised that the view of the page begins at the SYNOPSIS (presumably as a result of rendering the warnings); the true head of the page is eight lines above. 

----

:warning: file '<standard input>', around line 209:
  table wider than line width
warning: file '<standard input>', around line 204:
  table squeezed horizontally to fit line length
warning: file '<standard input>', around line 838:
  table wider than line width
warning: file '<standard input>', around line 833:
  table squeezed horizontally to fit line length
Comment 1 Graham Perrin 2021-08-27 23:00:43 UTC
First observed with FreeBSD 14.0-CURRENT. 

Reproducible in a virtual machine with 13.0-RELEASE-p4.
Comment 2 Luca Pizzamiglio freebsd_committer 2021-08-28 12:37:53 UTC
Thanks for reporting.

It seems indeed that the warnings are rendered by groff/troff and overlapping the text, but when moving down and up fix the rendering.

I'll try to understand how to fix the man page to avoid generating those warnings, but it seems also that the groff/troff pipeline could gain some improvement.
Comment 3 Mateusz Piotrowski freebsd_committer 2021-10-01 18:35:07 UTC
Created attachment 228331 [details]
Patch for stress-ng.1 to place into files/

So, that's groff printing the warnings, I checked:

$ cat stress-ng.1 | tbl 2>&1 >/dev/null | grep -c .
0
$ cat stress-ng.1 | tbl |  groff -S -P-h -mtty-char -man -Tascii -P-c 2>&1 >/dev/null | grep -c .
8

When looking at the stress-ng.1 file, I noticed that one of the warnings goes away if I remove the table starting with macro ".TS" on line 248 and ending on line 303 with ".TE".

The solution seems to be removing the "w" specifiers from the tables (look for "Minimum column width value." in the tbl(1) manual page if you'd like to dig deeper). I've attached the patch to be included in files/.