Bug 273245 - textproc/groff: groff_mdoc(7): output from 'man 7 groff_mdoc' is badly broken
Summary: textproc/groff: groff_mdoc(7): output from 'man 7 groff_mdoc' is badly broken
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Baptiste Daroussin
URL: https://man.freebsd.org/cgi/man.cgi?q...
Keywords:
Depends on: 273565 274132
Blocks: 273903 273443
  Show dependency treegraph
 
Reported: 2023-08-20 13:22 UTC by Graham Perrin
Modified: 2023-12-28 15:42 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin 2023-08-20 13:22:32 UTC
<https://docs.freebsd.org/en/books/fdp-primer/book/#manual-pages-resources> lists groff_mdoc(7) amongst the resources for manual page writers. 

man 7 groff_mdoc

ented package for writing manual pages with Its predecessor,  the
package,  primarily addressed page layout and presentational con-
cerns, leaving the selection of fonts and other  typesetting  de-
tails  to  the individual author.  This discretion has led to di-
vergent styling practices among authors using it.  organizes  its
macros  into  The lays out the page and comprises titles, section
headings, displays, and lists.  The supplies macros to  quote  or
style  text,  or  to interpolate common noun phrases.  The offers
semantic macros corresponding to the terminology used by  practi-
tioners  in  discussion of commands, routines, and files.  Manual
domain macros distinguish  command-line  arguments  and  options,
function  names, function parameters, pathnames, variables, cross
references to other manual pages, and so  on.   These  terms  are
meaningful  both  to the author and the readers of a manual page.
It is hoped that the resulting increased consistency of  the  man
page  corpus  will enable easier translation to future documenta-
tion tools.  Throughout documentation, a manual entry is referred
:<standard input>:2882: warning: table wider than line length minus indentation
<standard input>:4852: warning: table wider than line length minus indentation


----

% pkg iinfo groff && uname -aKU
groff-1.23.0
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-ALPHA2 FreeBSD 14.0-ALPHA2 amd64 1400094 #5 main-n264868-edacf4b4824a-dirty: Sat Aug 19 00:45:03 BST 2023     grahamperrin@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400094 1400094
%
Comment 1 Graham Perrin 2023-08-20 13:54:08 UTC
> macros  into  The lays out the page and comprises titles, section


Upstream, <https://git.savannah.gnu.org/cgit/groff.git/tree/tmac/groff_mdoc.7.man?id=828904c7fab342d60fb96fe3349fcc9819e76232#n99> lines 99–110:

