Bug 689315

Summary: Bugs fixed in ESP Ghostscript which can get regressions when distros switch to GPL Ghostscript
Product: Ghostscript Reporter: Till Kamppeter <till.kamppeter>
Component: GeneralAssignee: Default assignee <ghostpdl-bugs>
Status: NOTIFIED INVALID    
Severity: normal    
Priority: P4    
Version: master   
Hardware: All   
OS: All   
URL: http://www.cups.org/str.php
Customer: Word Size: ---
Bug Depends on: 689318, 689320, 689321, 689322, 689323, 689324, 689325, 689326, 689327, 689328, 689329, 689330, 689331, 689332, 689333, 689334    
Bug Blocks:    
Attachments: Running gs causes segfault on Linux/ppc
"pxlmono" (PCL 6/XL) driver prints CUPS test page with black background
ps2epsi fails when invoking sed
Output from pswrite cannot be printed to Epson PS printer
using full path in scripts like pdf2ps etc. ?
Function `malloc' implicitly converted to pointer
TTF glyphs outside encoding vector are expanded in outlines
"gv" does not work with the "gsx" of ESP GhostScript with shared libgs, ps2pdf does not work with the "gsx" of ESP GhostScript with shared libgs, "ltime" has no linkage, Error: ./src/zdevcal.c, ...
Adds error-check to pdfopt
bjc600's gs_closedevice breaks get_page_device and causes NumCopies to barf
Fixes of ampersand use in src/gdevps.c and src/scfd.c
ps2epsi: insecure temp files
Fix sed usage in ps2epsi
Fix handling of filenames containing spaces
Fix debug printf's so they have newlines
The pswrite device also needs the CRD stuff
Don't use AC_FUNC_MALLOC test, that causes the rpl_malloc
Embed C strings and not an array of character values, as the HP-UX C compiler can't handle such a large array without running out of memory
pdf2ps failed on a PDF with the following error : Warning: File has insufficient data for an image
Ubuntu patch to fix coredumps
Prevent pdf2ps generating "null setpagesize"
Duplex support in pstoraster is not working properly
Wrong page size with laserjet.ppd
dvipdf does not pass -R flag to dvips
Add CUPS fonts directory to default font path

Description Till Kamppeter 2007-07-02 09:11:47 UTC
In ESP Ghostscript many bugs got fixed, but probably these bugs and fixes never
got reported to upstream Ghostscript. So if distributions switch to the new
merged GPL Ghostscript several bugs will appear again.

This bug report is a list of such possible regressions and has all patches (from
ESP GS) attached.

Here are the bugs:

http://www.cups.org/str.php?L261 ps2epsi fails when invoking sed
http://www.cups.org/str.php?L1079 Running gs causes segfault on Linux/ppc
http://www.cups.org/str.php?L1080 "pxlmono" (PCL 6/XL) driver prints CUPS test
page with black background
http://www.cups.org/str.php?L1100 Output from pswrite cannot be printed to Epson
PS printer
http://www.cups.org/str.php?L1125 using full path in scripts like pdf2ps etc. ?
http://www.cups.org/str.php?L1235 Function `malloc' implicitly converted to pointer
http://www.cups.org/str.php?L1399 Adds error-check to pdfopt
http://www.cups.org/str.php?L1419 "gv" does not work with the "gsx" of ESP
GhostScript with shared libgs
http://www.cups.org/str.php?L1433 ps2pdf does not work with the "gsx" of ESP
GhostScript with shared libgs
http://www.cups.org/str.php?L1455 TTF glyphs outside encoding vector are
expanded in outlines
http://www.cups.org/str.php?L1539 "ltime" has no linkage
http://www.cups.org/str.php?L1549 Error: ./src/zdevcal.c, line 47: tm_year" is
not a member of "((struct tm ...)0)"
http://www.cups.org/str.php?L1570 Emacs ps-print files no longer work in gs
http://www.cups.org/str.php?L1577 bjc600's gs_closedevice breaks get_page_device
and causes NumCopies to barf
http://www.cups.org/str.php?L1630 ps2epsi: insecure temp files
http://www.cups.org/str.php?L1643 Fix sed usage in ps2epsi
http://www.cups.org/str.php?L1779 pdf2ps failed on a PDF with the following
error : Warning: File has insufficient data for an image
http://www.cups.org/str.php?L1635 Ubuntu patch to fix coredumps
http://www.cups.org/str.php?L1641 Prevent pdf2ps generating "null setpagesize"
http://www.cups.org/str.php?L1794 Wrong page size with laserjet.ppd
http://www.cups.org/str.php?L1987 Duplex support in pstoraster is not working
properly
http://www.cups.org/str.php?L2027 dvipdf does not pass -R flag to dvips

For these bugs there is no STR at cups.org:

