>Synopsis: man -a segfault when multiple man pages found
>Category: user
>Environment:
System : OpenBSD 6.0
Details : OpenBSD 6.0 (GENERIC.MP) #0: Fri Sep 16 17:03:34 UTC 2016
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
$ doas pkg_add tcl-8.5.18p1 tcl-8.6.4p1
...
$ export MANPATH=/usr/local/lib/tcl/tcl8.5/man
$ man -w Tcl
/usr/local/lib/tcl/tcl8.5/man/catn/Tcl.0
$ man -a n Tcl >/dev/null
$ MANPATH=/usr/local/lib/tcl/tcl8.5/man:/usr/local/lib/tcl/tcl8.6/man
$ man -w Tcl
/usr/local/lib/tcl/tcl8.5/man/catn/Tcl.0
/usr/local/lib/tcl/tcl8.6/man/catn/Tcl.0
$ man -a n Tcl >/dev/null
Segmentation fault (core dumped)
The man man docs indicate that -a needs both a section and name, but the
segfault happens with either "n Tcl" or just "Tcl" past the -a.
>How-To-Repeat:
Repeat the `man -a n Tcl` command with a MANPATH that finds multiple man pages.
>Fix:
No idea, in main.c
442 if (argc > 1 && curp.outtype <= OUTT_UTF8)
443 terminal_sepline(curp.outdata);
is called when multiple man page hits make argc>1 and the struct in
curp.outdata looks nothing like whatever terminal_sepline() then calls.