bugGNU roff - Bugs: bug #63924, man wrapper for system package...

 
 

bug #63924: man wrapper for system package infinitely recurses

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 14 Mar 2023 04:43:52 AM UTC
   
 
Category:  Macro - others/general Severity:  4 - Important
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 10 Jul 2023 09:02:59 AM UTC, comment #6: 

I was sad for this one to go out in groff 1.23.0, but it will be easy to cherry-pick, assuming anyone is still minding the Solaris 10 store.


commit 2f069ed22ccb3970b74b33b1d437bd378e37c6aa
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Mar 14 18:57:37 2023 -0500

    [build, man]: Fix Savannah #63924.

    * tmac/tmac.am (tmac/stamp-wrap): Stop prepending groff's man(7) package
      wrapper ("-man") on hosts with a system man package with a request to
      source itself; this was search-and-replace damage from resolving
      Savannah #60789.  The wrapper still worked, but reported any errors
      inside the wrapped macro package many times until the process ran out
      of file descriptors.  Problem introduced by me in commit fdac25937f,
      2021-07-05.

    Fixes <https://savannah.gnu.org/bugs/?63924>.

    Discovered while testing on Solaris 10.


G. Branden Robinson <gbranden>
Group administrator
Mon 24 Apr 2023 01:22:35 AM UTC, comment #5: 

Dropping "planned release", that's Bertrand's call.

G. Branden Robinson <gbranden>
Group administrator
Fri 31 Mar 2023 11:17:40 AM UTC, comment #4: 

Kicking down to "important".  It's embarrassing but isn't going to hurt anybody.

G. Branden Robinson <gbranden>
Group administrator
Thu 16 Mar 2023 11:47:44 PM UTC, comment #3: 


commit a087c1b19cd0f98cb57566b93dce575745e52d48
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Mar 14 18:57:37 2023 -0500

    [build, man]: Fix Savannah #63924.

    * tmac/tmac.am (tmac/stamp-wrap): Stop prepending groff's man(7) package
      wrapper ("-man") on hosts with a system man package with a request to
      source itself; this was search-and-replace damage from resolving
      Savannah #60789.  The wrapper still worked, but reported any errors
      inside the wrapped macro package many times until the process ran out
      of file descriptors.  Problem introduced by me in commit fdac25937f,
      2021-07-05.

    Fixes <https://savannah.gnu.org/bugs/?63924>.

    Discovered while testing on Solaris 10.


G. Branden Robinson <gbranden>
Group administrator
Tue 14 Mar 2023 05:18:11 AM UTC, comment #2: 

On the other hand, just reverting the change would be inconsistent with that we're doing with groff's own an.tmac, which is to no longer force routing of the man page through the andoc wrapper.

See bug #60789.

So probably the thing to do is just delete the conditional block.

G. Branden Robinson <gbranden>
Group administrator
Tue 14 Mar 2023 05:05:39 AM UTC, comment #1: 

Reverting the change clears that right up...


$ gnroff -t -man /usr/share/man/man1/true.1 2>&1 >/dev/null | sort | uniq -c
   1 gtroff:/usr/share/lib/tmac/an:505: error: cannot load font 'S' for emboldening
   1 gtroff:/usr/share/man/man1/true.1:20: warning: cannot select font 'CW'
   1 /usr/share/man/man1/true.1:41: warning: table wider than line length minus indentation
$ gnroff -t -man -Tascii /usr/share/man/man1/true.1 | sed 'N;/^\n$/!P;D'
gtroff:/usr/share/lib/tmac/an:505: error: cannot load font 'S' for emboldening
gtroff:/usr/share/man/man1/true.1:20: warning: cannot select font 'CW'
/usr/share/man/man1/true.1:41: warning: table wider than line length minus indentation

User Commands                                             true(1)

NAME
     true, false - provide truth values

SYNOPSIS
     true

     false

