In the course of check that opteron segfault (bug 688720/721), I ran ps2pdf on every pdf file in my hard disc. These are the pdf files which works alright with xpdf or acroread, but ps2pdf won't process. (while gs x11 devices may). files to be attached, and details each later.
Created attachment 2248 [details] ps2pdf failed with /invalidfont in --show-- x11 works fine, but ps2pdf fails with this: /usr/bin/ps2pdf /home/hin-tak/cache-www.intel.com/cd/00/00/22/23/222300_222300.pdf /tmp/c.pdf **** Warning: ToUnicode CMap has invalid syntax near CIDSystemInfo. Error: /invalidfont in --show-- Operand stack: --dict:10/10(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 10 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- %array_continue Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:76/200(L)-- --dict:76/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:21/32(L)-- --dict:22/31(L)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
Created attachment 2249 [details] Error: /invalidfont in --awidthshow-- x11 works, but ps2pdf fails with Error: /invalidfont in --awidthshow-- Operand stack: --dict:8/8(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 4 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:27/32(L)-- Current allocation mode is local AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
Created attachment 2250 [details] Error: /typecheck in --closefile-- the graphics on page 106 is a bit funny, but acroread coped (displaying a blackbox), and xpdf even managed to display 3/4 of the image. $xpdf file.pdf Error (438330): CCITTFax row is wrong length (2337) Error (438335): Bad two dim code (0000) in CCITTFax stream **** Warning: File has insufficient data for an image. Error: /typecheck in --closefile-- Operand stack: --dict:8/8(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 107 1 394 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- 413226 Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:24/32(L)-- --dict:1/1(ro)(G)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 8.54: Unrecoverable error, exit code 1 AFPL Ghostscript 8.54: ERROR: A pdfmark destination page 387 points beyond the last page 105.
Created attachment 2251 [details] Error: /undefinedresource in --findresource-- page 87 apparently contains japanese, and I haven't configured ghostscript specifically to work with japanese, so this is probably unfair, but xpdf carries on, and so does acrobat reader after emitting a warning message. Error: /undefinedresource in --findresource-- Operand stack: --dict:8/8(L)-- G1 1 --dict:5/5(L)-- --dict:5/5(L)-- Ryumin-Light-Identity-H --dict:11/12(ro)(G)-- --nostringval-- --dict:7/7(L)-- --dict:7/7(L)-- Adobe-Japan1 CIDFont Adobe-Japan1 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 88 1 116 --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-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- 12 9 %oparray_pop --nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:76/200(L)-- --dict:76/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:25/32(L)-- --dict:20/26(ro)(G)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 8.54: Unrecoverable error, exit code 1 AFPL Ghostscript 8.54: ERROR: A pdfmark destination page 107 points beyond the last page 86.
Created attachment 2252 [details] Error: /typecheck in --get-- awfully broken pdf file, xpdf won't open, but acrobat reader can open and skip over page 40-ish to 99-ish. **** Warning: File has an invalid xref entry: 159. Rebuilding xref table. **** Warning: There are objects with matching object and generation **** numbers. The accuracy of the resulting image is unknown. Error: /typecheck in --get-- Operand stack: --dict:8/8(L)-- --dict:147/147(ro)(L)-- --dict:8/8(L)-- false --dict:8/8(L)-- --dict:1/4(L)-- --dict:5/5(L)-- false --nostringval-- --nostringval-- Subtype Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 97 1 272 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- --dict:1/1(L)-- --nostringval-- 1 %dict_continue --nostringval-- Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:22/24(L)-- --dict:3/5(L)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
Created attachment 2253 [details] Error: /typecheck in --closefile-- there is an image problem on page 43. acroread copes alright, and so does xpdf after emiting warning/error. ghostscript also segfaults after the error. **** Warning: File has insufficient data for an image. Error: /typecheck in --closefile-- Operand stack: --dict:8/8(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 44 1 306 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- 1241644 Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:21/32(L)-- --dict:1/1(ro)(G)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 8.54: Unrecoverable error, exit code 1 gdb /usr/local/bin/gs GNU gdb Red Hat Linux (6.3.0.0-1.122rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run -sDEVICE=pdfwrite -sOutputFile=/tmp/c.pdf -dNOPAUSE -dBATCH 'file.pdf' ... Program received signal SIGSEGV, Segmentation fault. gc_objects_clear_marks (mem=0x8d7c08, cp=0xe07570) at ./src/igc.c:595 595 pre->o_type->clear_marks; (gdb) bt #0 gc_objects_clear_marks (mem=0x8d7c08, cp=0xe07570) at ./src/igc.c:595 #1 0x0000000000494f23 in gs_gc_reclaim (pspaces=Variable "pspaces" is not available. ) at ./src/igc.c:261 #2 0x000000000050a3d4 in context_reclaim (pspaces=0x90a260, global=1) at ./src/zcontext.c:283 #3 0x0000000000473542 in ireclaim (dmem=0x90a258, space=8) at ./src/ireclaim.c:153 #4 0x000000000046f75f in interp_reclaim (pi_ctx_p=0x8d76b8, space=8) at ./src/interp.c:416 #5 0x000000000046787a in gs_main_finit (minst=0x8d74a0, exit_status=1, code=-100) at ./src/imain.c:840 #6 0x0000000000404694 in main (argc=6, argv=0x7fffffc7c388) at ./src/gs.c:117 #7 0x000000324841ce54 in __libc_start_main () from /lib64/libc.so.6 #8 0x0000000000404559 in _start () #9 0x00007fffffc7c378 in ?? () #10 0x0000000000000000 in ?? () (gdb)
Created attachment 2254 [details] Error: /typecheck in --.knownget-- x11 works, and acroread works without warning, but ps2pdf fails with: **** Warning: Outline has invalid link that was discarded. Error: /typecheck in --.knownget-- Operand stack: --dict:8/8(L)-- --dict:7/7(L)-- --dict:4/4(L)-- --dict:4/4(L)-- --nostringval-- --dict:4/4(L)-- --nostringval-- 894482 1137 0 --nostringval-- Annots --nostringval-- Contents --nostringval-- Type Page Parent --nostringval-- Rotate 0 MediaBox --nostringval-- CropBox --nostringval-- Resources --nostringval-- ColorSpace First Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:20/24(L)-- Current allocation mode is local AFPL Ghostscript 8.54: Unrecoverable error, exit code 1 AFPL Ghostscript 8.54: ERROR: A pdfmark destination page 77 points beyond the last page 1.
Created attachment 2255 [details] Error: /rangecheck in --pdfmark-- acroread works alright, x11 also works, ps2pdf fails with: Error: /rangecheck in --pdfmark-- Operand stack: --dict:6/6(L)-- --nostringval-- --nostringval-- Color --nostringval-- Rect --nostringval-- Border --nostringval-- --dict:7/7(L)-- Page 35 LNK Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 35 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- 4 1 11 --nostringval-- %for_pos_int_continue 13 7 %oparray_pop --nostringval-- Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24(L)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
Created attachment 2256 [details] ERROR -15 closing null device. See gs/src/ierrors.h for code explanation. this file was produced by acrobat distiller, and doesn't AFPL Ghostscript 8.54: ERROR -15 closing null device. See gs/src/ierrors.h for code explanation.
Some of the files are obviously broken (2250, 2252, 2253), some are supposed to be correct (2248,2249, especially 2256), 2251 is probably regarded as a mis-configuration, don't know about 2254/2255 ; the segfault in 2253 probably also needs looking at.
Apologies for the long file list. Probably can keep somebody busy for a while...
I will go through them and try and reproduce on 32 bit. Some of the files are obviously broken, but we need to check the creators and compare support with other programs.
Sorry, I wasn't being too clear - I already filled another bug (Bug 688725 "64-bit/32-bit behaves differently for these pdf files") where 32-bit/64-bit ghostscript behaves differently; so this bug report is about the cases where 32-bit/64-bit ghostscript behaves apparently the same way, but both are questionable. So you should be able to reproduce these problems on 32-bit.
Created attachment 2268 [details] patch for /typecheck in --closefile-- This is a patch for "/typecheck in --closefile--" whic happens because image operator doesn't restore the operand stack. Fixing the image operator would be a better approach, but the patch is simple and can be replaced later if needed. This error also happens in bug 688532, bug 688646, bug 688672, bug 688740.
*** Bug 688827 has been marked as a duplicate of this bug. ***
Patch is OK to commit.
The patch from the comment #14 is committed as rev. 7056.
1 - works fine 2 - works fine 3 - has incomplete images, gs recover them better than Acrobat 4 - required Japanese fonts 5 - badly broken file: has references to non-existing objects and string like '360.49.236093' in the content stream. IMO, repairing such files is not the best use of engineering resources. 6 - has incomplete images, gs recover them better than Acrobat 7 - works fine 8 - works fine 9 - the only file that still fails and can be fixed.
Reassigning to Ken because the last remaining issue is specific to the PDF writer.
The final problem is resolved in revision 9446, patch available here: http://ghostscript.com/pipermail/gs-cvs/2009-February/009024.html