I have a certain document which CUPS refuses to print. Setting the error level, it shows the gs returned "Unrecoverable Error". Rather than duplicate my report here, please have a look at the information I submitted via the Debian BTS (url given above). This includes CUPS logs and a copy of the postscript output from the windows printer driver which is being fed to CUPS.
The given test file works for me with Ghostscript version 7.07, 8.51, and 8.54. The bug report does not give the command line which is given to Ghostscript so there is not much more that we can do.
The command line is right there in the CUPS log: gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="HP LaserJet" -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dDuplex=false -r300 -sIjsParams=Quality:Quality=0,Quality:ColorMode=0,Quality:MediaType=0,Quality:PenSet=0,PS:MediaPosition=7 -dIjsUseOutputFD -sOutputFile=- -
Using the given command line with 8.54, reproduced the problem. with -dDEBUG, these are the last few lines: =============== resmp ResourceFileName : retrieving /usr/share/ghostscript/8.54/Resource/CIDFont/pdf resmp ResourceFileName end resmp ResourceStatus end cidcm GetCIDSystemInfo end resmp ResourceStatus beg (XKLAAA+Wingdings2) resmp ResourceStatus end resmp ResourceStatus beg (XKLAAA+Wingdings2) resmp ResourceStatus end resmp FindResource beg XKLAAA+Wingdings2 resmp FindResource end resmp FindResource beg XKLAAA+Wingdings2 resmp FindResource end AFPL Ghostscript 8.54: Unrecoverable error, exit code 1 =============== svn 7199 dies at the same point with Segmentation Fault instead. (ESP Ghostscript 8.15.2 (2006-04-19) also segfaults). both the segfaults binaries are 64-bit, and the unrecover binary 32-bit. also tried 64-bit v8.54, and it segfaults. So it seems that 64-bit 8.15.2/8.54/latest-svn segfaults, whereas 32-bit 8.54 dies with unrecoverable error. (and -sDEVICE=x11 and =nullpage both works fine) Changing the "component" to "other driver" - it is either an IJS problem or a font problem, but most probably not a "PS Writer" problem. I'll see where the segfault is tomorrow.
Very strange, now I am sitting in front the computer, and all the 64-bit binaries (8.15.2, 8.54, svn-latest) dies with: AFPL Ghostscript 8.54: Unrecoverable error, exit code 1 instead of segfault. Will have to try from home again to see if I can get a segfault...
"Unrecoverable Error from gs while printing via CUPS" to "Unrecoverable Error from gs with ijs device" svn 7200, 64-bit, with example server: bin/gs -sDEVICE=ijs -sIjsServer=ijs/ijs_server_example -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -r300 -dIjsUseOutputFD -sOutputFile=/tmp/fggg ~/private-dev/application-form.ps AFPL Ghostscript SVN PRE-RELEASE 8.55: Unrecoverable error, exit code 1 removing -r300, and it went successfully.
Created attachment 2610 [details] test ps file copied from the debian bug report the test ps file copied from the debian bug report. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=396289
besides comment #5, there seems to be another source of problem. KRGB-1.3-8.54 patched svn 7200 segfaults in some of the krgb related decisions (gdb backtrace), running just /usr/bin/gs -sDEVICE=ijs -sIjsServer=ijs/ijs_server_example \ -dIjsUseOutputFD -sOutputFile=/tmp/fggg test-bug68891.ps (stock svn 7200 runs the above okay) and most linux distro ships eps/gpl gs with the krgb patch. =================== Program received signal SIGSEGV, Segmentation fault. gsijs_fill_rectangle (dev=0xdde638, x=0, y=0, w=595, h=842, color=16777215) at ./src/gdevijs.c:246 246 if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0) (gdb) bt #0 gsijs_fill_rectangle (dev=0xdde638, x=0, y=0, w=595, h=842, color=16777215) at ./src/gdevijs.c:246 #1 0x000000000061a9be in gx_dc_pure_fill_rectangle (pdevc=<value optimized out>, x=0, y=0, w=595, h=842, dev=0xdde638, lop=252, source=0x0) at ./src/gxdcolor.c:384 #2 0x0000000000605972 in gs_fillpage (pgs=0xd74078) at ./src/gspaint.c:91 #3 0x000000000047095e in gs_interpret (pi_ctx_p=0xd5d298, pref=<value optimized out>, user_errors=1, pexit_code=0x7fff0d5f8cec, perror_object=0x7fff0d5f8cd0) at ./src/interp.c:1518 #4 0x0000000000467995 in gs_main_init2 (minst=0xd5d200) at ./src/imain.c:461 #5 0x00000000004681a3 in runarg (minst=0xd5d200, pre=0x6ce94e "", arg=0xd954f0 "/home/hin-tak/private-dev/application-form.ps", post=0x6680b0 ".runfile", options=<value optimized out>) at ./src/imainarg.c:779 #6 0x0000000000468404 in argproc (minst=0xd5d200, arg=<value optimized out>) at ./src/imainarg.c:728 #7 0x000000000046997b in gs_main_init_with_args (minst=0xd5d200, argc=8, argv=<value optimized out>) at ./src/imainarg.c:211 #8 0x0000000000404041 in main (argc=8, argv=0x7fff0d5f9ca8) at ./src/gs.c:77 ==================
svn 7200 stock: - -r300 to -r296 (unrecovered error), -r295 to segfault, but doesn't under gdb until -r294: ============ bt #0 0x00000032b5676ebc in memcpy () from /lib64/libc.so.6 #1 0x00000000005ebe2e in bytes_copy_rectangle () #2 0x00000000005451dd in cmd_put_bits () #3 0x000000000054becb in clist_copy_color () #4 0x0000000000614a17 in clip_call_copy_color () #5 0x0000000000614a64 in clip_copy_color () #6 0x00000000004630c7 in tile_clip_copy_color () #7 0x0000000000463caf in tile_colored_fill () #8 0x00000000004640eb in tile_by_steps () #9 0x000000000046484b in gx_dc_pattern_fill_rectangle () #10 0x000000000061a8ab in gx_dc_default_fill_masked () #11 0x000000000062a517 in copy_portrait () #12 0x000000000062b7e6 in image_render_simple () #13 0x000000000062a043 in gx_image1_plane_data () #14 0x00000000005fdae0 in gs_image_next_planes () #15 0x0000000000492339 in image_file_continue () #16 0x000000000046ffa8 in gs_interpret () #17 0x0000000000466c0e in gs_main_run_string_end () #18 0x0000000000467b80 in run_string () #19 0x0000000000468256 in runarg () #20 0x00000000004683f4 in argproc () #21 0x000000000046996b in gs_main_init_with_args () #22 0x0000000000403ff1 in main () =================== -r290 segfault under gdb at a slightly different point: =============== (gdb) bt #0 0x00000032b5676ebc in memcpy () from /lib64/libc.so.6 #1 0x00000000005ebe2e in bytes_copy_rectangle () #2 0x00000000005451dd in cmd_put_bits () #3 0x000000000054becb in clist_copy_color () #4 0x0000000000614a17 in clip_call_copy_color () #5 0x0000000000614a64 in clip_copy_color () #6 0x00000000004630c7 in tile_clip_copy_color () #7 0x000000000063b95d in gx_default_strip_tile_rectangle () #8 0x00000000004648c2 in gx_dc_pattern_fill_rectangle () #9 0x000000000061a8ab in gx_dc_default_fill_masked () #10 0x000000000062a517 in copy_portrait () #11 0x000000000062b7e6 in image_render_simple () #12 0x000000000062a043 in gx_image1_plane_data () #13 0x00000000005fdae0 in gs_image_next_planes () #14 0x0000000000492339 in image_file_continue () #15 0x000000000046ffa8 in gs_interpret () #16 0x0000000000466c0e in gs_main_run_string_end () #17 0x0000000000467b80 in run_string () #18 0x0000000000468256 in runarg () #19 0x00000000004683f4 in argproc () #20 0x000000000046996b in gs_main_init_with_args () #21 0x0000000000403ff1 in main () ================ -r280 changes to: ================ bt #0 0x000000000045ba8c in s_RLE_process () #1 0x000000000054540f in cmd_put_bits () #2 0x000000000054becb in clist_copy_color () #3 0x0000000000614a17 in clip_call_copy_color () #4 0x0000000000614a64 in clip_copy_color () #5 0x00000000004630c7 in tile_clip_copy_color () #6 0x000000000063b95d in gx_default_strip_tile_rectangle () #7 0x00000000004648c2 in gx_dc_pattern_fill_rectangle () #8 0x000000000061a8ab in gx_dc_default_fill_masked () #9 0x000000000062a517 in copy_portrait () #10 0x000000000062b7e6 in image_render_simple () #11 0x000000000062a043 in gx_image1_plane_data () #12 0x00000000005fdae0 in gs_image_next_planes () #13 0x0000000000492339 in image_file_continue () #14 0x000000000046ffa8 in gs_interpret () #15 0x0000000000466c0e in gs_main_run_string_end () #16 0x0000000000467b80 in run_string () #17 0x0000000000468256 in runarg () #18 0x00000000004683f4 in argproc () #19 0x000000000046996b in gs_main_init_with_args () #20 0x0000000000403ff1 in main () (gdb) ============ below -r278 seems okay. a more detailed backtrace at -r279: ================= (gdb) run -sDEVICE=ijs -sIjsServer=ijs/ijs_server_example -r279 -dIjsUseOutputFD -sOutputFile=/tmp/fggg ~/private-dev/application-form.ps .... Program received signal SIGSEGV, Segmentation fault. 0x00000032b5676ebc in memcpy () from /lib64/libc.so.6 (gdb) bt #0 0x00000032b5676ebc in memcpy () from /lib64/libc.so.6 #1 0x00000000005ebdde in bytes_copy_rectangle (dest=0x2aaaaab76c0e "", dest_raster=<value optimized out>, src=0x2aaa3047466e <Address 0x2aaa3047466e out of bounds>, src_raster=2, width_bytes=33, height=1) at ./src/gsbitops.c:657 #2 0x000000000054518d in cmd_put_bits (cldev=0xddd598, pcls=0x2aaaaab6c800, data=0x2aaa3047466e <Address 0x2aaa3047466e out of bounds>, width_bits=<value optimized out>, height=1, raster=328080, op_size=6, compression_mask=2, pdp=0x7fffa8a22420, psize=0x7fffa8a2242c) at ./src/gxclbits.c:231 #3 0x000000000054be7b in clist_copy_color (dev=0xddd598, data=0x2aaa30474488 <Address 0x2aaa30474488 out of bounds>, data_x=<value optimized out>, raster=328080, id=<value optimized out>, x=236, y=60, width=<value optimized out>, height=1) at ./src/gxclrect.c:369 #4 0x00000000006149c7 in clip_call_copy_color (pccd=<value optimized out>, xc=1, yc=31, xec=<value optimized out>, yec=<value optimized out>) at ./src/gxclip.c:400 #5 0x0000000000614a14 in clip_copy_color (dev=0x2aaaaab76c0e, data=<value optimized out>, sourcex=<value optimized out>, raster=<value optimized out>, id=<value optimized out>, x=-1430819826, y=60, w=11, h=1) at ./src/gxclip.c:414 #6 0x0000000000463087 in tile_clip_copy_color (dev=0x7fffa8a22828, data=<value optimized out>, sourcex=162, raster=328080, id=<value optimized out>, x=236, y=60, w=11, h=1) at ./src/gxclip2.c:259 #7 0x0000000000463c6f in tile_colored_fill (ptfs=0x7fffa8a22800, x=236, y=60, w=11, h=1) at ./src/gxp1fill.c:210 #8 0x00000000004640ab in tile_by_steps (ptfs=0x7fffa8a22800, x0=236, y0=60, w0=<value optimized out>, h0=<value optimized out>, ptile=<value optimized out>, tbits_or_tmask=0xd9b088, fill_proc=0x463a50 <tile_colored_fill>) at ./src/gxp1fill.c:182 #9 0x000000000046480b in gx_dc_pattern_fill_rectangle (pdevc=<value optimized out>, x=236, y=60, w=11, h=1, dev=0x1259a48, lop=252, source=0x0) at ./src/gxp1fill.c:285 #10 0x000000000061a85b in gx_dc_default_fill_masked (pdevc=0x12e6780, data=<value optimized out>, data_x=<value optimized out>, raster=64, id=<value optimized out>, x=75, y=60, w=436, h=1, dev=0x1259a48, lop=252, invert=1) at ./src/gxdcolor.c:641 #11 0x000000000062a4c7 in copy_portrait (penum=<value optimized out>, data=<value optimized out>, dx=14538136, raster=64, x=75, y=60, w=436, h=1, dev=0x1259a48) at ./src/gxifast.c:520 #12 0x000000000062b796 in image_render_simple (penum=0x12618a8, buffer=0x1257f98 'ÿ' <repeats 11 times>, "ø\030\036", data_x=0, w=251, h=<value optimized out>, dev=0x1259a48) at ./src/gxifast.c:634 #13 0x0000000000629ff3 in gx_image1_plane_data (info=0x12618a8, planes=0x12fbae8, height=<value optimized out>, rows_used=0x7fffa8a27c34) at ./src/gxidata.c:208 #14 0x00000000005fda90 in gs_image_next_planes (penum=0x12e6ea8, plane_data=0x7fffa8a27c90, used=0x7fffa8a2fb10) at ./src/gsimage.c:535 #15 0x00000000004922f9 in image_file_continue (i_ctx_p=0xd72e18) at ./src/zimage.c:501 #16 0x000000000046ff68 in gs_interpret (pi_ctx_p=0xd5c298, pref=<value optimized out>, user_errors=1, pexit_code=0x7fffa8a3216c, perror_object=0x7fffa8a32150) at ./src/interp.c:1146 #17 0x0000000000466bce in gs_main_run_string_end (minst=0x2aaaaab76c0e, user_errors=1, pexit_code=0x2, perror_object=0x21) at ./src/imain.c:530 #18 0x0000000000467b40 in run_string (minst=0x2aaaaab76c0e, str=0x2aaa3047466e <Address 0x2aaa3047466e out of bounds>, options=2) at ./src/imainarg.c:803 #19 0x0000000000468216 in runarg (minst=0xd5c200, pre=0x6ce3ae "", arg=0xd94450 "/home/hin-tak/private-dev/application-form.ps", post=0x667b10 ".runfile", options=<value optimized out>) at ./src/imainarg.c:793 #20 0x00000000004683b4 in argproc (minst=0xd5c200, arg=<value optimized out>) at ./src/imainarg.c:728 #21 0x000000000046992b in gs_main_init_with_args (minst=0xd5c200, argc=7, argv=<value optimized out>) at ./src/imainarg.c:211 #22 0x0000000000403ff1 in main (argc=7, argv=0x7fffa8a33128) at ./src/gs.c:77 (gdb) =============== 8.54 changes behavior between -r100 (unrecovered error), to -r99 (ok). (comment #5), -r72 also okay. Not settling -r causes a segfault with KRGB patch. (all with the example server). ========================== #0 0x081ba8ab in gsijs_fill_rectangle () #1 0x082606b1 in gx_dc_pure_fill_rectangle () #2 0x0824925f in gs_fillpage () #3 0x080b683e in interp () #4 0x080b4e40 in gs_call_interp () #5 0x080b4d14 in gs_interpret () #6 0x080ac476 in gs_main_interpret () #7 0x080accef in gs_run_init_file () #8 0x080ac702 in gs_main_init2 () #9 0x080af213 in runarg () #10 0x080af047 in argproc () #11 0x080adc9c in gs_main_init_with_args () #12 0x0804af2d in main () ===================
Seems to be two problems - one to do with tiling, another to do with KRGB patch.
Confirmed with r7203: $ bin/gs -I../fonts -dBATCH -r300 688991.ps AFPL Ghostscript SVN PRE-RELEASE 8.55 (2006-05-20) Copyright (C) 2006 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Loading NimbusMonL-Regu font from ../fonts/n022003l.pfb... 3350776 1677555 1883832 591081 1 done. Segmentation fault
Ralph: you should you can get a segfault with nothing but those switches? with r7203, I get a very big window (default x11) with the correct content, on x86_64.
Not sure if this is helpful; I found that the failure is occuring when gs_heap_alloc_bytes is called with a rediculously large size argument. (gdb) break gsmalloc.c:168 (gdb) run -Z -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -dDEBUG -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="HP LaserJet" -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dDuplex=false -r300 -sIjsParams=Quality:Quality=0,Quality:ColorMode=0,Quality:MediaType=0,Quality:PenSet=0,PS:MediaPosition=7 -dIjsUseOutputFD -sOutputFile=output ../psfiles/leave-application.ps ... snip lots of output ... cidcm GetCIDSystemInfo beg resmp ResourceStatus beg /pdf resmp ResourceFileName beg pdf resmp ResourceFileName : have NO map record. resmp ResourceFileName : retrieving /usr/share/gs-gpl/8.54/Resource/CIDFont/pdf resmp ResourceFileName end resmp ResourceStatus end cidcm GetCIDSystemInfo end resmp ResourceStatus beg (XKLAAA+Wingdings2) resmp ResourceStatus end resmp ResourceStatus beg (XKLAAA+Wingdings2) resmp ResourceStatus Breakpoint 1, gs_heap_alloc_bytes (mem=0x84b5008, size=2490274048, cname=0x8469065 "large object chunk") at ./src/gsmalloc.c:168 168 set_msg("exceeded limit"); (gdb) bt #0 gs_heap_alloc_bytes (mem=0x84b5008, size=2490274048, cname=0x8469065 "large object chunk") at ./src/gsmalloc.c:168 #1 0x0830d6eb in gs_locked_alloc_bytes_immovable (mem=0x84b5100, size=2490274048, cname=0x8469065 "large object chunk") at ./src/gsmemlok.c:189 #2 0x0830e9b6 in gs_retrying_alloc_bytes_immovable (mem=0x84b51b8, size=2490274048, cname=0x8469065 "large object chunk") at ./src/gsmemret.c:184 #3 0x082e84e4 in alloc_acquire_chunk (mem=0x84b56b4, csize=2490274048, has_strings=0, cname=0x8469065 "large object chunk") at ./src/gsalloc.c:1677 #4 0x082e7546 in alloc_obj (mem=0x84b56b4, lsize=2490274020, pstype=0x8470ca0, flags=0, cname=0x8477954 "mem_open") at ./src/gsalloc.c:1145 #5 0x082e5942 in i_alloc_bytes (mem=0x84b56b4, size=2490274020, cname=0x8477954 "mem_open") at ./src/gsalloc.c:549 #6 0x0836f80b in gdev_mem_open_scan_lines (mdev=0x88cc7c8, setup_height=7059) at ./src/gdevmem.c:305 #7 0x0836f75b in mem_open (dev=0x88cc7c8) at ./src/gdevmem.c:290 #8 0x080d37e5 in pattern_accum_open (dev=0x88cbae8) at ./src/gxpcmap.c:236 #9 0x080d476d in gx_pattern_load (pdc=0x88b901c, pis=0x84c6844, dev=0x84fe0cc, select=gs_color_select_texture) at ./src/gxpcmap.c:647 #10 0x080d4b87 in gs_pattern1_remap_color (pc=0x8759e14, pcs=0x88ba198, pdc=0x88b901c, pis=0x84c6844, dev=0x84fe0cc, select=gs_color_select_texture) at ./src/gxpcmap.c:731 #11 0x080ce9f0 in gx_remap_Pattern (pc=0x8759e14, pcs=0x88ba198, pdc=0x88b901c, pis=0x84c6844, dev=0x84fe0cc, select=gs_color_select_texture) at ./src/gspcolor.c:229 #12 0x083297ab in gx_remap_color (pgs=0x84c6844) at ./src/gxcmap.c:538 #13 0x08303f67 in gs_image_begin_typed (pic=0xbff15204, pgs=0x84c6844, uses_color=1, ppie=0xbff14fb0) at ./src/gsimage.c:160 #14 0x08115ae7 in zimage_setup (i_ctx_p=0x84d7018, pim=0xbff15204, sources=0xbff14ff8, uses_color=1, npop=1) at ./src/zimage.c:135 #15 0x08115d51 in zimagemask1 (i_ctx_p=0x84d7018) at ./src/zimage.c:194 #16 0x080e0bf9 in call_operator (op_proc=0x8115c4e <zimagemask1>, i_ctx_p=0x84d7018) at ./src/interp.c:104 #17 0x080e2b0e in interp (pi_ctx_p=0x84b5424, pref=0xbff15ab8, perror_object=0xbff15b98) at ./src/interp.c:1119 #18 0x080e1278 in gs_call_interp (pi_ctx_p=0x84b5424, pref=0xbff15ab8, user_errors=1, pexit_code=0xbff15ba0, perror_object=0xbff15b98) at ./src/interp.c:485 #19 0x080e10f0 in gs_interpret (pi_ctx_p=0x84b5424, pref=0xbff15ab8, user_errors=1, pexit_code=0xbff15ba0, perror_object=0xbff15b98) at ./src/interp.c:443 #20 0x080d60fe in gs_main_interpret (minst=0x84b5250, pref=0xbff15b10, user_errors=1, pexit_code=0xbff15ba0, perror_object=0xbff15b98) at ./src/imain.c:308 #21 0x080d6bea in gs_main_run_string_end (minst=0x84b5250, user_errors=1, pexit_code=0xbff15ba0, perror_object=0xbff15b98) at ./src/imain.c:617 #22 0x080d6ab9 in gs_main_run_string_with_length (minst=0x84b5250, str=0x851ce18 "<2e2e2f707366696c65732f6c656176652d6170706c69636174696f6e2e7073>.runfile", length=72, user_errors=1, pexit_code=0xbff15ba0, perror_object=0xbff15b98) at ./src/imain.c:575 #23 0x080d6a21 in gs_main_run_string (minst=0x84b5250, str=0x851ce18 "<2e2e2f707366696c65732f6c656176652d6170706c69636174696f6e2e7073>.runfile", user_errors=1, pexit_code=0xbff15ba0, perror_object=0xbff15b98) at ./src/imain.c:557 #24 0x080d9664 in run_string (minst=0x84b5250, str=0x851ce18 "<2e2e2f707366696c65732f6c656176652d6170706c69636174696f6e2e7073>.runfile", options=3) at ./src/imainarg.c:803 #25 0x080d9612 in runarg (minst=0x84b5250, pre=0x8393ddb "", arg=0x84dc6b8 "../psfiles/leave-application.ps", post=0x8393e75 ".runfile", options=3) at ./src/imainarg.c:793 #26 0x080d9315 in argproc (minst=0x84b5250, arg=0xbff169d4 "../psfiles/leave-application.ps") at ./src/imainarg.c:728 #27 0x080d7e51 in gs_main_init_with_args (minst=0x84b5250, argc=20, argv=0xbff165f4) at ./src/imainarg.c:211 #28 0x0804af9e in main (argc=20, argv=0xbff165f4) at ./src/gs.c:75 (gdb) c Continuing. [a+]gs_malloc(large object chunk)(2490274048) = 0x0: exceeded limit Breakpoint 1, gs_heap_alloc_bytes (mem=0x84b5008, size=2490274048, cname=0x8469065 "large object chunk") at ./src/gsmalloc.c:168 168 set_msg("exceeded limit"); (gdb) c Continuing. [a+]gs_malloc(large object chunk)(2490274048) = 0x0: exceeded limit end resmp FindResource beg XKLAAA+Wingdings2 resmp FindResource end resmp FindResource beg XKLAAA+Wingdings2 resmp FindResource end GPL Ghostscript 8.54: Unrecoverable error, exit code 1 Program exited with code 01.
Just trying to dig a bit deeper to find the error cause. The memory being allocated is for a "thing" (still learning my way around the code and ps) with these dimensions: (gdb) print gdev_mem_open_scan_lines::mdev->width $16 = 117591 (gdb) print gdev_mem_open_scan_lines::mdev->height $17 = 7059 I'm guessing that's not normal to be trying to render something that big. Someone more familiar with the inner workings of gs, please chime in anytime. I'm going to start digging backwards some more to see where these dimensions came from.
Found another (possibly) useful breakpoint. In gs_pattern1_make_pattern(), the line... int code = gs_make_pattern_common(pcc, (const gs_pattern_template_t *)pcp, pmat, pgs, mem, &st_pattern1_instance); ...is where the ((gs_pattern1_instance_t *)pcc->pattern)->size is set to the values in my previous comment. Still digging...
Sorry (confused again) - I mean this line: code = compute_inst_matrix(&inst, saved, &bbox, dev_width, dev_height); Which puts the values in &bbox, to be used a few lines further down to assign inst.size
With 8.56 release, using "gs -sDEVICE=ppmraw -o x.ppm bug_688991.ps" I get: Artifex Ghostscript 8.56: Unrecoverable error, exit code 1 With HEAD (r7888) it works. Examining the file, I see that there is a "setpattern". I haven't analyzed the bbox of the pattern cell, but since others have seen seg faults and allocation problems, I suspect that this is a duplicate of bug 688396 which has been fixed. Please re-test with some revision greater than 7861 (where the big pattern fix was committed).
With r7899 the test document now prints. Used debian package from here - http://www.mhatta.org/blog/2007/05/05/svn-snapshot-gs-gpl-available