Bug 688928 - "/invalidfont in --.type1execchar--" for certain font characters
Summary: "/invalidfont in --.type1execchar--" for certain font characters
Status: RESOLVED DUPLICATE of bug 689691
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: 8.54
Hardware: All All
: P4 major
Assignee: Default assignee
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2006-10-04 08:26 UTC by Jim Riggs
Modified: 2008-04-21 21:03 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Riggs 2006-10-04 08:26:41 UTC
We have a large font library (~3800 fonts), and there are several fonts we have
come across that give an "/invalidfont in --.type1execchar--" error when using
certain characters in the fonts.  Most characters will work correctly, but the
problem ones will fail with this error every time.

I have read through the other bugs with this same message, but they all have to
do with 0 scales which is not the problem in this case, so I do not believe
those bugs apply.

Notes:

* This has been present throughout the 8.5x GS versions and probably before.

* The exact same font files work fine in Distiller and on printers.

* Creating a PDF works (not necessarily a surprise since the fonts don't need to
be rasterized).

* Same behavior seen on OS X and AIX.

* I have done some initial debugging to try to track this down, but I don't know
GS's innards well enough to make much sense of anything yet.


Here is an example of the error (with -Z/1):

GS>0 0 moveto /ItcEras-Book 12 selectfont (O) show
Loading ItcEras-Book font from
/usr/local/graphics/share/ghostscript/fonts/VZQjm74J.pfb... 3809660 1748895
1539136 255414 1 done.
 gxtype1.c( 109): [1]gs_type1_interp_init
 gstype1.c( 169): [1]0: (185) 46.000000
 gstype1.c( 130): [1] (620)+168
 gstype1.c( 169): [1]1: (249) 788.000000
 gstype1.c( 181): [1]0x145c4c6: 0d hsbw
 gxtype1.c( 202): [1]sb=(46,0) w=(788,0)
 gxtype1.c( 109): [1]gs_type1_interp_init
 gstype1.c( 169): [1]0: (185) 46.000000
 gstype1.c( 130): [1] (620)+168
 gstype1.c( 169): [1]1: (249) 788.000000
 gstype1.c( 181): [1]0x145c4c6: 0d hsbw
 gxtype1.c( 202): [1]sb=(46,0) w=(788,0)
 gstype1.c( 130): [1] (108)+20
 gstype1.c( 169): [1]0: (247) 128.000000
 gstype1.c( 181): [1]0x145c4c9: 0a callsubr
 gstype1.c( 130): [1] (620)+13
 gstype1.c( 169): [1]0: (249) 633.000000
 gstype1.c( 169): [1]1: (183) 44.000000
 gstype1.c( 181): [1]0x14081c1: 01 hstem
 gstype1.c( 169): [1]0: (198) 59.000000
 gstype1.c( 169): [1]1: (199) 60.000000
 gstype1.c( 181): [1]0x14081c4: 03 vstem
 gstype1.c( 130): [1] (108)+244
 gstype1.c( 169): [1]0: (247) 352.000000
 gstype1.c( 169): [1]1: (190) 51.000000
 gstype1.c( 181): [1]0x14081c8: 03 vstem
 gstype1.c( 181): [1]0x14081c9: 0b return
 gstype1.c( 130): [1] (108)+240
 gstype1.c( 169): [1]0: (247) 348.000000
 gstype1.c( 130): [1] (620)+58
 gstype1.c( 169): [1]1: (249) 678.000000
 gstype1.c( 181): [1]0x145c4ce: 15 rmoveto
 gstype1.c( 130): [1] (108)+11
 gstype1.c( 169): [1]0: (247) 119.000000
 gstype1.c( 181): [1]0x145c4d1: 0a callsubr
 gstype1.c( 169): [1]0: (43) -96.000000
 gstype1.c( 130): [1] (108)+50
 gstype1.c( 169): [1]1: (247) 158.000000
 gstype1.c( 181): [1]0x1408252: 01 hstem
 gstype1.c( 169): [1]0: (139) 0.000000
 gstype1.c( 130): [1] (108)+22
 gstype1.c( 169): [1]1: (247) 130.000000
 gstype1.c( 181): [1]0x1408256: 03 vstem
 gstype1.c( 181): [1]0x1408257: 0b return
 gstype1.c( 130): [1] (108)+141
 gstype1.c( 169): [1]0: (247) 249.000000
 gstype1.c( 169): [1]1: (238) 99.000000
 gstype1.c( 130): [1] (108)+61
 gstype1.c( 169): [1]2: (247) 169.000000
 gstype1.c( 130): [1] (108)+52
 gstype1.c( 169): [1]3: (247) 160.000000
 gstype1.c( 181): [1]0x145c4d9: 1f hvcurveto
 gstype1.c( 130): [1] (108)+139
 gstype1.c( 169): [1]0: (247) 247.000000
 gstype1.c( 130): [1] (-108)-38
 gstype1.c( 169): [1]1: (251) -146.000000
 gstype1.c( 130): [1] (108)+5
 gstype1.c( 169): [1]2: (247) 113.000000
 gstype1.c( 130): [1] (-108)-94
 gstype1.c( 169): [1]3: (251) -202.000000
 gstype1.c( 181): [1]0x145c4e2: 1e vhcurveto
 gstype1.c( 181): [1]0x145c4e3: 09 closepath
 gstype1.c( 169): [1]0: (91) -48.000000
 gstype1.c( 181): [1]0x145c4e5: 04 vmoveto
 gstype1.c( 130): [1] (108)+30
 gstype1.c( 169): [1]0: (247) 138.000000
 gstype1.c( 181): [1]0x145c4e8: 0a callsubr
 gstype1.c( 130): [1] (108)+243
 gstype1.c( 169): [1]0: (247) 351.000000
 gstype1.c( 169): [1]1: (183) 44.000000
 gstype1.c( 181): [1]0x140812b: 01 hstem
 gstype1.c( 130): [1] (620)+47
 gstype1.c( 169): [1]0: (249) 667.000000
 gstype1.c( 169): [1]1: (181) 42.000000
 gstype1.c( 181): [1]0x140812f: 03 vstem
 gstype1.c( 181): [1]0x1408130: 0b return
 gstype1.c( 169): [1]0: (46) -93.000000
 gstype1.c( 169): [1]1: (145) 6.000000
 gstype1.c( 169): [1]2: (229) 90.000000
 gstype1.c( 178): [1]0x145c4ec: 1a??
