bugGNU roff - Bugs: bug #55099, [ms]: nesting displays leads to...

 
 

bug #55099: [ms]: nesting displays leads to confusing diagnostics

Submitter:  None
Submitted:  Mon 26 Nov 2018 02:15:45 AM UTC
   
 
Category:  Macro ms Severity:  2 - Minor
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 30 Apr 2021 02:51:44 PM UTC, comment #3: 

I'm retrospectively regarding this ticket as a complaint about the uncommunicative error message.  That part of the problem was addressed in a commit in March.  ms uses diversions extensively, and there were simpler ways to provoke such a message, such as with a document consisting solely of ".TL".

Here's what the error message looks like now.


s.tmac: error: diversion open while ejecting page (last file seen: EXPERIMENTS/ds-ds-de.ms) (recovering)


This isn't as good as catching a problem when someone tries to call .DS within an existing display diversion, but that's precisely the topic of bug #55136 as Bjarni and Dave noted, so I'll treat that issue orthogonally rather than regarding either of these two reports as a duplicate.


commit c7b14cb8f84b102dd591843a4e7fc2fbfe2a25a3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Mar 2 10:38:01 2021 +1100

    tmac/s.tmac: Improve diagnostic messages.

    (@diag): New macro wraps .tm request, always prefixing it with the name
    of the macro package, as well as file and line indicators only if these
    are set to non-empty or non-zero values, respectively.

    (@error, @warning): Call @diag instead of .tm directly.

    (@fatal): Retire; it had only one call site and it would have greatly
    complicated @diag to support calling .ab instead of .tm.  An ugly
    alternative would have been to call .ab with a redundant message after
    calling @diag.

    (@divert): New macro wraps .di request, remembering the name of
    the current file (\n[.F]) when a diversion is started.

    (@error-recover): Call .ab instead of (deleted) @fatal.

    (pg@super-eject): Tell user what the last file name seen was when
    recovering from an unfinished diversion when processing ends.

    Examples of improved output compared to groff 1.22.4 follow.

    $ (printf ".TL\n" > foo.ms; nroff -ms foo.ms | sed '/^$/d'; rm foo.ms)
    :0: macro error: diversion open while ejecting page (recovering)
    $ (printf ".TL\n" > foo.ms; ./build/test-groff -ms foo.ms \
     | sed '/^$/d'; rm foo.ms)
    s.tmac: error: diversion open while ejecting page (last file seen: foo.ms) (recovering)

    $ (printf '.nr a 23 1\n.while \\n-a .di d\\na\n' > foo.ms; \
      nroff -ms foo.ms | sed '/^$/d'; \rm foo.ms)
    :0: macro error: diversion open while ejecting page (recovering)
    :0: fatal macro error: recovery failed
    $ (printf '.nr a 23 1\n.while \\n-a .di d\\na\n' > foo.ms; \
      ./build/test-groff -ms foo.ms | sed '/^$/d'; \rm foo.ms)
    s.tmac: error: diversion open while ejecting page (last file seen: foo.ms) (recovering)
    s.tmac: fatal error: recovery failed


G. Branden Robinson <gbranden>
Group administrator
Mon 26 Oct 2020 11:15:44 AM UTC, comment #2: 

Bug #55109 has since been closed as "Wont fix."

But bug #55136 is the one that seems to address this problem more directly anyway.  It changes the error message from the unhelpful one cited in the original report to:


2: fatal macro error: DS: New .DS used without closing a former one.


Anonymous submitter, does this change seem acceptable to you?

Dave <barx>
Group Member
Thu 29 Nov 2018 11:34:22 PM UTC, comment #1: 

  Add the patches from bug #55109 and #55136 and test.

Bjarni Ingi Gislason <bjarniig>
Mon 26 Nov 2018 02:15:45 AM UTC, original submission:  

I groff 1.22.3 this -ms file
  .DS
  .DS
  .DE
produces this unrevealing diagnostic:

:0: macro error: diversion open while ejecting page (recovering)

It's hard to identify the problem when it occurs in a big document. It would best be diagnosed when the spurious .DS is encountered.

Anonymous

 

(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 (Posted a comment)
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by bjarniig (Posted a comment)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-30 gbranden StatusNeed Info Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
        Summaryundiagnosed error leads to misbehavior [ms]: nesting displays leads to confusing diagnostics
    2020-10-26 barx Severity3 - Normal 2 - Minor
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code