Bug 689371

Summary: "stcolor" driver segfaults
Product: Ghostscript Reporter: Till Kamppeter <till.kamppeter>
Component: Printer DriverAssignee: Default assignee <ghostpdl-bugs>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: CUPS 1.2.x test page, the test file used here

Description Till Kamppeter 2007-07-26 14:56:17 UTC
Entering

cat /usr/share/cups/data/testprint.ps | gs -q -dBATCH -dPARANOIDSAFER -dQUIET
-dNOPAUSE -sDEVICE=stcolor -r360x360 -dnoWeave -sDithering=gsmono
-sOutputCode=runlength -sOutputFile=-  - | cat -> x

I get the file x with zero length.

cat /usr/share/cups/data/testprint.ps | gs -q -dBATCH -dPARANOIDSAFER -dQUIET
-dNOPAUSE -sDEVICE=stcolor -r360x360 -dnoWeave -sDithering=gsmono
-sOutputCode=runlength -sOutputFile=x  -

produces a segmentation fault.

This happens under Linux on both x86 32-bit and x86 64-bit.
Comment 1 Till Kamppeter 2007-07-26 14:58:11 UTC
Created attachment 3225 [details]
CUPS 1.2.x test page, the test file used here

This file was used by the commands shown above. Should be already available in
all current Linux distros.
Comment 2 Till Kamppeter 2007-07-26 15:02:38 UTC
Also the simplified command line like in bug 689366

gs -sDEVICE=stcolor -r360x360 -dnoWeave -sDithering=gsmono
-sOutputCode=runlength -sOutputFile=x -c showpage

leads to a segfault on both 32-bit and 64-bit, already before the file x gets
created.
Comment 3 Ralph Giles 2007-07-31 09:53:24 UTC
I can reproduce with just debugobj/gs -sDithering=gsmono

backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x00000000006da61c in cmap_gray_halftoned (gray=32760, pdc=0x1097ef8, 
    pis=0x1096fd8, dev=0x1103718, select=gs_color_select_texture)
    at ./src/gxcmap.c:848
#2  0x00000000006d910a in gx_remap_DeviceGray (pc=<value optimized out>, 
    pcs=<value optimized out>, pdc=0x1097ef8, pis=0x1096fd8, dev=0x1103718, 
    select=gs_color_select_texture) at ./src/gxcmap.c:666
#3  0x00000000006daa89 in gx_remap_color (pgs=0x1096fd8) at ./src/gxcmap.c:538
#4  0x00000000006c6973 in gs_fillpage (pgs=0x1096fd8) at ./src/gspaint.c:78
#5  0x00000000004aa5a9 in zfillpage (i_ctx_p=<value optimized out>)
    at ./src/zpaint.c:48
#6  0x000000000047fcac in call_operator (op_proc=0x8e45c0 <cmap_few>, 
    i_ctx_p=0x1097ef8) at ./src/interp.c:105
Comment 4 Ralph Giles 2007-07-31 10:22:04 UTC
sorry, the minimal reproduction command line was

   debugobj/gs -sDEVICE=stcolor -sDithering=gsmono
Comment 5 Ray Johnston 2007-08-01 14:21:57 UTC
Fixed with rev 8161.