Error: /invalidfont in --.type1execchar--
Operand stack:
   --dict:15/18(ro)(G)--   79   O   -string-
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
%loop_continue   2   3   %oparray_pop   --nostringval--   --nostringval--  
false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   %finish_show  
--nostringval--   --nostringval--   3   3   0   --nostringval--   (gs_show_enum)
  %op_show_continue
Dictionary stack:
   --dict:1118/1686(ro)(G)--   --dict:0/20(G)--   --dict:73/200(L)--
Current allocation mode is local
Current file position is 48
GS>


In this example, the problem is with the character O (the letter, not zero). 
There are other "problem" characters in this font too.

Here is a backtrace from the last line in the output above (gstype1.c:178):

#0  gs_type1_interpret (pcis=0xbfff9a1c, pgd=0x2f, pindex=0xbfff9998) at
./src/gstype1.c:178
#1  0x000115a0 in type1_continue_dispatch (i_ctx_p=0x1420180, pcxs=0xbfff9a1c,
pcref=0x16, pos=0xbfffc428, num_args=32) at ./src/zchar1.c:642
#2  0x00010ffc in bbox_finish (i_ctx_p=0x1420180, cont=0x11424 <bbox_fill>,
exec_cont=0xbfffc4a8) at ./src/zchar1.c:472
#3  0x00010d98 in bbox_finish_fill (i_ctx_p=0x1420180) at ./src/zchar1.c:408
#4  0x00010984 in charstring_execchar (i_ctx_p=0x1420180,
font_type_mask=-1073756916) at ./src/zchar1.c:258
#5  0x0001069c in ztype1execchar (i_ctx_p=0x16) at ./src/zchar1.c:173
#6  0x0007fe44 in call_operator (op_proc=0x90028068 <fflush>, i_ctx_p=0x0) at
./src/interp.c:104
#7  0x00082584 in interp (pi_ctx_p=0x15004fc, pref=0x1473770,
perror_object=0xbffff5fc) at ./src/interp.c:1489
#8  0x00080418 in gs_call_interp (pi_ctx_p=0x15004fc, pref=0x0, user_errors=1,
pexit_code=0xbffff5f8, perror_object=0xbffff5fc) at ./src/interp.c:485
#9  0x000802c8 in gs_interpret (pi_ctx_p=0x15004fc, pref=0xbffff458,
user_errors=1, pexit_code=0xbffff5f8, perror_object=0xbffff5fc) at
./src/interp.c:443
#10 0x00076758 in gs_main_interpret (minst=0x1500328, pref=0x0, user_errors=1,
pexit_code=0xbffff5f8, perror_object=0xbffff5fc) at ./src/imain.c:308
#11 0x000770e8 in gs_main_run_string_end (minst=0x16, user_errors=10,
pexit_code=0x2e3ed0, perror_object=0x16) at ./src/imain.c:617
#12 0x00076fb4 in gs_main_run_string_with_length (minst=0x1500328, str=0x291840
"systemdict /start get exec", length=26, user_errors=1, pexit_code=0xbffff5f8,
perror_object=0xbffff5fc) at ./src/imain.c:575
#13 0x00076f28 in gs_main_run_string (minst=0x1500328, str=0x291840 "systemdict
/start get exec", user_errors=1, pexit_code=0xbffff5f8,
perror_object=0xbffff5fc) at ./src/imain.c:557
#14 0x00079670 in run_string (minst=0x1500328, str=0x0, options=2) at
./src/imainarg.c:803
#15 0x00078268 in gs_main_run_start (minst=0x16) at ./src/imainarg.c:235
#16 0x00002560 in main (argc=3, argv=0xbffff774) at ./src/gs.c:102


