Closed michaelrsweet closed 19 years ago
CUPS.org User: mike
OK, none of the changes to write messages to stderr should have this effect, since the "-sOutputFile=-" will send the output to the real stdout, just like with the CUPS device...
I don't have the EPL IJS server installed, and I don't have time to do so, however if you can come up with a traceback via gdb, we might have a chance of tracking the problem down...
CUPS.org User: till.kamppeter
Works perfectly with GPL GhostScript 8.16 (from CVS).
CUPS.org User: till.kamppeter
Here is the gdb output of the current ESP GhostScript (subversion rev 46):
root@localhost g]# cat /usr/share/cups/data/testprint.ps | gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sDEVICE=ijs -sIjsServer=ijs_server_epsonepl -dIjsUseOutputFD -sDeviceManufacturer=Epson -sDeviceModel=EPL6100L -sIjsParams="EplFlowControl=off,EplDpi=600,EplDensity=3,EplRitech=on,EplTonerSave=off," -sOutputFile=- - > testfile ESP Ghostscript 815.00 (2005-02-08) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. getting page header ijs_server_get_page_header failed: -2 Segmentation fault (core dumped) [root@localhost g]# [root@localhost g]# gdb -c core.27111 /usr/bin/gs-common GNU gdb 6.3-3mdk (Mandrakelinux) 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 "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
warning: core file may not match specified executable file. Core was generated by `gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -'. Program terminated with signal 11, Segmentation fault.
warning: current_sos: Can't read pathname for load map: Input/output error
Reading symbols from /usr/lib/libz.so.1...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /usr/lib/libcupsimage.so.2...done. Loaded symbols for /usr/lib/libcupsimage.so.2 Reading symbols from /usr/lib/libtiff.so.3...done. Loaded symbols for /usr/lib/libtiff.so.3 Reading symbols from /usr/lib/libjpeg.so.62...done. Loaded symbols for /usr/lib/libjpeg.so.62 Reading symbols from /usr/lib/libpng.so.3...done. Loaded symbols for /usr/lib/libpng.so.3 Reading symbols from /lib/tls/libm.so.6...done. Loaded symbols for /lib/tls/libm.so.6 Reading symbols from /usr/lib/libcups.so.2...done. Loaded symbols for /usr/lib/libcups.so.2 Reading symbols from /usr/lib/libssl.so.0.9.7...done. Loaded symbols for /usr/lib/libssl.so.0.9.7 Reading symbols from /usr/lib/libcrypto.so.0.9.7...done. Loaded symbols for /usr/lib/libcrypto.so.0.9.7 Reading symbols from /lib/libnsl.so.1...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /usr/lib/libstdc++.so.6...done. Loaded symbols for /usr/lib/libstdc++.so.6 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libgcc_s.so.1...done. Loaded symbols for /lib/libgcc_s.so.1 Reading symbols from /usr/lib/ghostscript/8.15/X11.so...done. Loaded symbols for /usr/lib/ghostscript/8.15/X11.so Reading symbols from /usr/X11R6/lib/libXt.so.6...done. Loaded symbols for /usr/X11R6/lib/libXt.so.6 Reading symbols from /usr/X11R6/lib/libSM.so.6...done. Loaded symbols for /usr/X11R6/lib/libSM.so.6 Reading symbols from /usr/X11R6/lib/libICE.so.6...done. Loaded symbols for /usr/X11R6/lib/libICE.so.6 Reading symbols from /usr/X11R6/lib/libXext.so.6...done. Loaded symbols for /usr/X11R6/lib/libXext.so.6 Reading symbols from /usr/X11R6/lib/libX11.so.6...done. Loaded symbols for /usr/X11R6/lib/libX11.so.6
h=6600, color=1) at ./src/gdevijs.c:179
179 ./src/gdevijs.c: No such file or directory. in ./src/gdevijs.c (gdb) backtrace
h=6600, color=1) at ./src/gdevijs.c:179
w=5100, h=6600, dev=0x867e904, lop=252, source=0x0) at ./src/gxdcolor.c:387
perror_object=0xbfffea60) at ./src/interp.c:1492
user_errors=1, pexit_code=0xbfffea68, perror_object=0xbfffea60)
at ./src/interp.c:487
user_errors=1, pexit_code=0xbfffea68, perror_object=0xbfffea60)
at ./src/interp.c:445
user_errors=1, pexit_code=0xbfffea68, perror_object=0xbfffea60)
at ./src/imain.c:297
perror_object=0xbfffea60) at ./src/imain.c:531
arg=0xbffffa7f "LESSKEY=/etc/.less", pal=0xbfffee10)
at ./src/imainarg.c:279
---Type
(gdb) quit
CUPS.org User: mike
ESP Ghostscript has a much different IJS driver than GPL Ghostscript CVS; the ESPGS driver has KRGB support while the CVS one does not.
Can you try the current Subversion code - I just imported a lot of bug fixes from there, but I didn't touch the IJS driver due to the number of differences...
CUPS.org User: till.kamppeter
The segfault still persists. Here is a new gdb backtrace:
[root@localhost g]# cat /usr/share/cups/data/testprint.ps | gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sDEVICE=ijs -sIjsServer=ijs_server_epsonepl -dIjsUseOutputFD -sDeviceManufacturer=Epson -sDeviceModel=EPL6100L -sIjsParams="EplFlowControl=off,EplDpi=600,EplDensity=3,EplRitech=on,EplTonerSave=off," -sOutputFile=- - > testfile ESP Ghostscript 815.00 (2005-02-08) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. getting page header Segmentation fault (core dumped) ijs_server_get_page_header failed: -2 [root@localhost g]# [root@localhost g]# gdb -c core.15522 /usr/bin/gs-common GNU gdb 6.3-3mdk (Mandrakelinux) 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 "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
warning: core file may not match specified executable file. Core was generated by `gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -'. Program terminated with signal 11, Segmentation fault.
warning: current_sos: Can't read pathname for load map: Input/output error
Reading symbols from /usr/lib/libz.so.1...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /usr/lib/libcupsimage.so.2...done. Loaded symbols for /usr/lib/libcupsimage.so.2 Reading symbols from /usr/lib/libtiff.so.3...done. Loaded symbols for /usr/lib/libtiff.so.3 Reading symbols from /usr/lib/libjpeg.so.62...done. Loaded symbols for /usr/lib/libjpeg.so.62 Reading symbols from /usr/lib/libpng.so.3...done. Loaded symbols for /usr/lib/libpng.so.3 Reading symbols from /lib/tls/libm.so.6...done. Loaded symbols for /lib/tls/libm.so.6 Reading symbols from /usr/lib/libcups.so.2...done. Loaded symbols for /usr/lib/libcups.so.2 Reading symbols from /usr/lib/libssl.so.0.9.7...done. Loaded symbols for /usr/lib/libssl.so.0.9.7 Reading symbols from /usr/lib/libcrypto.so.0.9.7...done. Loaded symbols for /usr/lib/libcrypto.so.0.9.7 Reading symbols from /lib/libnsl.so.1...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /usr/lib/libstdc++.so.6...done. Loaded symbols for /usr/lib/libstdc++.so.6 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libgcc_s.so.1...done. Loaded symbols for /lib/libgcc_s.so.1 Reading symbols from /usr/lib/ghostscript/8.15/X11.so...done. Loaded symbols for /usr/lib/ghostscript/8.15/X11.so Reading symbols from /usr/X11R6/lib/libXt.so.6...done. Loaded symbols for /usr/X11R6/lib/libXt.so.6 Reading symbols from /usr/X11R6/lib/libSM.so.6...done. Loaded symbols for /usr/X11R6/lib/libSM.so.6 Reading symbols from /usr/X11R6/lib/libICE.so.6...done. Loaded symbols for /usr/X11R6/lib/libICE.so.6 Reading symbols from /usr/X11R6/lib/libXext.so.6...done. Loaded symbols for /usr/X11R6/lib/libXext.so.6 Reading symbols from /usr/X11R6/lib/libX11.so.6...done. Loaded symbols for /usr/X11R6/lib/libX11.so.6
h=6600, color=1) at ./src/gdevijs.c:179
179 ./src/gdevijs.c: No such file or directory. in ./src/gdevijs.c (gdb) backtrace
h=6600, color=1) at ./src/gdevijs.c:179
w=5100, h=6600, dev=0x8681904, lop=252, source=0x0) at ./src/gxdcolor.c:387
perror_object=0xbfffea30) at ./src/interp.c:1492
user_errors=1, pexit_code=0xbfffea38, perror_object=0xbfffea30)
at ./src/interp.c:487
user_errors=1, pexit_code=0xbfffea38, perror_object=0xbfffea30)
at ./src/interp.c:445
user_errors=1, pexit_code=0xbfffea38, perror_object=0xbfffea30)
at ./src/imain.c:297
perror_object=0xbfffea30) at ./src/imain.c:531
arg=0xbffffa54 "LESSKEY=/etc/.less", pal=0xbfffede0)
at ./src/imainarg.c:279
---Type
(gdb) quit
CUPS.org User: till.kamppeter
Works perfectly when one replaces src/gdevijs.c by the file from GPL GhostScript. Problem is that one would ditch HP's KRGB support which means printout quality loss and uneconomic behaviour for most well-spread HP inkjets, but one gets the Epson EPL-xxxxL series working.
So a real fix is needed, both HP and Epson users should be served.
CUPS.org User: till.kamppeter
Reported problem to David Suffield and Cory Meisch from HP, as they have written the KRGB patch.
CUPS.org User: till.kamppeter
Here is Dave Suffields answer to the problem:
Hi Till,
Given the following test case. KRGB mode should never be enabled for monochrome. KRGB mode will only work for RGB.
cat /usr/share/cups/data/testprint.ps | gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sDEVICE=ijs -sIjsServer=ijs_server_epsonepl -dIjsUseOutputFD -sDeviceManufacturer=Epson -sDeviceModel=EPL6100L -sIjsParams="EplFlowControl=off,EplDpi=600,EplDensity=3,EplRitech=on,Epl TonerSav e=off," -sOutputFile=- - > testfile
The gsijs_set_krgb_mode() must not be working. This function does two checks; RGB mode and ijs server KRGB support, before it enables krgb_mode.
Your traceback looks like it sigfaults in gsijs_fill_rectangle, but gsijs_fill_rectangle should never get called for this test case.
The KRGB patch worked find in gpl gs 7.07, but I personally have never checked the patch on gpl gs 8.01. I will try looking at the patch in gs 8.01.
-dave
-----Original Message----- From: Till Kamppeter [mailto:till.kamppeter@gmx.net] Sent: Wednesday, February 16, 2005 3:12 PM To: Meisch, Cory; Suffield, David Subject: KRGB support breaks IJS device of GhostScript 8.15
Oi,
I am working with Mike Sweet on ESP GhostScript 8.15. We have applied your KRGB support patch from GhostScript 7.x times there. But this patch causes a problem with other IJS drivers. See this bug report:
http://www.cups.org/espgs/str.php?L1077+P0+S-2+C0+I0+E0+Q
Especially note that removing the KRGB support would fix this bug. Can you have a look at this? Would be very great if I could include a fix in
Mandrakelinux 10.2 (release of Community Edition by the end of this month). Would be even more important than having parallel port support in HPLIP.
Thank you very much in advance.
Till
CUPS.org User: till.kamppeter
Here a comment from Hin-Tak Leung:
Hi Till,
That's interesting. The segfault problem with some version of ghostscript 7.0x has only ever been reported from Debian users; and our general recommendation used to be ungrade to AFPL 8.00/8.14 with our patch of the "black-page" problem (the fix for the "black-page" problem was integrated into GNU gs 8.15 or AFPL gs 8.50 onwards). I was thinking of building every version of ghostscript, ESP/GNU versions between 7.x and 8.x I can get hold of to isolate the problem. (I myself uses AFPL ghostscript against the printer most of the time so that's eliminated).
If you haven't really taken any notice about the issues surrounding the "black-page" problem with 8.00/8.14, it was for a very similiar issue to what you seems to have discovered with the KRGB patch. Basically around gs 7.22, some change was made in src/gdevijs.c (same file) to expand the data structure to accommodate the upcoming new feature for color separations with DeviceN, and overlooked the fact that there is an ijs-based driver (the epsonepl driver) which uses only one color (black), rather than 3 or 4 like gimpprint or hpijs. The one-line fix was to fill in the extra-expanded details to honour how many color the switches "-sProcessColorModel=DeviceGray -dBitsPerSample=1" actually says, rather than just blindly assume the ijs driver drives a multi-color device - that's why the page comes out black for unpatched 8.00/8.14 - it is 0 for white and 1 for black for b/w, but the opposite, 0,0,0 for black and 11111111,11111111,11111111 for whites for 24-bit color - something like that, I think, if you get the color model wrong; the clue/patch was discovered when I printed something with some blue texts among black texts with unpatched 8.00 and only the blue text was visible as grays among blacks.
Regards, Hin-Tak
Till Kamppeter wrote:
I have done further investigation on the problem of ESP GhostScript 8.15 crashing. See here:
http://qa.mandrakesoft.com/show_bug.cgi?id=12371 http://www.cups.org/espgs/str.php?L1077
The second link contains gdb backtraces.
What I have found out is that the problem appeared when HP's patch for KRGB was added to ESP GhostScript 8.15 (it was not added to GPL and AFPL GhostScript). I removed the patch in ESP GhostScript and it worked again.
So I contacted Dave Suffield from HP who has created the patch. See his answer below.
Till
Suffield, David wrote:
Hi Till,
Given the following test case. KRGB mode should never be enabled for monochrome. KRGB mode will only work for RGB.
cat /usr/share/cups/data/testprint.ps | gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sDEVICE=ijs -sIjsServer=ijs_server_epsonepl -dIjsUseOutputFD -sDeviceManufacturer=Epson -sDeviceModel=EPL6100L -sIjsParams="EplFlowControl=off,EplDpi=600,EplDensity=3,EplRitech=on,Epl TonerSav e=off," -sOutputFile=- - > testfile
The gsijs_set_krgb_mode() must not be working. This function does two checks; RGB mode and ijs server KRGB support, before it enables krgb_mode. Your traceback looks like it sigfaults in gsijs_fill_rectangle, but gsijs_fill_rectangle should never get called for this test case. The KRGB patch worked find in gpl gs 7.07, but I personally have never checked the patch on gpl gs 8.01. I will try looking at the patch in gs 8.01.
-dave
-----Original Message----- From: Till Kamppeter [mailto:till.kamppeter@gmx.net] Sent: Wednesday, February 16, 2005 3:12 PM To: Meisch, Cory; Suffield, David Subject: KRGB support breaks IJS device of GhostScript 8.15
Oi,
I am working with Mike Sweet on ESP GhostScript 8.15. We have applied your KRGB support patch from GhostScript 7.x times there. But this patch causes a problem with other IJS drivers. See this bug report:
http://www.cups.org/espgs/str.php?L1077+P0+S-2+C0+I0+E0+Q
Especially note that removing the KRGB support would fix this bug. Can you have a look at this? Would be very great if I could include a fix in
Mandrakelinux 10.2 (release of Community Edition by the end of this month). Would be even more important than having parallel port support in HPLIP.
Thank you very much in advance.
Till
CUPS.org User: mike
Fixed in Subversion repository. See attached patch...
CUPS.org User: till.kamppeter
I have tested it and works for me now. I have updated the GhostScript package for Mandrakelinux now.
CUPS.org User: mike
Great!
"str1077.patch":
--- gdevijs.c (revision 50) +++ gdevijs.c (working copy) @@ -34,6 +34,10 @@
@@ -221,11 +225,12 @@
private int gsijs_copy_mono(gx_device * dev, const byte * data, int dx, int draster, gx_bitmap_id id,
int i, h=height;
if (h <= 0 || w <= 0) return 0;
while (h-- > 0)
}
}
return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one); }
/* ---------------- High-level graphic procedures ---------------- / @@ -346,8 +369,9 @@ const gx_render_plane_t render_plane, gs_memory_t mem, bool for_band) { gx_device_ijs ijsdev = (gx_device_ijs *)target;
if (code < 0 || n_chan != 3) return code;
/* Save buffer (vector) procedures so that we can hook them during banding playback. */
Version: 8.15rc1 CUPS.org User: till.kamppeter
If I use the IJS server "ijs_server_epsonepl" for the Epson EPL L series (http://sourceforge.net/projects/epsonepl/) I get
cat /usr/share/cups/data/testprint.ps | gs -dBATCH -dSAFER -dNOPAUSE -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sDEVICE=ijs -sIjsServer=ijs_server_epsonepl -dIjsUseOutputFD -sDeviceManufacturer=Epson -sDeviceModel=EPL6100L -sIjsParams="EplFlowControl=off,EplDpi=600,EplDensity=3,EplRitech=on,EplTonerSave=off," -sOutputFile=- - > testfilegetting page header
ijs_server_get_page_header failed: -2 Segmentation fault (core dumped)
ls -l testfile
-rw-r--r-- 1 root root 174 Feb 10 20:14 testfile
I have asked already on the epsonepl developer mailing list. Hin-Tak Leung, the project leader, answered:
Hmm, in this case, I wonder if it is due to some of ESP ghostscript's
changes to do with stderr. GPL ghostscript 8.15 does work with epson epl.
So it seems to be in some ESP-GhostScript-specific stuff.