Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#14426 - [ghostscript] and libpng issue

Attached to Project: Arch Linux
Opened by Christian Himpel (chressie) - Wednesday, 22 April 2009, 10:56 GMT
Last edited by Andreas Radke (AndyRTR) - Monday, 07 September 2009, 12:05 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Since ghostscript comes with its own version of libpng, this can cause an issue (segfault/corrupted memory) when linking a program against libgs and libpng.

Additional info:
* ghostscript 8.64-5

Steps to reproduce:
* Copy simple_dialog.c and Makefile to a directory
* Compile with make
* See how ./simple_dialog-crash crashes and ./simple_dialog-normal works without crashing
(Unfortunately this example depends on GTK+, but that was the easiest way to show the issue since gtk_file_chooser_dialog_new() tries to open some png files)

Solution:
Before compiling ghostscript remove the ghostscript local libpng version (see PKGBUILD.patch), so ghostscript will compile against the installed libpng (which is anyway a dependency of cairo, which in turn is a dependency of ghostscript).
Closed by  Andreas Radke (AndyRTR)
Monday, 07 September 2009, 12:05 GMT
Reason for closing:  Implemented
Comment by Jan de Groot (JGC) - Wednesday, 22 April 2009, 18:18 GMT
This is not only better for programs that link to both libpng and libgs, but it's also a good improvement to the security of this package.
Comment by Christian Himpel (chressie) - Thursday, 23 April 2009, 05:20 GMT
I posted that issue also to the ghostscript mailinglist (see http://ghostscript.com/pipermail/gs-devel/2009-April/008339.html) to see if this (local vs. global libpng) is the intended behavior. We'll see what happens.
Comment by Jan de Groot (JGC) - Thursday, 23 April 2009, 09:56 GMT
Not only libpng is an issue:
- zlib
- libjpeg
- libpng
- jbig2dec
- jasper

note that the configure.ac script talks about a patch to libjpeg that should be applied. Don't know if it's included by the upstream version, as libjpeg hasn't had any maintenance for years now.
Comment by Andreas Radke (AndyRTR) - Monday, 10 August 2009, 20:40 GMT
hm. I like the idea to use system libs.Fedora does it similar: rm -rf libpng zlib jpeg jasper

But this is not the way upstream does it and we would come in conflict with our packaging policy. Is anything broken with our gs 8.70 version we packaged the default way using internal libs?

Comment by Jan de Groot (JGC) - Monday, 10 August 2009, 21:55 GMT
Linking private libs is bad. Whenever possible, we should link against system libs. We don't use private libs for mozilla and openoffice either.
Comment by Andreas Radke (AndyRTR) - Friday, 04 September 2009, 22:11 GMT
there's a new 8.70-2 ghostscript in testing mostly linked against system libs. any issues left?

Loading...