Please contact me directly, and I can provide the offending font for your
debugging and research purposes.  (I do not want to attach it to the bug for
legal/licensing reasons.)  Or, if you can provide some debugging hints as to
what I should look for, I will be happy to help track this down.
Comment 1 Alex Cherepanov 2006-10-04 18:57:46 UTC
Please try the current svn version. The bug may be fixed already.
You can also email me the font and sample files.
Comment 2 Jim Riggs 2006-10-05 05:49:48 UTC
OK, I have tried trunk with almost the same result.  The only difference now is
that the error is "/invalidfont in --execute--" rather than --.type1execchar--:

GS>0 0 moveto /ItcEras-Book 12 selectfont (O) show
Loading ItcEras-Book font from /tmp/gs/share/ghostscript/fonts/VZQjm74J.pfb...
3427628 1654123 1539136 248709 1 done.
 gxtype1.c( 109): [1]gs_type1_interp_init
 gstype1.c( 169): [1]0: (185) 46.000000
 gstype1.c( 130): [1] (620)+168
 gstype1.c( 169): [1]1: (249) 788.000000
 gstype1.c( 181): [1]0x15f54f1: 0d hsbw
 gxtype1.c( 202): [1]sb=(46,0) w=(788,0)
 gxtype1.c( 109): [1]gs_type1_interp_init
 gstype1.c( 169): [1]0: (185) 46.000000
 gstype1.c( 130): [1] (620)+168
 gstype1.c( 169): [1]1: (249) 788.000000
 gstype1.c( 181): [1]0x15f54f1: 0d hsbw
 gxtype1.c( 202): [1]sb=(46,0) w=(788,0)
 gstype1.c( 130): [1] (108)+20
 gstype1.c( 169): [1]0: (247) 128.000000
 gstype1.c( 181): [1]0x15f54f4: 0a callsubr
 gstype1.c( 130): [1] (620)+13
 gstype1.c( 169): [1]0: (249) 633.000000
 gstype1.c( 169): [1]1: (183) 44.000000
 gstype1.c( 181): [1]0x15b7cbf: 01 hstem
 gstype1.c( 169): [1]0: (198) 59.000000
 gstype1.c( 169): [1]1: (199) 60.000000
 gstype1.c( 181): [1]0x15b7cc2: 03 vstem
 gstype1.c( 130): [1] (108)+244
 gstype1.c( 169): [1]0: (247) 352.000000
 gstype1.c( 169): [1]1: (190) 51.000000
 gstype1.c( 181): [1]0x15b7cc6: 03 vstem
 gstype1.c( 181): [1]0x15b7cc7: 0b return
 gstype1.c( 130): [1] (108)+240
 gstype1.c( 169): [1]0: (247) 348.000000
 gstype1.c( 130): [1] (620)+58
 gstype1.c( 169): [1]1: (249) 678.000000
 gstype1.c( 181): [1]0x15f54f9: 15 rmoveto
 gstype1.c( 130): [1] (108)+11
 gstype1.c( 169): [1]0: (247) 119.000000
 gstype1.c( 181): [1]0x15f54fc: 0a callsubr
 gstype1.c( 169): [1]0: (43) -96.000000
 gstype1.c( 130): [1] (108)+50
 gstype1.c( 169): [1]1: (247) 158.000000
 gstype1.c( 181): [1]0x22d4ad3: 01 hstem
 gstype1.c( 169): [1]0: (139) 0.000000
 gstype1.c( 130): [1] (108)+22
 gstype1.c( 169): [1]1: (247) 130.000000
 gstype1.c( 181): [1]0x22d4ad7: 03 vstem
 gstype1.c( 181): [1]0x22d4ad8: 0b return
 gstype1.c( 130): [1] (108)+141
 gstype1.c( 169): [1]0: (247) 249.000000
 gstype1.c( 169): [1]1: (238) 99.000000
 gstype1.c( 130): [1] (108)+61
 gstype1.c( 169): [1]2: (247) 169.000000
 gstype1.c( 130): [1] (108)+52
 gstype1.c( 169): [1]3: (247) 160.000000
 gstype1.c( 181): [1]0x15f5504: 1f hvcurveto
 gstype1.c( 130): [1] (108)+139
 gstype1.c( 169): [1]0: (247) 247.000000
 gstype1.c( 130): [1] (-108)-38
 gstype1.c( 169): [1]1: (251) -146.000000
 gstype1.c( 130): [1] (108)+5
 gstype1.c( 169): [1]2: (247) 113.000000
 gstype1.c( 130): [1] (-108)-94
 gstype1.c( 169): [1]3: (251) -202.000000
 gstype1.c( 181): [1]0x15f550d: 1e vhcurveto
 gstype1.c( 181): [1]0x15f550e: 09 closepath
 gstype1.c( 169): [1]0: (91) -48.000000
 gstype1.c( 181): [1]0x15f5510: 04 vmoveto
 gstype1.c( 130): [1] (108)+30
 gstype1.c( 169): [1]0: (247) 138.000000
 gstype1.c( 181): [1]0x15f5513: 0a callsubr
 gstype1.c( 130): [1] (108)+243
 gstype1.c( 169): [1]0: (247) 351.000000
 gstype1.c( 169): [1]1: (183) 44.000000
 gstype1.c( 181): [1]0x15b7c29: 01 hstem
 gstype1.c( 130): [1] (620)+47
 gstype1.c( 169): [1]0: (249) 667.000000
 gstype1.c( 169): [1]1: (181) 42.000000
 gstype1.c( 181): [1]0x15b7c2d: 03 vstem
 gstype1.c( 181): [1]0x15b7c2e: 0b return
 gstype1.c( 169): [1]0: (46) -93.000000
 gstype1.c( 169): [1]1: (145) 6.000000
 gstype1.c( 169): [1]2: (229) 90.000000
 gstype1.c( 178): [1]0x15f5517: 1a??
