| Summary: | nroff -man bombs out with more than eight authors *total* | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Archie Cobbs <archie> |
| Component: | bin | Assignee: | mpp |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 3.1-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Archie Cobbs
1999-12-07 00:10:01 UTC
On Mon, Dec 06, 1999 at 04:04:49PM -0800, Archie Cobbs wrote: > >Synopsis: nroff -man bombs out with more than eight authors *total* > > Happens in both -current and -stable as of Mon Dec 6 16:01:39 PST 1999 > > >Description: > > To have a reference to an article, RFC, etc. in a man page > you're supposed to do this (right?): > > .Rs > .%A S. Hanks > .%A T. Li > .%A D. Farinacci > .%A P. Traina > .%T "Generic Routing Encapsulation over IPv4 networks" > .%O RFC 1702 > .Re > > The bug is that if you 'nroff -man' this and you have more > than 8 authors total IN ALL REFERENCES then nroff bombs out > into some kind of infinite loop, even if no single reference > has 8 authors. Sounds like the mdoc 8 macro parameters limit. The work around probably is to split the information up into 2 .Rs/.Re blocks. The 8 arg limit is something I want to try and increase, but I've had about 0 time for anything the past couple of months. I hope to get a chunk of time off from work later this month through mid Jan (during our slow time), so hopefully I can address this, along with a zillion other things that are sitting on my plate right now. -Mike -- Mike Pritchard mpp@FreeBSD.org or mpp@mppsystems.com Responsible Changed From-To: freebsd-bugs->mpp Since Mike has all the time on the world in his hands and nothing better to do with it than help out with the mdoc package, I'm sure he'd love to take a look at this. *duck* :-) Mike, is this the same problem we've chatted about with the more general argument limit in mdoc? By the way, it doesn't "bomb out in some kind of infinite loop": if you stick around, it _does_ display the page. :-) Mike Pritchard writes: > On Mon, Dec 06, 1999 at 04:04:49PM -0800, Archie Cobbs wrote: > > >Synopsis: nroff -man bombs out with more than eight authors *total* > > > > Happens in both -current and -stable as of Mon Dec 6 16:01:39 PST 1999 > > > > >Description: > > > > To have a reference to an article, RFC, etc. in a man page > > you're supposed to do this (right?): > > > > .Rs > > .%A S. Hanks > > .%A T. Li > > .%A D. Farinacci > > .%A P. Traina > > .%T "Generic Routing Encapsulation over IPv4 networks" > > .%O RFC 1702 > > .Re > > > > The bug is that if you 'nroff -man' this and you have more > > than 8 authors total IN ALL REFERENCES then nroff bombs out > > into some kind of infinite loop, even if no single reference > > has 8 authors. > > Sounds like the mdoc 8 macro parameters limit. The work around probably > is to split the information up into 2 .Rs/.Re blocks. Um, I think you missed the whole point :-) It doesn't matter how many .Rs.Re blocks you split things up into, it still barfs if you have more than eight authors *total* over all blocks. So, somewhere some counter is not getting reset to zero when .Re is seen (or something like that). I tried looking at the code but it was indecipherable. Plus, the failure mode is an infinite loop of stuff printed to the console, which is a separate bug in and of itself.. > The 8 arg limit is something I want to try and increase, but I've had about > 0 time for anything the past couple of months. I hope to get a chunk > of time off from work later this month through mid Jan (during our slow > time), so hopefully I can address this, along with a zillion other things > that are sitting on my plate right now. That would be great.. eight seems like a pretty arbitrary number. Thanks for responding to the bug report. Cheers, -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com I think the actual problem is simply T. Li. Poor Tony's last name is Li, and %A parses its args, and Li is a parsed "literal text", and calling Li from %A fails for some reason I haven't figured out. Hint for debugging: use ".Db on" and nroff -mdoc. DEBUG(argv) MACRO: `.%A' Line #: 36 Argc: 1 Argv: `T.' Length: 2 Space: `\& \&' Class: String Argc: 2 Argv: `Li' Length: 2 Space: `' Class: Executable ------------------^^^^^^^^^^ MACRO REQUEST: .%A T. Li Usage: %A - maximum 8 arguments (#36) Usage: Too many arguments (maximum of 8 accepted) (#36) T. Li rR rR rR rR rR rR rR Diagnosis: user error (man page states that %A is parsed) Fix: use .%A T. \Li Alternate fix: change mdoc not to parse the % stuff since the man page even says it's not very predictable. Bill BTW, I don't really have any clue what the big picture is, but the
misleading "Usage: %A - maximum 8 arguments" error message is coming
from infinite recursion in .rR . A hack to prevent rR from recursing
infinitely is:
diff -u /usr/obj/usr/src/tmp/usr/share/tmac/tmac.doc ..
--- /usr/obj/usr/src/tmp/usr/share/tmac/tmac.doc Wed Dec 8 23:49:34 1999
+++ ../tmac.doc Thu Dec 9 17:59:43 1999
@@ -2962,8 +2962,11 @@
. \}
. el \{\
. if \\n(aC>8 .tm Usage: \\*(mN - maximum 8 arguments (#\\n(.c)
-. aI rR 1
-. \\*(A\\n(aP
+. ie "\\*(A\\n(aP"rR" .tm ERROR: rR recursion (#\\n(.c)
+. el \{
+. aI rR 1
+. \\*(A\\n(aP
+. \}
. \}
.\}
.el \{\
This at least eliminates the loop and gives an error message, but
it's not really the error message you want.
Is there a project to document mdoc's internals (i.e. I'd really like to
read a comment on how rR is *supposed* to work)?
Bill
>> Fix: use .%A T. \Li > >Then it prints OK but the "Li" is missing. Oops. Of course I meant \&Li . Bill State Changed From-To: open->closed The real problem here was the fact that one of the authors names was the same as an mdoc macro (Li). This was the cause of the problem. |