bugGNU roff - Bugs: bug #63218, [eqn] confusing diagnostics with...

 
 

bug #63218: [eqn] confusing diagnostics with some input characters

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 15 Oct 2022 04:21:54 PM UTC
   
 
Category:  Preprocessor eqn 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
   

Sun 16 Oct 2022 07:56:40 PM UTC, comment #3: 


commit bbde17473b43ece9441c5844d3e6da3fc8513f8a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Oct 15 11:34:34 2022 -0500

    [eqn]: Improve unprintable character diagnostics.

    [eqn]: Improve diagnostics involving unprintable characters.

    * src/preproc/eqn/main.cpp (input_char_description): New function
      constructs a human-readable string describing characters.

      (read_line, inline_equation, main): Call new function and adjust
      diagnostic message wording to accommodate the phrase it returns.

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

    groff 1.22.4:

    $ echo | `printf 'eqn -dx\032\n'` >/dev/null
    eqn: bad delimiter ''
    $ printf '\001 x = x + 1\n' | `printf 'eqn -d\001\177\n'` > /dev/null
    eqn:<standard input>:2: fatal error: unterminated '' at line 1, looking for ''
    $ printf '\001 x = x + 1\n' | `printf 'eqn -N -d\001\177\n'` > /dev/null
    eqn:<standard input>:1: missing ''

    groff now:

    $ echo | `printf './build/eqn -dx\032\n'` >/dev/null
    ./build/eqn: error: invalid delimiter (character code 26) in '-d' option argument
    $ printf '\001 x = x + 1\n' | `printf './build/eqn -d\001\177\n'` > /dev/null
    ./build/eqn:<standard input>:2: fatal error: unterminated inline equation; started with a leader character, expecting a delete character
    $ printf '\001 x = x + 1\n' | `printf './build/eqn -N -d\001\177\n'` > /dev/null
    ./build/eqn:<standard input>:1: error: unterminated inline equation; started with a leader character, expecting a delete character


G. Branden Robinson <gbranden>
Group administrator
Sat 15 Oct 2022 04:38:45 PM UTC, comment #2: 

comment #1:

> Looks like I have an off-by-one error in line number reporting, though, doubtless due to another pending change.


Nope, that was already there.

G. Branden Robinson <gbranden>
Group administrator
Sat 15 Oct 2022 04:30:08 PM UTC, comment #1: 

There, that's better.


$ echo | `printf './build/eqn -dx\032\n'` >/dev/null
./build/eqn: error: invalid delimiter (character code 26) in '-d' option argument
$ printf '\001 x = x + 1\n' | `printf './build/eqn -d\001\177\n'` > /dev/null
./build/eqn:<standard input>:2: fatal error: unterminated inline equation; started with a leader character, expecting a delete character
$ echo | `printf './build/eqn -dx\032\n'` >/dev/null
./build/eqn: error: invalid delimiter (character code 26) in '-d' option argument


Looks like I have an off-by-one error in line number reporting, though, doubtless due to another pending change.

G. Branden Robinson <gbranden>
Group administrator
Sat 15 Oct 2022 04:21:54 PM UTC, original submission:  

eqn should not attempt to write unprintable characters in diagnostics.  Affects groff 1.22.4.


$ `printf 'eqn -dx\032\n'` >/dev/null
eqn: bad delimiter ''
$ `printf 'eqn -dx\032\n'` 2>&1 >/dev/null | od -c
0000000   e   q   n   :       b   a   d       d   e   l   i   m   i   t
0000020   e   r       ' 032   '  \n
0000027



$ printf '\001 x = x + 1\n' | `printf 'eqn -d\001\177\n'` > /dev/null
eqn:<standard input>:2: fatal error: unterminated '' at line 1, looking for ''
$ printf '\001 x = x + 1\n' | `printf 'eqn -d\001\177\n'` 2>&1 >/dev/null | od -c
0000000   e   q   n   :   <   s   t   a   n   d   a   r   d       i   n
0000020   p   u   t   >   :   2   :       f   a   t   a   l       e   r
0000040   r   o   r   :       u   n   t   e   r   m   i   n   a   t   e
0000060   d       ' 001   '       a   t       l   i   n   e       1   ,
0000100       l   o   o   k   i   n   g       f   o   r       ' 177   '
0000120  \n
0000121


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
    2022-10-16 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code