Error: /invalidfont in --execute--
Operand stack:
   --dict:15/18(ro)(G)--   79   O   -string-
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
%loop_continue   1657   2   3   %oparray_pop   --nostringval--   --nostringval--
  false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   %finish_show  
--nostringval--   --nostringval--   3   3   0   --nostringval--   (gs_show_enum)
  %op_show_continue
Dictionary stack:
   --dict:1066/1123(ro)(G)--   --dict:0/20(G)--   --dict:72/200(L)--
Current allocation mode is local
Current file position is 48
GS>


#0  gs_type1_interpret (pcis=0xbfff99ec, pgd=0x2f, pindex=0xbfff9968) at
./src/gstype1.c:178
#1  0x00012d70 in type1_continue_dispatch (i_ctx_p=0x15be034, pcxs=0xbfff99ec,
pcref=0x16, pos=0xbfffc3f8, num_args=32) at ./src/zchar1.c:666
#2  0x000127cc in bbox_finish (i_ctx_p=0x15be034, cont=0x12bf4 <bbox_fill>,
exec_cont=0xbfffc478) at ./src/zchar1.c:496
#3  0x00012568 in bbox_finish_fill (i_ctx_p=0x15be034) at ./src/zchar1.c:432
#4  0x00012094 in charstring_execchar_aux (i_ctx_p=0x15be034, penum=0x15e4d88,
pfont=0x22d2d9c) at ./src/zchar1.c:251
#5  0x000121e4 in charstring_execchar (i_ctx_p=0x15be034, font_type_mask=18) at
./src/zchar1.c:306
#6  0x00011e20 in ztype1execchar (i_ctx_p=0x16) at ./src/zchar1.c:174
#7  0x00081074 in call_operator (op_proc=0x90028068 <fflush>, i_ctx_p=0x0) at
./src/interp.c:104
#8  0x00083ae8 in interp (pi_ctx_p=0x210037c, pref=0x172f5c8,
perror_object=0xbffff60c) at ./src/interp.c:1518
#9  0x00081648 in gs_call_interp (pi_ctx_p=0x210037c, pref=0x0, user_errors=1,
pexit_code=0xbffff608, perror_object=0xbffff60c) at ./src/interp.c:488
#10 0x000814f8 in gs_interpret (pi_ctx_p=0x210037c, pref=0xbffff4e8,
user_errors=1, pexit_code=0xbffff608, perror_object=0xbffff60c) at
./src/interp.c:446
#11 0x00077910 in gs_main_interpret (minst=0x16, pref=0x0, user_errors=22,
pexit_code=0xa0001c4c, perror_object=0x16) at ./src/imain.c:214
#12 0x000782b4 in gs_main_run_string_end (minst=0x16, user_errors=10,
pexit_code=0x608c8c, perror_object=0x16) at ./src/imain.c:530
#13 0x00078180 in gs_main_run_string_with_length (minst=0x2100328, str=0x26fb5c
"systemdict /start get exec", length=26, user_errors=1, pexit_code=0xbffff608,
perror_object=0xbffff60c) at ./src/imain.c:488
#14 0x000780f4 in gs_main_run_string (minst=0x2100328, str=0x26fb5c "systemdict
/start get exec", user_errors=1, pexit_code=0xbffff608,
perror_object=0xbffff60c) at ./src/imain.c:470
#15 0x0007a838 in run_string (minst=0x2100328, str=0x0, options=2) at
./src/imainarg.c:803
#16 0x00079434 in gs_main_run_start (minst=0x16) at ./src/imainarg.c:235
#17 0x00002a24 in main (argc=3, argv=0xbffff788) at ./src/gs.c:104