.Pp
.Xr mdoc
organizes its macros into
.Em domains .
.
The
.Em "page structure domain"
lays out the page and
comprises titles,
section headings,
displays,
and lists.
Comment 2 Graham Perrin 2023-08-20 13:56:50 UTC
(In reply to Graham Perrin ◐ from comment #1)

Sorry, I forgot to mention: the word 'comprises' is not in the man.freebsd.org view (October 07, 2002, FreeBSD 13.0).
Comment 3 G. Branden Robinson 2023-09-04 01:26:12 UTC
It appears to me like the page is being formatted with the `-man` option rather than the recommended `-mandoc`.  (`-mdoc` should also work.)

This was a change in _groff_ 1.23.0.

NEWS:
o Part of the an (man) macro package has been renamed from "an-old.tmac"
  to "an.tmac", replacing a file that sourced the "andoc.tmac" wrapper.
  This means that the "-man" argument to groff (or nroff, or troff) will
  no longer load the andoc wrapper, and not successfully format mdoc(7)
  man pages.  If you are not sure which macro package a given man page
  uses, or you wish to batch-process a series of man pages written
  variously in the man and mdoc formats, be sure to call the formatter
  with the "-mandoc" option explicitly, as "-man" will no longer do
  this.  The man-db man(1) implementation has, since 2001, used
  "-mandoc" preferentially if available when man-db is configured.

https://git.savannah.gnu.org/cgit/groff.git/tree/NEWS?h=1.23.0#n268

Regarding the word "comprises", the content of _groff_mdoc_(7) changed a bit from _groff_ 1.22.4 to 1.23.0.

$ COLUMNS=72 git diff --stat 1.22.4 1.23.0 tmac/groff_mdoc.7.man 2>/dev/null
 tmac/groff_mdoc.7.man | 3654 ++++++++++++++++++++++++++---------------
 1 file changed, 2364 insertions(+), 1290 deletions(-)
Comment 4 Wolfram Schneider freebsd_committer freebsd_triage 2023-09-04 17:44:51 UTC
(In reply to G. Branden Robinson from comment #3)

Are you aware that this tiny change (-man -> -mandoc) will break some of our core FreeBSD tools, and a lot of third-party tools which we use in the base system? Not to mention some FreeBSD ports which may fail as well.

This will affect all FreeBSD releases/branches (12/13/14/15) that we support. A possible workaround is to downgrade the groff port to 1.22.4 locally.

Checking our repos I see that we need to change ~100 files:

for i in freebsd-{src,ports,doc};do (cd $i && printf "$i "; git grep 'roff.* -man[^d]' |wc -l );done
freebsd-src 35
freebsd-ports 51
freebsd-doc 9

Thinking about the issue - maybe we should just patch the FreeBSD port of groff and revert this change. It hurts a lot of our users.
Comment 5 G. Branden Robinson 2023-09-04 19:22:18 UTC
(In reply to Wolfram Schneider from comment #4)

Hi Wolfram,

> Are you aware that this tiny change (-man -> -mandoc) will break some of our
> core FreeBSD tools, and a lot of third-party tools which we use in the base
> system? Not to mention some FreeBSD ports which may fail as well.

I anticipated some impact, but was mostly concerned with users of "man" programs.  Between _mandoc_(1), which does its own man page rendering, and man-db _man_(1), which has invoked _groff_ with the `-mandoc` flag for 22 years, the impact on end users seemed relatively low.  At the time I mooted (a form of) this idea to the _groff_ mailing list almost 3 years ago (item D, https://lists.gnu.org/archive/html/groff/2020-10/msg00012.html ) it drew no objections in a discussion that included _groff_'s current and former maintainers, together then representing 21 years of pedigree with the project, and the _mandoc_ current and present maintainer, Ingo Schwarze.

I'm aware of another (non-proprietary Unix) _man_ implementation, for which I have no better name than "Brouwer/Lucifredi man".  It has been moribund for several years, and has been replaced by man-db man where it was once popular, on RPM-based Linux distributions.  I don't know that it was ever ported to *BSD, but it may have been.  I also don't know if it used "-mandoc" or "-man".  But it's arguably an irrelevant implementation; it had been stale long enough by 2010 that Fedora 14 discarded it for man-db man despite Lucifredi man's home field advantage, if you will. 

I did not immediately act on the idea back in October 2020.  I raised it again in June 2021 (item 3, https://lists.gnu.org/archive/html/groff/2021-06/msg00070.html ), explicitly flagging it as "disruptive".  It drew no objection, but support from Ingo Schwarze as well as from Doug McIlroy, with whom some are familiar as Thompson & Ritchie's manager at Bell Labs, and author of the original man(7) macro package that shipped in Seventh Edition Unix (1979).

> This will affect all FreeBSD releases/branches (12/13/14/15) that we support.
> A possible workaround is to downgrade the groff port to 1.22.4 locally.

I concede that that is an option.  You may want to peruse a list of bugs resolved in the groff 1.23.0 release as part of your consideration process.  Here is one sorted by severity.  I apologize in advance for the gargantuan URL; it is an inelegant aspect of the GNU Savane ticket tracker.

https://savannah.gnu.org/bugs/?group=groff&func=browse&set=custom&msort=0&bug_id[]=&summary[]=&submitted_by[]=0&resolution_id[]=1&assigned_to[]=0&bug_group_id[]=0&status_id[]=3&severity[]=0&category_id[]=0&plan_release_id[]=103&advsrch=0&msort=0&chunksz=50&spamscore=5&report_id=225&sumORdet=&morder=bug_id%3C&order=severity#results

> Checking our repos I see that we need to change ~100 files:
>
> for i in freebsd-{src,ports,doc};do (cd $i && printf "$i "; git grep 'roff.* -man[^d]' |wc -l );done
> freebsd-src 35
> freebsd-ports 51
> freebsd-doc 9

It would likely be educational for me to retrieve these (3?) repositories and examine these results in detail.  My expectation is that build scripts/Makefiles are calling "groff -man" to generate "cat pages".  If that is the case, then the use of "groff -man" as opposed to "groff -mandoc" is, I would guess, a bit of sloppiness unfortunately coddled by groff for many years.  Using "-mandoc" to format man pages when one is uncertain of or indifferent to the macro package used for their composition has a long, honorable tradition dating back to 4.3BSD-Reno (1990).  https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/share/tmac/tmac.andoc

> Thinking about the issue - maybe we should just patch the FreeBSD port of
> groff and revert this change. It hurts a lot of our users.

If so, there are several commits you will want to revert.  At the time this change was made, they were recorded in a Savannah ticket.  https://savannah.gnu.org/bugs/?60789

If part of your _groff_ port build involves running its automated test suite with "make check", then I predict that you will also need to update some test scripts for the man package that have been written and committed since then.

Please consider me a resource for any questions you have.

Regards,
Branden
Comment 6 G. Branden Robinson 2023-09-04 22:07:38 UTC
Hi Wolfgang,

I cloned the freebsd-src repository to have a look at the 35 cases within it that concerned you.

> for i in freebsd-{src,ports,doc};do (cd $i && printf "$i "; git grep 'roff.* -man[^d]' |wc -l );done
> freebsd-src 35

$ git grep -n 'roff.* -man[^d]'
contrib/byacc/aclocal.m4:1047:${NROFF_NOTE}     [\$](SHELL) -c "tbl [\$]*.$2 | nroff -man | col -bx" >[\$]@
contrib/byacc/aclocal.m4:1053:${GROFF_NOTE}     [\$](SHELL) -c "tbl [\$]*.$2 | groff -man" >[\$]@
contrib/byacc/aclocal.m4:1056:${GROFF_NOTE}     GROFF_NO_SGR=stupid [\$](SHELL) -c "tbl [\$]*.$2 | nroff -rHY=0 -Tascii -man | col -bx" >[\$]@
contrib/byacc/configure:8368:${NROFF_NOTE}      \$(SHELL) -c "tbl \$*.1 | nroff -man | col -bx" >\$@
contrib/byacc/configure:8374:${GROFF_NOTE}      \$(SHELL) -c "tbl \$*.1 | groff -man" >\$@
contrib/byacc/configure:8377:${GROFF_NOTE}      GROFF_NO_SGR=stupid \$(SHELL) -c "tbl \$*.1 | nroff -rHY=0 -Tascii -man | col -bx" >\$@

byacc is maintained by Thomas Dickey.  He's using Autoconf macros to produce output from sources that are known to be in man(7) format.

https://github.com/freebsd/freebsd-src/blob/main/contrib/byacc/yacc.1#L30

`CF_MAKE_DOCS` appears to be an Autoconf macro private to the byacc distribution; I see no other occurrences in `freebsd-src`.  He also has a Autoconf test to determine how to generate HTML from man(7) pages.

https://github.com/freebsd/freebsd-src/blob/main/contrib/byacc/aclocal.m4#L1580

Note in particular the here document at line 1694.

https://github.com/freebsd/freebsd-src/blob/main/contrib/byacc/aclocal.m4#L1694

contrib/dialog/makefile.in:145:@NROFF_NOTE@     GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -rHY=0 -Tascii -man | col -bx" >$@
contrib/dialog/makefile.in:151:@GROFF_NOTE@     $(SHELL) -c "tbl $< | groff -man" >$@

Dialog is another Thomas Dickey project.

It also builds inputs it knows to be in man(7) format.

$ grep -nrFw .TH contrib/dialogcontrib/dialog/dialog.3:50:.TH \*D 3 "" "$Date: 2021/01/17 18:02:44 $"
contrib/dialog/dialog.1:51:.TH \*D 1 "" "$Date: 2021/01/17 17:25:01 $"
contrib/dialog/configure:8028:.TH HEAD1 HEAD2 HEAD3 HEAD4 HEAD5
contrib/dialog/aclocal.m4:5919:.TH HEAD1 HEAD2 HEAD3 HEAD4 HEAD5
$ grep -nrFw .Dd contrib/dialog || echo NONE # look for mdoc(7) documents
NONE

Next...

contrib/ee/ee.1:5:.\"    nroff -man ee.1

$ head contrib/ee/ee.1 
.\"
.\"
.\"  To format this reference page, use the command:
.\"
.\"    nroff -man ee.1
.\"
.\"  $Header: /home/hugh/sources/old_ae/RCS/ee.1,v 1.22 2001/12/16 04:49:27 hugh Exp $
.\"
.\"
.TH ee 1 "" "" ""

The man page is telling us explicitly (in a comment) what macro package to use to format it, and unsurprisingly getting it right.

Next...

contrib/ldns/makewin.sh:243:for x in man1/*.1; do groff -man -Tascii -Z "$x" | grotty -cbu > cat1/"$(basename "$x" .1).txt"; done
contrib/ldns/makewin.sh:246:for x in man3/*.3; do groff -man -Tascii -Z "$x" | grotty -cbu > cat3/"$(basename "$x" .3).txt"; done

Again we have renderings of known documents.  Let's see what package they use.

$ find contrib/ldns -name "*.[13]" | xargs grep -nEw '\.(Dd|TH)'
contrib/ldns/drill/drill.1:2:.TH drill 1 "28 May 2006"
contrib/ldns/packaging/ldns-config.1:1:.TH ldns-config 1 "22 Sep 2011"

So that's two more correct uses of '-man'.

Next...

contrib/ncurses/aclocal.m4:5607:                nroff -man \$TMP >\$TMP.out
contrib/ncurses/configure:14517:                nroff -man \$TMP >\$TMP.out

Another Thomas Dickey project.  These come from his Autoconf macro `CF_MAN_PAGES`.  I'll skip ahead here and note that I'm familiar with the ncurses man pages, having recently proposed patches to them.  https://lists.gnu.org/archive/html/bug-ncurses/2023-09/

They are exclusively in man(7) format, not mdoc(7).

Here again we have a case of a maintainer knowing what format is required, and using it.

Next...

contrib/tcp_wrappers/Banners.Makefile:12:# sequences as described in the hosts_access.5 manual page (`nroff -man'
contrib/tcp_wrappers/CHANGES:2:configuration checker. See the `tcpdchk.8' manual page (`nroff -man'
contrib/tcp_wrappers/CHANGES:349:have all rules within a single file. See "nroff -man hosts_options.5"
contrib/tcp_wrappers/Makefile:575:# and hosts_options.5 manual pages (`nroff -man' format).
contrib/tcp_wrappers/README:240:hosts_access.5 manual page, which is in `nroff -man' format. A later
contrib/tcp_wrappers/README:257:The hosts_options.5 manual page (`nroff -man' format) documents an
contrib/tcp_wrappers/README:395:documented in the hosts_options.5 document, which is in `nroff -man'
contrib/tcp_wrappers/README:432:`nroff -man' format) can guide the requests to the right server.  These
contrib/tcp_wrappers/README:453:given in the hosts_options.5 manual page (`nroff -man' format). An
contrib/tcp_wrappers/README:897:hosts_access.5, which is in `nroff -man' format. This is a lengthy
contrib/tcp_wrappers/README:904:The examples in the hosts_access.5 document (`nroff -man' format) show
contrib/tcp_wrappers/README:912:hosts_options.5 document (`nroff -man' format).
contrib/tcp_wrappers/README:918:program is described in the tcpdchk.8 document (`nroff -man' format).
contrib/tcp_wrappers/README:929:described in the tcpdmatch.8 document (`nroff -man' format).
contrib/tcp_wrappers/README:967:programs.  The hosts_access.3 manual page (`nroff -man' format)
contrib/tcp_wrappers/options.c:4:  * manual page (source file: hosts_options.5, "nroff -man" format).

These are all source comments or text file contents, and do not drive construction of anything; they therefore cannot cause failures.  Nevertheless, let us see what macro package is employed by "tcp_wrappers".

$ find contrib/tcp_wrappers -name "*.[1-9]" | xargs grep -nEw '\.(Dd|TH)'
contrib/tcp_wrappers/hosts_options.5:1:.TH HOSTS_OPTIONS 5
contrib/tcp_wrappers/tcpdmatch.8:1:.TH TCPDMATCH 8
contrib/tcp_wrappers/tcpd.8:1:.TH TCPD 8
contrib/tcp_wrappers/tcpdchk.8:1:.TH TCPDCHK 8
contrib/tcp_wrappers/hosts_access.5:1:.TH HOSTS_ACCESS 5
contrib/tcp_wrappers/hosts_access.3:1:.TH HOSTS_ACCESS 3

It would appear once again that the upstream maintainer is familiar with their own man pages.

Next...

contrib/tcsh/tcsh.man2html:13:# in the exact same style of nroff -man, i.e. any other manpage.

This is a comment.  Some context might be helpful.

$ git grep -C2 -n 'roff.* -man[^d]' contrib/tcsh/
contrib/tcsh/tcsh.man2html-11-#
contrib/tcsh/tcsh.man2html-12-# Designed for tcsh manpage. Guaranteed not to work on manpages not written
contrib/tcsh/tcsh.man2html:13:# in the exact same style of nroff -man, i.e. any other manpage.
contrib/tcsh/tcsh.man2html-14-#
contrib/tcsh/tcsh.man2html-15-# Makes links FROM items which are both a) in particular sections (see

Given that context "guaranteed *not* to work on [other man pages]", it does not seem fair to hold this source remark as evidence militating against groff's change.

Next...

contrib/tzcode/workman.sh:18:.rm }F" | nroff -man - ${1+"$@"} | perl -ne '

More context is warranted here, too.

$ head -n 18 contrib/tzcode/workman.sh
#! /bin/sh
# Convert manual page troff stdin to formatted .txt stdout.

# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.

if (type nroff && type perl) >/dev/null 2>&1; then

  # Tell groff not to emit SGR escape sequences (ANSI color escapes).
  GROFF_NO_SGR=1
  export GROFF_NO_SGR

  echo ".am TH
.hy 0
.na
..
.rm }H
.rm }F" | nroff -man - ${1+"$@"} | perl -ne '

Your concern might, at first glance, seem warranted here; the tool does purport to be of general use.  However, closer inspection reveals that it was written in ignorance or deliberate neglect of the mdoc(7) package altogether; observe how it appends to the 'TH' macro, which is unused in mdoc(7).

It would be straightforward to make this script handle mdoc(7) as well; simply append the same two requests to the `Dd` macro.  The removals of '}H' and '}F' strings/macros/diversions suggests a familiarity with the AT&T Unix man(7) implementation or its descendants in USG/System III/System V proprietary Unix or BSD prior to Networking Release/2 (when the Berkeley CSRG replaced Unix troff with groff). 

Further, if nroff or perl programs (or shell functions) are unavailable, this shell script proceeds to use mandoc anwyay.

$ tail -n 6 contrib/tzcode/workman.sh
elif (type mandoc && type col) >/dev/null 2>&1; then
  mandoc -man -T ascii "$@" | col -bx
else
  echo >&2 "$0: please install nroff and perl, or mandoc and col"
  exit 1
fi

Next...

usr.bin/man/man.conf.5:116:NROFF_JA     /usr/local/bin/groff -man -dlang=ja_JP.eucJP
usr.bin/man/man.conf.5:117:TROFF_JA     /usr/local/bin/groff -man -dlang=ja_JP.euc.jp

This is from an example in FreeBSD's man.conf(5) page.  The assignment to the "lang" string has no particular effect in groff, and to the best of my knowledge it never has.  This may be evidence of jgroff, a fork of groff that was made unnecessary about in the Debian Project about 20 years ago (https://www.debian.org/security/2002/dsa-107 ) and was superseded by groff support in the 1.21 release about 13 years ago.  https://lists.gnu.org/archive/html/groff/2010-12/msg00051.html

(Also, is that a typo adding a period in line 117.)  I suggest that the foregoing might be bitrotted.

Last...

usr.bin/man/man.sh:1074:NROFF='groff -S -P-h -Wall -mtty-char -man'
usr.bin/man/man.sh:1078:TROFF='groff -S -man'

This is a case that should certainly be addressed, if this script still fulfills the purpose claimed for it in its initial commit in 2010: "Implementaiton [sic] of man, manpath, whatis, and apropos written entirely in sh."

I strongly recommend s/-man/&doc/ here so that FreeBSD users will continue to have a positive experience.

Also, for what it's worth, the `-S` option has been unnecessary; "safer" mode has been the default in groff since version 1.12, released on 14 December 1999.

However, 32-33 false positives in a set of 35 suggests to me that your scanning criteria could benefit from sensitivity tuning.  An error rate of over 90% is generally considered unusable in serious measurement applications.

Regards,
Branden
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-09-07 06:33:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=035f7c9a3653d91564a5513f1311aa3b6e14a17e

commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-09-07 06:28:24 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2023-09-07 06:28:24 +0000

    switch groff parameter -man to -mandoc

    groff 1.23.0 changed the semantics of the -man parameter, and many
    manual pages are not rendered. The -mandoc parameter brings back
    the old behavior, as in groff 1.22.4 and earlier.

    PR: 273565, 273245

    Reviewed by:    emaste, bapt
    MFC after: 1 week for all supported branches (stable/12, 13, 14)
    Differential Revision:  https://reviews.freebsd.org/D41737

 usr.bin/man/man.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-09-15 08:26:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f711267afe9eccbb2220f787660b4ff55488e681

commit f711267afe9eccbb2220f787660b4ff55488e681
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-09-15 08:22:19 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2023-09-15 08:26:03 +0000

    textproc/groff: add missing FreeBSD releases

    PR: 273245
    Approved by: bapt
    Differential Revision: https://reviews.freebsd.org/D41858

 textproc/groff/files/mdoc.local | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-09-25 09:52:04 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f9f152307652d1cb454acb8b9018f29672b452f

commit 7f9f152307652d1cb454acb8b9018f29672b452f
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-09-07 06:28:24 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2023-09-25 09:47:49 +0000

    switch groff parameter -man to -mandoc

    groff 1.23.0 changed the semantics of the -man parameter, and many
    manual pages are not rendered. The -mandoc parameter brings back
    the old behavior, as in groff 1.22.4 and earlier.

    PR: 273565, 273245

    Reviewed by:    emaste, bapt
    MFC after: 1 week for all supported branches (stable/12, 13, 14)
    Differential Revision:  https://reviews.freebsd.org/D41737

    (cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)

 usr.bin/man/man.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-09-25 17:33:24 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1cc5240b590ba13cb9a41995c8f80988007798cb

commit 1cc5240b590ba13cb9a41995c8f80988007798cb
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-09-07 06:28:24 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2023-09-25 17:30:58 +0000

    switch groff parameter -man to -mandoc

    groff 1.23.0 changed the semantics of the -man parameter, and many
    manual pages are not rendered. The -mandoc parameter brings back
    the old behavior, as in groff 1.22.4 and earlier.

    PR: 273565, 273245

    Reviewed by:    emaste, bapt
    MFC after: 1 week for all supported branches (stable/12, 13, 14)
    Differential Revision:  https://reviews.freebsd.org/D41737

    (cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)

 usr.bin/man/man.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2023-09-25 17:34:25 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0e71efa38c9aa3281a8bbce169becf3f05dd7c91

commit 0e71efa38c9aa3281a8bbce169becf3f05dd7c91
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-09-07 06:28:24 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2023-09-25 17:33:08 +0000

    switch groff parameter -man to -mandoc

    groff 1.23.0 changed the semantics of the -man parameter, and many
    manual pages are not rendered. The -mandoc parameter brings back
    the old behavior, as in groff 1.22.4 and earlier.

    PR: 273565, 273245

    Reviewed by:    emaste, bapt
    MFC after: 1 week for all supported branches (stable/12, 13, 14)
    Differential Revision:  https://reviews.freebsd.org/D41737

    (cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)

 usr.bin/man/man.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 12 Graham Perrin 2023-09-25 18:47:58 UTC
<https://man.freebsd.org/cgi/man.cgi?query=groff_mdoc&sektion=7&manpath=freebsd-ports> at a glance the footer is OK, however the header is wrong: 

> UNTITLED()			     LOCAL			    UNTITLED()

Symptomatic of work in progress?
Comment 13 Wolfram Schneider freebsd_committer freebsd_triage 2023-09-26 16:20:55 UTC
(In reply to Graham Perrin from comment #12)
> UNTITLED()			     LOCAL			    UNTITLED()

This is another side effect of the groff-1.23.0 upgrade. It affects only 15 of our system manual pages in /usr/share/man and 371 ports manual pages (out of 135k). I consider it as a minor issue. I will fill a separate bug report.
Comment 14 commit-hook freebsd_committer freebsd_triage 2023-10-12 22:53:29 UTC
A commit in branch releng/14.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=21bcb2c2a13ea9555d7f84f45be02fcb364475df

commit 21bcb2c2a13ea9555d7f84f45be02fcb364475df
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-09-07 06:28:24 +0000
Commit:     Glen Barber <gjb@FreeBSD.org>
CommitDate: 2023-10-12 22:51:51 +0000

    switch groff parameter -man to -mandoc

    groff 1.23.0 changed the semantics of the -man parameter, and many
    manual pages are not rendered. The -mandoc parameter brings back
    the old behavior, as in groff 1.22.4 and earlier.

    PR: 273565, 273245

    Approved by:    re (delphij)

    (cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)
    (cherry picked from commit 7f9f152307652d1cb454acb8b9018f29672b452f)

 usr.bin/man/man.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)