URL:
  <https://savannah.gnu.org/bugs/?67385>

                 Summary: [mdoc] renders degenerate input using insane page
length in nroff mode
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Sat 02 Aug 2025 10:24:02 AM GMT
                Category: Macro package mdoc
                Severity: 3 - Normal
              Item Group: Rendering/Cosmetics
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 02 Aug 2025 10:24:02 AM GMT By: G. Branden Robinson <gbranden>
In this commit:


commit d8cd70f3a8cfd06996ddce6b1d18150eaef69983
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
Date:   Sun May 18 10:35:01 2025 -0500

    [mdoc]: Fix Savannah #65190 (2/2).
    
    [mdoc]: Refactor continuous rendering mode to use an "infinite page
    length" method facilated by the new semantics of the `.R` register.
    
    * tmac/mdoc/doc-common (doc-ne): Drop unneeded macro.
    
      (doc-bp): Define with `de1` to temporary disable compatibility mode,
      and replace definition.  No longer altering the page length, it works
      like `br`, including control-character-sensitive behavior.
    
      (doc-set-up-continuous-rendering): Drop macro in favor of open-coded
      initialization logic.
    
      ([initialization]): If continuously rendering, set up replacement
      macro for `bp` request and set the page length to "infinite".
    
      (Dd): Call `an*break-page-with-new-number` only if _not_ continuously
      rendering.
    
      (doc-end-macro): If continously rendering, stop incrementing the page
      length prior to writing the footer and document separation line, and
      upon encountering the end of the last document (the input file name
      register `.F` becomes empty), set the page length to the vertical
      drawing position.
    
    Fixes Savannah #65190 (2/2).


I failed to ensure that the appropriate end-of-input macro would be called.
That causes degenerate documents, when rendered in _nroff_ mode (and the `cR`
register not made false), to format on a page length of over a million lines.

Not graceful.

Discovered on my own while probing (unsuccessfully) for a _mandoc_(1) problem
in conversation with Ingo Schwarze.

https://github.com/ischwarze/groff-port/commit/b251b75a25d4a86107870d0676d3a7dcbf125db1#commitcomment-163275225

This is a rendering/cosmetics problem, to be sure, and moreover only happens
with degenerate (that is, invalid) input, but is sufficiently obnoxious to
warrant "Normal" Severity.

Also, it's my fault.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67385>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to