One of the problem fonts has been provided via e-mail. In that font, '(O) show'
causes the error described.  You can try other characters too.  In 8.53, h, n,
O, and Q cause the invalidfont.  In 8.54 and trunk, n, O, and Q cause the
invalidfont, but h, m, r, H, I, P, and R are giving me segfaults. This font (and
the others we are having problems with) have been in use for years in our
company without issues.  Distiller is fine with them as are our printers.
Comment 3 Marcos H. Woehrmann 2006-10-30 19:39:14 UTC
I've placed the user supplied font file in
file://casper.ghostscript.com/home/support/688928/ItcEras-Book
Comment 4 Alex Cherepanov 2007-09-09 12:37:16 UTC
I cannot reproduce the problem. Perhaps, we have a wrong file.
This is the md5 sum of the tested font.

md5sum ItcEras-Book
ef8c64033ff87d2fcea265ddd28a83ba *ItcEras-Book

I've tried current revision on Linux+x86, WinNT x86, AIX RS/6000 604e
and v. 8.54  on WinNT x86.

Please provide more information about your system.
Comment 5 leonardo 2008-01-31 03:46:50 UTC
Returning to support. Pleasse figure out whether this bug is still actual and 
please obtain a reproducible test case.
Comment 6 Alex Cherepanov 2008-04-21 21:03:31 UTC
The sample font file loads different fonts in high and low resolutions.
High resolution is 600 dpi and higher. The font does the magic by undoing
some of the defines with --restore--. This doesn't work in the global mode.

Fonts, installed as resources or founded through FONTPATH are loaded
to the global memory by default. The command line flag -dLOCALFONTS
loads the font into current memory, which is usually local. This flag
can be used to work around the poor design of the font.

By chance, the font works at high resolution even in the global mode.
By default, Distiller runs at 600 dpi, i.e. at high resolution.

The ultimate fix for this kind of problems is to extract CharStrings and
discard all kinds of PostScript nonsense. I'm making this bug a duplicate
of another bug that requires a similar approach.




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