Hi,

jma...@ee.washington.edu wrote on Fri, Sep 16, 2016 at 11:10:04PM +0000:

> Synopsis:     man -a segfault when multiple man pages found
> Description:
>   $ doas pkg_add tcl-8.5.18p1 tcl-8.6.4p1
>   $ MANPATH=/usr/local/lib/tcl/tcl8.5/man:/usr/local/lib/tcl/tcl8.6/man
>   $ man -a n Tcl >/dev/null
>   Segmentation fault (core dumped)
>    442                          if (argc > 1 && curp.outtype <= OUTT_UTF8)
>    443                                  terminal_sepline(curp.outdata);

I just committed two patches to usr.bin/mandoc/main.c,
so this is fixed in -current now and will be fixed in 6.1.
Thanks for reporting!

I don't think it's severe enough to warrant a commit to -stable.

Of course, if you want, you can manually apply the patches anyway
to your tree.

> The man man docs indicate that -a needs both a section and name,

That's not what the manual page intends to say, "section" is still
optional even with -a.  I see how the text is confusing in this
regard.  It's also outright wrong because with -k, the command line
may not even contain any name whatsoever, but -a still does its job.

Jason, do you agree with the following patch?

> but the segfault happens with either "n Tcl" or just "Tcl" past the -a.

Yes, the section argument has nothing to do with it, it's not even
required that the pages have the same name.  But thanks for mentioning
the confusing wording in the manual, too.

Yours,
  Ingo


Index: man.1
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/man.1,v
retrieving revision 1.15
diff -u -p -r1.15 man.1
--- man.1       1 Jul 2016 20:23:29 -0000       1.15
+++ man.1       18 Sep 2016 15:59:38 -0000
@@ -69,12 +69,8 @@ machine architecture
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl a
-Display all of the manual pages for a specified
-.Ar section
-and
-.Ar name
-combination.
-Normally, only the first manual page found is displayed.
+Display all matching manual pages.
+Normally, only the first page found is displayed.
 .It Fl C Ar file
 Use the specified
 .Ar file

Reply via email to