[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61294] [ms]: Stuck in recursive page trap loop at short page lengt

From: G. Branden Robinson
Subject: [bug #61294] [ms]: Stuck in recursive page trap loop at short page length
Date: Wed, 6 Oct 2021 11:42:04 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #1, bug #61294 (project groff):

[comment #0 original submission:]
> Given that the sum of default header and footer margins, in ms, is
equivalent to 12v, in nroff, it's hardly surprising that there is a problem
with this example; at a page length of only 12v, there simply isn't any space
to accommodate page content!  There's even a relevant comment, in s.tmac
> .de cov*first-page-init
> .\" Invoked by '.wh 0' trap on first page.
> .\" We should not come here again, but at short page length,
> .\" recursion may occur; remove trap and macro to avoid it.
> .ch cov*first-page-init
> .rm cov*first-page-init
> This correctly identifies that a '.wh 0' page trap may induce a recursive
loop, at short page length; the problem is that the workaround, here, only
prevents recursion of the first-page trap — it completely neglects that
similar recursion is just as likely to occur when a '.wh 0 pg@top' trap is
assigned, and sprung on every subsequent page, with no defensive measures to
prevent it.
> To mitigate this, we need to ensure that the specified page length, when the
'pg@top' trap is sprung, is no less than (u;'\n[HM]+\n[FM]+\n[.V])'; the
attached patch addresses this

This is a good idea and I think all macro packages that plant default page
location traps (which I think is all of the full-service ones) should do
something like it.

I added something similar to me(7) a few months ago (bug #61034), but I
computed the minimum permissible page length by trial and error.  Your
approach is better (once the appropriate register names are identified).


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]