Revision 146: Fixes of ampersand use in src/gdevps.c and src/scfd.c
Revision 154: Fix handling of filenames containing spaces
Revision 155: Fix debug printf's so they have newlines
Revision 156: The pswrite device also needs the CRD stuff
Revision 167: Don't use AC_FUNC_MALLOC test, that causes the rpl_malloc
Revision 172: Embed C strings and not an array of character values, as the HP-UX
C compiler can't handle such a large array without running out of memory
Revision 197: Add CUPS fonts directory to default font path

All these bugs are fixed in ESP Ghostscript 8.15.4 (patches from ESP GS
attached). I did not test whether they are also fixed in GPL Ghostsccript. So
please test and overtake fixes which are not yet done in GPL Ghostscript.
Comment 1 Till Kamppeter 2007-07-02 09:15:32 UTC
Created attachment 3105 [details]
Running gs causes segfault on Linux/ppc
Comment 2 Till Kamppeter 2007-07-02 09:16:33 UTC
Created attachment 3106 [details]
"pxlmono" (PCL 6/XL) driver prints CUPS test page with black background
Comment 3 Till Kamppeter 2007-07-02 09:17:05 UTC
Created attachment 3107 [details]
ps2epsi fails when invoking sed
Comment 4 Till Kamppeter 2007-07-02 09:17:39 UTC
Created attachment 3108 [details]
Output from pswrite cannot be printed to Epson PS printer
Comment 5 Till Kamppeter 2007-07-02 09:18:15 UTC
Created attachment 3109 [details]
using full path in scripts like pdf2ps etc. ?
Comment 6 Till Kamppeter 2007-07-02 09:18:57 UTC
Created attachment 3110 [details]
Function `malloc' implicitly converted to pointer
Comment 7 Till Kamppeter 2007-07-02 09:19:39 UTC
Created attachment 3111 [details]
TTF glyphs outside encoding vector are expanded in outlines
Comment 8 Till Kamppeter 2007-07-02 09:22:41 UTC
Created attachment 3112 [details]
"gv" does not work with the "gsx" of ESP GhostScript with shared libgs, ps2pdf does not work with the "gsx" of ESP GhostScript with shared libgs, "ltime" has no linkage, Error: ./src/zdevcal.c, ...
Comment 9 Till Kamppeter 2007-07-02 09:23:53 UTC
Created attachment 3113 [details]
Adds error-check to pdfopt
Comment 10 Till Kamppeter 2007-07-02 09:24:59 UTC
Created attachment 3114 [details]
bjc600's gs_closedevice breaks get_page_device and causes NumCopies to barf
Comment 11 Till Kamppeter 2007-07-02 09:26:03 UTC
Created attachment 3115 [details]
Fixes of ampersand use in src/gdevps.c and src/scfd.c
Comment 12 Till Kamppeter 2007-07-02 09:27:00 UTC
Created attachment 3116 [details]
ps2epsi: insecure temp files
Comment 13 Till Kamppeter 2007-07-02 09:27:46 UTC
Created attachment 3117 [details]
Fix sed usage in ps2epsi
Comment 14 Till Kamppeter 2007-07-02 09:28:21 UTC
Created attachment 3118 [details]
Fix handling of filenames containing spaces
Comment 15 Till Kamppeter 2007-07-02 09:29:02 UTC
Created attachment 3119 [details]
Fix debug printf's so they have newlines
Comment 16 Till Kamppeter 2007-07-02 09:29:32 UTC
Created attachment 3120 [details]
The pswrite device also needs the CRD stuff
Comment 17 Till Kamppeter 2007-07-02 09:30:13 UTC
Created attachment 3121 [details]
Don't use AC_FUNC_MALLOC test, that causes the rpl_malloc
Comment 18 Till Kamppeter 2007-07-02 09:31:07 UTC
Created attachment 3122 [details]
Embed C strings and not an array of character values, as the HP-UX C compiler can't handle such a large array without running out of memory
Comment 19 Till Kamppeter 2007-07-02 09:31:57 UTC
Created attachment 3123 [details]
pdf2ps failed on a PDF with the following error : Warning: File has insufficient data for an image
Comment 20 Till Kamppeter 2007-07-02 09:32:33 UTC
Created attachment 3124 [details]
Ubuntu patch to fix coredumps
Comment 21 Till Kamppeter 2007-07-02 09:33:30 UTC
Created attachment 3125 [details]
Prevent pdf2ps generating "null setpagesize"
Comment 22 Till Kamppeter 2007-07-02 09:34:10 UTC
Created attachment 3126 [details]
Duplex support in pstoraster is not working properly
Comment 23 Till Kamppeter 2007-07-02 09:35:27 UTC
Created attachment 3127 [details]
Wrong page size with laserjet.ppd
Comment 24 Till Kamppeter 2007-07-02 09:35:57 UTC
Created attachment 3128 [details]
dvipdf does not pass -R flag to dvips
Comment 25 Till Kamppeter 2007-07-02 09:36:32 UTC
Created attachment 3129 [details]
Add CUPS fonts directory to default font path
Comment 26 Till Kamppeter 2007-07-02 10:23:03 UTC
Some test results:

http://www.cups.org/str.php?L261 ps2epsi fails when invoking sed -> FIXED
http://www.cups.org/str.php?L1079 Running gs causes segfault on Linux/ppc -> FIXED
http://www.cups.org/str.php?L1080 "pxlmono" (PCL 6/XL) driver prints CUPS test
page with black background -> FIXED

http://www.cups.org/str.php?L1100 Output from pswrite cannot be printed to Epson
PS printer -> STILL PRESENT

Do

cat /usr/share/cups/data/testprint.ps | gs -q -dBATCH -dPARANOIDSAFER -dQUIET
-dNOPAUSE -sDEVICE=pswrite -sOutputFile=x.ps -

and x.ps will contain "end readonly def".

http://www.cups.org/str.php?L1125 using full path in scripts like pdf2ps etc. ?
-> STILL PRESENT
Comment 27 Alex Cherepanov 2007-07-02 13:52:19 UTC
Let's mark the patches that has been applied to the HEAD or not needed for some
other reason as "obsolete".
Comment 28 Till Kamppeter 2007-07-02 14:24:25 UTC
http://www.cups.org/str.php?L1235 Function `malloc' implicitly converted to
pointer -> STILL PRESENT