DESCRIPTION
     The true utility does nothing, successfully. The false util-
     ity does nothing, unsuccessfully. They are typically used in
     a shell script sh as:

     while true
     do
                 command
     done

     which executes command forever.

EXIT STATUS
     true has exit status  0.

     false always will exit with a non-zero value.

ATTRIBUTES
     See  attributes(5) for descriptions of the following attrib-
     utes:

     +------------------------------+-----------------------------+
     |       ATTRIBUTE TYPE         |      ATTRIBUTE VALUE        |
     +------------------------------+-----------------------------+
     | Availability                 |SUNWcsu                      |
     +------------------------------+-----------------------------+
     | Interface Stability          |Standard                     |
     +------------------------------+-----------------------------+

SEE ALSO
     sh(1), attributes(5), standards(5)

SunOS 5.10           Last change: 1 Feb 1995                    1


And it works on mdoc(7) documents.


$ cat thing.mdoc
.Dd 2023-03-14
.Dt foo 1
.Os GNU
.Sh Name
.Nm foo
.Nd frobinicate a bar
.Sh Description
Twas brillig all the way down.
$ gnroff -man -Tascii ./thing.mdoc
gtroff:/usr/share/lib/tmac/an:505: error: cannot load font 'S' for emboldening
foo(1)                      General Commands Manual                     foo(1)

Name
       foo -- frobinicate a bar

Description
       Twas brillig all the way down.

GNU                               2023-03-14                            foo(1)


G. Branden Robinson <gbranden>
Group administrator
Tue 14 Mar 2023 04:43:52 AM UTC, original submission:  

Found a blocker, and it's my fault.


commit fdac25937ff4a1c81366e0fedcf66271e105d7dd
Author:     G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Jul 5 23:02:18 2021 +1000
Commit:     G. Branden Robinson <g.branden.robinson@gmail.com>
CommitDate: Tue Jul 6 19:00:14 2021 +1000

    [mandoc]: Reflect man rename in package and test.

    * tmac/tmac.an (tmac/stamp-wrap): Macro-source `an.tmac` in the man
      wrapper.

[...]

diff --git a/tmac/tmac.am b/tmac/tmac.am
index e966b439f..8c0c533f8 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -251,7 +251,7 @@ tmac/stamp-wrap:
          for m in ""$(tmac_wrap); do \
            $(RM) $(top_builddir)/tmac/$$m-wrap; \
            if test "$$m" = an; then \
-             echo .do mso andoc.tmac >>$(top_builddir)/tmac/$$m-wrap; \
+             echo .do mso an.tmac >>$(top_builddir)/tmac/$$m-wrap; \
            fi; \
            echo .cp 1 >>$(top_builddir)/tmac/$$m-wrap; \
            echo .so $(sys_tmac_prefix)$$m >>$(top_builddir)/tmac/$$m-wrap; \


That change was wrong.  We are creating an.tmac here, so this causes an infinite recursion of macro package loading.

Surprisingly enough, this isn't fatal.  Man pages even still get rendered.  But it sure is ugly on the standard error stream.


$ gnroff -t -man /usr/share/man/man1/true.1 2>&1 >/dev/null | sort | uniq -c
   1 gtroff:/home/gbranden/lib/groff/site-tmac/an.tmac:3: error: can't open '/usr/share/lib/tmac/an': Too many open files
 252 gtroff:/usr/share/lib/tmac/an:505: error: cannot load font 'S' for emboldening
   1 gtroff:/usr/share/man/man1/true.1:20: warning: cannot select font 'CW'
   1 /usr/share/man/man1/true.1:41: warning: table wider than line length minus indentation


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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-07-10 gbranden StatusReady for Merge Fixed
        Open/ClosedOpen Closed
        Planned Release1.23.0 1.24.0
    2023-03-31 gbranden Severity5 - Blocker 4 - Important
    2023-03-16 gbranden StatusIn Progress Ready for Merge
    2023-03-14 gbranden Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code