bugGNU roff - Bugs: bug #61174, [libgroff] misleading line numbers...

 
 

bug #61174: [libgroff] misleading line numbers in some device description file diagnostics

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 17 Sep 2021 06:17:19 AM UTC
   
 
Category:  Core 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
   

Fri 17 Sep 2021 09:36:53 AM UTC, comment #1: 


commit e97cdac9ddef51f8834e9eb32fedd44fdfac36cd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Sep 17 16:23:55 2021 +1000

    [libgroff]: Fix Savannah #61174.

    * src/libs/libgroff/font.cpp (font::load_desc): Emit correct line
      numbers when complaining of invalid `sizescale`, `hor`, or `vert`
      values in device description files.

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


G. Branden Robinson <gbranden>
Group administrator
Fri 17 Sep 2021 06:17:19 AM UTC, original submission:  

A spurious line number is reported for bad `sizescale`, `hor`, and `vert` directives in the DESC file.

For example, we can take the devps DESC file and make its `sizescale` value negative.


$ nl build/font/devps/DESC
     1  res 72000
     2  hor 1
     3  vert 1
     4  sizescale -1000
     5  unitwidth 1000
     6  sizes 1000-10000000 0
     7  styles R I B BI
     8  family T
     9  fonts 9 0 0 0 0 0 SS S ZD ZDR
    10  tcommand
    11  postpro grops
    12  broken 0
    13  papersize letter
    14  print lpr
$ GROFF_FONT_PATH=./build/font groff
groff:./build/font/devps/DESC:14: bad 'sizescale' value
groff: fatal error: invalid device 'ps'


Because `font::load_desc()` reads the whole file before validating these values, it associates a misleading line number with the diagnostic messages.

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-09-17 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code