bugGNU roff - Bugs: bug #46327, groff should fail rather than...

 
 

bug #46327: groff should fail rather than producing invalid PostScript code

Submitter:  Dave <barx>
Submitted:  Thu 29 Oct 2015 10:07:10 PM UTC
   
 
Category:  Driver grops Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Rejected
Privacy:  Public Assigned to:  wl
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 31 Oct 2015 06:42:50 PM UTC, comment #4: 

Thank you for looking into it and providing such a lucid explanation.

Dave <barx>
Group Member
Sat 31 Oct 2015 06:06:47 AM UTC, comment #3: 

Thanks for the output file.  I fear that neither groff nor grops can help detect such a misconfiguration.  grops follows the `%%' comment conventions to parse font resources, as outlined in the the Adobe technote #5001, `PostScript Language Document Structuring Conventions Specification'.  However, if a resource file doesn't have such comments, it is simply included into the output – the DSC conventions are optional, so any file might be used as a resource since PostScript, as a programming language, can cope with arbitrary data.

In other words, grops itself doesn't generate invalid PostScript.  Because it doesn't contain a PS interpreter, it doesn't have the capability to validate include files.

Note that a GhostScript guru could certainly write a small PS program that checks whether all resources in a given directory (or directory tree) are valid PS code; this would help check groff's PS fonts for validity.  Unfortunately, this is beyond my capabilities.

Werner LEMBERG <wl>
Group administrator
Sat 31 Oct 2015 01:45:42 AM UTC, comment #2: 

I'm using groff 1.22.2, the latest available for the x86 architecture under Gentoo Linux.  Adding the -ww flag does not have any visible effect: no new warning is produced, the exit status is unchanged, and the PostScript output is identical (except the CreationDate line).

I've attached my /usr/share/groff/site-font/devps/TRSC font description file and the PostScript output file produced by groff.  Let me know if any further information is needed.

(file #35337, file #35338)

Dave <barx>
Group Member
Fri 30 Oct 2015 05:48:44 AM UTC, comment #1: 

Adding flag `-ww' to the command line, groff shows


/usr/local/share/groff/1.22.3/font/devps/TRSC:1: error: missing charset command
<standard input>:1: warning: can't find font `TRSC'


However, neither groff version 1.22.2 (as installed by default with my openSuSE distribution) nor current git produces an invalid output file for me if I follow exactly your steps.

So please provide more information on your system and groff version, add the `-ww' flag, and attach your output file to this bug report.

Werner LEMBERG <wl>
Group administrator
Thu 29 Oct 2015 10:07:10 PM UTC, original submission:  

If a problem prevents groff from generating valid PostScript output, groff should fail with an error message and a failure exit status, rather than exiting successfully and producing erroneous PostScript.

For instance, my system had a misconfigured /usr/share/groff/site-font/devps/download file, with an entry that pointed to the font description file rather than the intended .pfa file.  I ran groff on a document that used this misconfigured font, and groff exited successfully and produced a PostScript file.  However, that PostScript file caused gv to throw an "Error: /undefined in #" and stack trace.

To reproduce this, create font description file /usr/share/groff/site-font/devps/TRSC containing the line "internalname Times-RomanSC", and add the following entry to the downloads file:

$ echo -e "Times-RomanSC\tTRSC" >> /usr/share/groff/site-font/devps/download

Then try to use this font in a simple groff document:

$ groff > test.ps << EOF
.fp 5 RSC TRSC
.ft 5
Hi.
EOF
$ echo $?

This runs with no errors and exits with a successful status.  But the resultant test.ps is not valid PostScript.

Dave <barx>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35337:  TRSC added by barx (8KiB - application/octet-stream)
file #35338:  test.ps added by barx (11KiB - application/postscript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by barx (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-22 gbranden CategoryNone Driver grops
        Item GroupNone Incorrect behaviour
    2015-10-31 wl StatusNeed Info Rejected
        Assigned toNone wl
        Open/ClosedOpen Closed
    2015-10-31 barx Attached File- Added TRSC, #35337
        Attached File- Added test.ps, #35338
    2015-10-30 wl StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code