Bug 690304 - Seg fault while converting EPS to PNG on FreeBSD
Summary: Seg fault while converting EPS to PNG on FreeBSD
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 8.63
Hardware: PC FreeBSD
: P4 normal
Assignee: Default assignee
URL: http://www.arizonacoppersoft.com/
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-24 16:47 UTC by Glen Hein
Modified: 2009-02-26 09:59 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
lily-21d7120c.eps (8.29 KB, application/postscript)
2009-02-24 17:47 UTC, Ralph Giles
Details
CenturySchL-Roma.otf (72.07 KB, application/octet-stream)
2009-02-24 18:05 UTC, Glen Hein
Details
DejaVuSans.ttf (592.24 KB, application/octet-stream)
2009-02-24 20:10 UTC, Glen Hein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Glen Hein 2009-02-24 16:47:42 UTC
The input file lily-21d7120c.eps and the output file lily.png can be downloaded at:

http://www.arizonacoppersoft.com/images/lily.png
http://www.arizonacoppersoft.com/images/lily-21d7120c.eps

Using the command:

gs  -dEPSCrop -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dNOPAUSE -sDEVICE=png16m
-sOutputFile="/tmp/lily.png" -r202 "/tmp/lily-21d7120c.eps" -c quit

Ghostscript does create the output file, and the image does look correct.
However, I get a seg fault:

GPL Ghostscript 8.63 (2008-08-01)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Segmentation fault: 11 (core dumped)

I also ran gs in gdb and got this stack trace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x50d000 (LWP 100193)]
0x00000008007965ec in names_trace_finish () from /usr/X11R6/lib/libgs.so.8
(gdb) bt
#0  0x00000008007965ec in names_trace_finish () from /usr/X11R6/lib/libgs.so.8
#1  0x000000080079478e in gs_gc_reclaim () from /usr/X11R6/lib/libgs.so.8
#2  0x00000008007f41a4 in context_reclaim () from /usr/X11R6/lib/libgs.so.8
#3  0x00000008007716fd in ireclaim () from /usr/X11R6/lib/libgs.so.8
#4  0x000000080076d1b1 in interp_reclaim () from /usr/X11R6/lib/libgs.so.8
#5  0x0000000800765efe in gs_main_finit () from /usr/X11R6/lib/libgs.so.8
#6  0x0000000800768ca8 in gsapi_exit () from /usr/X11R6/lib/libgs.so.8
#7  0x0000000000400d14 in main ()

I'm running this on FreeBSD:

FreeBSD yes.thisisa.net 6.3-STABLE FreeBSD 6.3-STABLE #16: Sat Jul 19 10:31:04
BST 2008     root@yes.thisisa.net:/usr/obj/usr/src/sys/YES  amd64

Is this a problem with the input file or gs? BTW, the eps file was generated
from Lilypond 2.11.65 being built from the FreeBSD port print/lilypond. The seg
fault is occurring when building the lilypond port. It's happening in a later
stage of build, after lilypond itself is compiled, and documentation is being built.

Thanks,
Glen Hein
Comment 1 Ralph Giles 2009-02-24 17:45:58 UTC
We always treat segfaults as a bug, regardless of the validity of the input.

Note that the latest release is 8.64; you might see if you can reproduce with that.

Please attach your
/usr/ports/print/lilypond/work/lilypond-2.11.65/out/share/lilypond/current/fonts/otf/CenturySchL-Roma.otf
which the document references directly. I didn't succeed in finding it in the
lilypond or ports distributions.
Comment 2 Ralph Giles 2009-02-24 17:47:40 UTC
Created attachment 4809 [details]
lily-21d7120c.eps

Attach the given test file so we have a local copy.
Comment 3 Glen Hein 2009-02-24 18:05:56 UTC
Created attachment 4810 [details]
CenturySchL-Roma.otf
Comment 4 Ralph Giles 2009-02-24 19:42:06 UTC
Thanks for attaching the font.

I can't reproduce with trunk for the 8.64 release on x86_32 MacOS X, using the
attached CenturySchL-Roma.otf, DejaVuSans.ttf from the upstream
dejavu-fonts-ttf-2.28 and emmental-20.otf from the ubuntu lilypond-data-2.10.33
package (I finally found it!)

And editing the eps file to "provide" those three fonts from the local directory
instead of the installed locations.

However, I can't reproduce with the 8.63 release either, so it might be
something specific to your arch or build. Please confirm whether 8.64 fixes the
segfault for you. If so, please attach your versions of the other two fonts for
completeness.
Comment 5 Glen Hein 2009-02-24 20:01:36 UTC
I've been using a gs binary that was built from the freebsd ports. So, as a
test, I built 8.63 (before trying 8.64) separately and I cannot reproduce the
error. You are right, there must be some problem with the build. Thanks for
looking into it. 
Comment 6 Glen Hein 2009-02-24 20:10:32 UTC
Created attachment 4811 [details]
DejaVuSans.ttf