bugGNU roff - Bugs: bug #61402, [man] handles degenerate input...

 
 

bug #61402: [man] handles degenerate input poorly

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 30 Oct 2021 02:19:45 AM UTC
   
 
Category:  Macro man Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 30 Oct 2021 11:44:11 PM UTC, comment #1: 


commit 2a9135c7146e121a07a8c63a9f74dfc60e04f98d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Oct 30 14:02:11 2021 +1100

    [man]: Handle degenerate input quietly.

    * tmac/an.tmac (TH): Define new register `an-TH-was-called`.

      (an-end): Return immediately if that register is not defined; to
      format the default page footer we must have the information declared
      in a valid `TH` call.  (`TH` also initializes the type size and
      baseline spacing registers we use to prepare the page footer
      environment.)  If the register _is_ defined, remove it just prior to
      the end of this macro definition, in preparation for next page to be
      rendered.

    * tmac/tests/an_handle-degenerate-input-quietly.sh: Test it.

    Fixes <https://savannah.gnu.org/bugs/61402>, a regression from groff
    1.22.4 (problem introduced by me in the course of many changes to trap
    management and header/footer handling to work nicely in batch rendering
    with -mandoc and mdoc(7) documents).


G. Branden Robinson <gbranden>
Group administrator
Sat 30 Oct 2021 02:19:45 AM UTC, original submission:  

This is a regression from groff 1.22.4.


troff: backtrace: '.../groff/build/../tmac/an.tmac':475: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':110: trap-called macro 'an-end'
troff: warning: register 'PS' not defined
troff: backtrace: '.../groff/build/../tmac/an.tmac':476: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':110: trap-called macro 'an-end'
troff: warning: register 'VS' not defined
troff: backtrace: '.../groff/build/../tmac/an.tmac':479: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':110: trap-called macro 'an-end'
troff: warning: macro 'an-pageref' not defined
troff: backtrace: '.../groff/build/../tmac/an.tmac':396: macro 'an-prepare-inner-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':489: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':110: trap-called macro 'an-end'
troff: warning: macro 'an-extra1' not defined
troff: backtrace: '.../groff/build/../tmac/an.tmac':399: macro 'an-prepare-inner-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':489: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':110: trap-called macro 'an-end'
troff: warning: start and end index of substring out of range
troff: backtrace: '.../groff/build/../tmac/an.tmac':401: macro 'an-prepare-inner-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':489: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':110: trap-called macro 'an-end'
troff: warning: macro 'an-extra2' not defined


Feeding our man(7) package blank lines as input should not result in this riot of noise.  The problem is that our traps assume that TH has been called, which is true for useful man(7) documents.  Given n blank lines of input, groff 1.22.4 quietly produces a blank page as output, and so should groff 1.23.0.

Both versions of groff handle null input silently.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-30 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code