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

 
 

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

Submitted by:  Dave <barx>
Submitted on:  Thu 29 Oct 2015 10:07:10 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: Werner LEMBERG <wl>
Open/Closed: ClosedPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
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>
Project AdministratorIn charge of this item.
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>
Fri 30 Oct 2015 05:48:44 AM UTC, comment #1:

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

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>
Project AdministratorIn charge of this item.
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>

 

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

Attach File(s):
   
   
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
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by barx (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 31 Oct 2015 06:06:47 AM UTCwlStatusNeed Info=>Wont Fix
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
    Sat 31 Oct 2015 01:45:42 AM UTCbarxAttached File-=>Added TRSC, #35337
      Attached File-=>Added test.ps, #35338
    Fri 30 Oct 2015 05:48:44 AM UTCwlStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1