There is still no "#include <stdlib.h>" in src/fapi_ft.c.

http://www.cups.org/str.php?L1433 ps2pdf does not work with the "gsx" of ESP
GhostScript with shared libgs -> STILL PRESENT

http://www.cups.org/str.php?L1419 "gv" does not work with the "gsx" of ESP
GhostScript with shared libgs -> FIXED

gv works with gsx.

http://www.cups.org/str.php?L1433 ps2pdf does not work with the "gsx" of ESP
GhostScript with shared libgs -> FIXED

test.pdf is the same for both gsc and gsx.

http://www.cups.org/str.php?L1455 TTF glyphs outside encoding vector are
expanded in outlines -> FIXED

Bug #688017
Comment 29 Till Kamppeter 2007-07-02 14:47:58 UTC
http://www.cups.org/str.php?L1539 "ltime" has no linkage -> FIXED

http://www.cups.org/str.php?L1549 Error: ./src/zdevcal.c, line 47: tm_year" is
not a member of "((struct tm ...)0)" -> FIXED

http://www.cups.org/str.php?L1570 Emacs ps-print files no longer work in gs ->
STILL PRESENT (ManualFeed patch from attachment #3112 [details] not applied)

http://www.cups.org/str.php?L1577 bjc600's gs_closedevice breaks get_page_device
and causes NumCopies to barf -> STILL PRESENT

http://www.cups.org/str.php?L1630 ps2epsi: insecure temp files -> STILL PRESENT

If mktemp is not available everywhere check if it is available and use it if so.
Comment 30 Alex Cherepanov 2007-07-02 15:18:13 UTC
Comment on attachment 3125 [details]
Prevent pdf2ps generating "null setpagesize"

The attachment #3125 [details] should not be committed. There's nothing wrong with "null
setpagesize". setpagesize is a procedure than can take care of its arguments.
The patch effectively disables all custom page sizes.
Comment 31 Alex Cherepanov 2007-07-03 05:14:20 UTC
Comment on attachment 3115 [details]
Fixes of ampersand use in src/gdevps.c and src/scfd.c

Committed as a rev. 8096
Comment 32 Till Kamppeter 2007-07-03 05:51:51 UTC
http://www.cups.org/str.php?L1643 Fix sed usage in ps2epsi -> STILL PRESENT
http://www.cups.org/str.php?L1779 pdf2ps failed on a PDF with the following
error : Warning: File has insufficient data for an image -> STILL PRESENT
http://www.cups.org/str.php?L1635 Ubuntu patch to fix coredumps -> STILL PRESENT
http://www.cups.org/str.php?L1641 Prevent pdf2ps generating "null setpagesize"
-> NOT A BUG
http://www.cups.org/str.php?L1794 Wrong page size with laserjet.ppd -> STILL PRESENT
Comment 33 Ray Johnston 2007-07-03 10:25:34 UTC
Please open individual bug reports for problems that are remaining.
Comment 34 Alex Cherepanov 2007-07-03 11:22:30 UTC
Comment on attachment 3108 [details]
Output from pswrite cannot be printed to Epson PS printer

The patch is committed as a rev. 8097.
Comment 35 Till Kamppeter 2007-07-04 10:11:45 UTC
For all remaining issues separate bug reports are posted now.