Bug 690797 - Error: /invalidfont in --run--
Summary: Error: /invalidfont in --run--
Status: NOTIFIED DUPLICATE of bug 689691
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-01 12:20 UTC by Marcos H. Woehrmann
Modified: 2012-04-16 19:15 UTC (History)
2 users (show)

See Also:
Customer: 580
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2009-10-01 12:20:52 UTC
The customer reports and I've verified that the attached files generates an "Error: /invalidfont in --run--" 
when interpreted by Ghostscript.  All versions that I tried, including 8.54, 8.64, and head (r10105) fail 
similarly (sometimes the error message is different).

The command line I'm using for testing:

  bin/gs -sDEVICE=tiff24nc -o test.tif ./Fak57419_858.pdf
Comment 1 Marcos H. Woehrmann 2009-10-01 12:21:36 UTC
Created attachment 5432 [details]
Fak57419_858.pdf
Comment 2 Marcos H. Woehrmann 2009-10-01 12:23:40 UTC
The -dPDFDEBUG output is rather long, here's the end of it:

.
.
.
%Resolving: [11 0]
<<
/Type /Font /Subtype /Type1 /BaseFont /Futura /Encoding /WinAnsiEncoding /FirstChar 32 /LastChar 
255 /Widths [
289 321 439 578 578 708 692 277 292 292 432 578 289 332 289 551 578 578 578 578 578 578 578 
578 578 578 289 289 578 578 578 453 800 703 535 661 665 521 474 780 675 232 362 600 385 851 
785 828 495 828 543 537 456 669 640 1027 574 573 552 311 551 311 578 500 360 556 556 441 556 
488 275 555 523 254 254 462 222 767 523 540 556 556 351 384 240 512 445 718 489 484 495 334 
570 334 578 0 0 0 277 578 439 1000 578 578 470 1110 537 336 1143 0 552 0 0 277 277 439 439 
578 500 1000 510 940 384 336 897 0 495 573 0 321 578 578 578 578 570 578 470 800 334 523 578 
0 800 500 400 578 346 346 360 512 578 289 330 346 324 523 867 867 867 453 703 703 703 703 
703 703 997 661 521 521 521 521 232 232 232 232 665 785 828 828 828 828 828 578 828 669 669 
669 669 573 495 580 556 556 556 556 556 556 807 441 488 488 488 488 254 254 254 254 540 523 
540 540 540 540 540 578 540 512 512 512 512 484 556 484 ]
/FontDescriptor 12 0 R
>>
endobj
%Resolving: [12 0]
<<
/Type /FontDescriptor /FontName /Futura /Flags 32 /FontBBox [
-163 -268 1113 995 ]
/AvgWidth 540 /StemV 80 /CapHeight 820 /ItalicAngle 0 /Ascent 820 /Descent 220 /FontFile 13 0 R
>>
endobj
%Resolving: [13 0]
<<
/Filter /FlateDecode /Length 14 0 R
/Length1 725 /Length2 26033 /Length3 0 >>
stream
%Resolving: [14 0]
26586 endobj
%FilePosition: 25706
%Resolving: [14 0]
endobj
%Resolving: [14 0]
%Resolving: [14 0]
%Resolving: [14 0]
%Resolving: [14 0]
Error: /invalidfont in --run--
Operand stack:
   --dict:7/16(L)--   F25   9.937   FontObject   --dict:9/13(L)--   --dict:9/13(L)--   18937   --
dict:9/13(L)--   --dict:9/13(L)--   FontType
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   -
-nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   
%oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   --nostringval--   --
nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   -
-nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --
nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   
--nostringval--   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   --
nostringval--   --nostringval--
Dictionary stack:
   --dict:1149/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --
dict:106/127(ro)(G)--   --dict:286/300(ro)(G)--   --dict:22/25(L)--   --dict:4/6(L)--   --
dict:25/40(L)--   --dict:1149/1684(ro)(G)--   --dict:10/10(L)--   --dict:6/6(ro)(G)--   --
dict:75/200(L)--   --dict:1149/1684(ro)(G)--   --dict:10/10(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 8.71: Unrecoverable error, exit code 1
Comment 3 Alex Cherepanov 2009-10-01 22:12:45 UTC
Embedded Type 1 font in the sample PDF file is invalid.
The font program mismanages the operand stack causing
  Error: /stackunderflow in --dup--

Unfortunately, I don't see a quick way to work around the bug in the
current parser. This issue will have to wait for the re-implementation
of Type 1 parser in C.
Comment 4 Henry Stiles 2010-03-07 22:04:32 UTC
We agreed to reassign this problem to Chris last meeting.  We'll discuss it more at the upcoming meeting.
Comment 5 Chris Liddell (chrisl) 2010-03-08 18:17:02 UTC
Although the problem is in the eexec encoded part of the font data, it is still in the "Postscript" world, so I doubt moving the Type 1 parser into C would help - to be honest I wouldn't expect more than the char strings parsing to done in C. By the same token, the FAPI/FT option doesn't help.

In fact, breakage in the font is quite straightforward: where *all* valid eexec encoded type 1 fonts I could find begin the encoded section with:
dup /Private ......

this one is missing the "dup", which means the font dictionary itself gets popped off the op stack, before the font gets defined.

In general, I'd suggest giving an error is correct, but given that Acrobat (as usual) accepts the job without comment, I guess our only option is, for PDFs, to add the dup if it appears to be missing (and issue a warning!).
Comment 6 Ken Sharp 2011-08-18 07:50:47 UTC
It seems to me that this is another version of the bugs being followed in bug #689691. That bug, and all the other duplicates, relate to type 1 fonts which are not valid in one way or another.

Alex suggests that we need a type 1 font 'scanner' which can extract the relevant information from the font while discarding all the actual PostScript, thus side-stepping all the problems. It seems very likely that Acrobat does something similar since it can cope with the all these buggy fonts.

I'm marking this one as another duplicate of bug #689691.

*** This bug has been marked as a duplicate of bug 689691 ***