Bug 690105 - seg fault reading pcl file
Summary: seg fault reading pcl file
Status: NOTIFIED DUPLICATE of bug 690203
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL interpreter (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P2 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-01 11:36 UTC by Marcos H. Woehrmann
Modified: 2011-09-18 21:46 UTC (History)
0 users

See Also:
Customer: 780
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2008-10-01 11:36:03 UTC
The customer reports and I've verified that the attached PCL file generates a seg fault on page 3 when read 
by GhostPCL head (r9125).  pxldis.py reads the file without problem (I haven't tried printing the file to my 
collection of HP printers since I'm out of the office).

The command line I'm using for testing:

  main/obj/pcl6 -sDEVICE=pbmraw -sOutputFile=test.pbm -dNOPAUSE ./RFW194.tmp
Comment 1 Marcos H. Woehrmann 2008-10-01 11:40:29 UTC
Created attachment 4457 [details]
RFW194.tmp
Comment 2 Henry Stiles 2008-10-02 12:30:27 UTC
The Truetype collection header (ttcf) is corrupt.  

from the file:


0003a290: 7474 6366 0006 0040 0002 0020 c160 00f8  ttcf...@... .`..
0003a2a0: a750 fb60 6376 7420 0000 0000 0000 006c  .P.`cvt .......l

From the TT docs:

TAG 	TTCTag 	TrueType Collection ID string: 'ttcf'
ULONG 	Version 	Version of the TTC Header (1.0), 0x00010000
ULONG 	numFonts 	Number of fonts in TTC
ULONG 	OffsetTable[numFonts] 	Array of offsets to the OffsetTable for each font
from the beginning of the file


There is also a version 2 of ttcf but that is not consistent with the pcl TT
data in the file either.

Right now, it is not clear if HP ignores the table or the entire font.  

A segmentation fault for bad values in the segment is no good either, it should
comprise a separate bug.

Comment 3 Henry Stiles 2008-10-12 13:09:02 UTC
I believe error checking code should be added to gstype42.c to reject a ttc font
if the ttcf table version header is not 0x00010000 or 0x00020000 per the spec. 
Passing to Leo.
Comment 4 leonardo 2008-10-24 08:00:01 UTC
Patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2008-October/008757.html
Comment 5 Marcos H. Woehrmann 2008-10-24 22:37:52 UTC
The patch eliminates the segfault, but GhostPCL head (r9184) stll can't read the file.

Command line:

  pclhead -sDEVICE=png16m -sOutputFile=test.png -dNOPAUSE ./RFW194.tmp

Output:

GPL Ghostscript SVN PRE-RELEASE 8.64: Unknown TTC header version 00060040 in the font 
nameless_font.
Warning interpreter exited with error code -28
Flushing to end of job
PCL XL error
    Subsystem:  GRAPHICS
    Error:      Internal error 0xffffffe4
    Operator:   Text
    Position:   4016
file position of error = 253430

My HP LaserJet P3005 prints all the pages without error.
Comment 6 Henry Stiles 2008-11-09 08:30:32 UTC
This could be addressed with an ad hoc change to ignore True Type collections
completely which is what HP appears to do, but without further evidence that
this is a widespread issue we think it best to have an error if the font is
corrupt.  Assigning to support with a recommendation of "wontfix" after customer
notification.
Comment 7 Henry Stiles 2009-01-20 08:57:06 UTC

*** This bug has been marked as a duplicate of 690203 ***
Comment 8 Marcos H. Woehrmann 2011-09-18 21:46:50 UTC
Changing customer bugs that have been resolved more than a year ago to closed.