This a call for help with the above bug which occurs during a lilypond build frequently if the variable "GS_LIB=/home/davepl/.fonts" is unset and occasionally if the above variable is set. The file sets to reproduce the bug are attached to the novell bug as I can't see a way to attach anything here. The command :- gs -dNOSAFER -dEPSCrop -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 -sDEVICE=pdfwrite -sOutputFile="./4e/lily-7d242e8d-1.pdf" -c .setpdfwrite -f "./4e/lily-7d242e8d-1.eps" gives the result :- GPL Ghostscript 8.64 (2009-02-03) Copyright (C) 2009 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file COPYING for details. Can't handle format 12 Segmentation fault
Created attachment 5876 [details] All files to reproduce the segfault
Created attachment 5877 [details] Same files but from a successful build These files result from a build of lilypond docs with the variable : GS_LIB=/home/davepl/.fonts set.
Difficult to tell what's going on, because the single file in the bzip archive has no extension, turns out to be a tarball (a .tar would have helped here). There's > 4.5Mb of log file which is kind of difficult to parse through and well nigh meaningless to me for most of it. I'm going to assume that the error (seg fault) noted in the original submission is the problem. The error also reads 'Cant' handle format 12', this is a warning from the Ghostscript TrueType interpreter that it is unable to understand format 12 CMAP subtables. Looking inside the relevant EPS file (lily-7d242e8d-1.eps) I see that it seems to use several fonts: /fonts/otf/CenturySchL-Roma.otf /usr/share/fonts/truetype/DroidSansFallback.ttf /fonts/otf/emmentaler-20.otf However none of these fonts are supplied, so I can't be sure which of these is the issue, nor even if this *is* an issue for certain. If the original reporter would like to post the fonts as well, I can determine which font is causing the issue and see why this is causing a segmentation fault for pdfwrite. Actually supporting format 12 CMAP subtables is (probably) a much longer term project, probably an enhancement.
The files in the attached tar.bz2 in directory 4e are the files lilypond attempts conversion on. Hopefully they aren't corrupted on your side, I've just extracted them to test 8.70 which I have packaged the same as the existing 8.64 Using the packaged openSUSE gs-8.70 and have just attempted the same command from cli :- gs -dNOSAFER -dEPSCrop -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 -sDEVICE=pdfwrite -sOutputFile="./4e/lily-7d242e8d-1.pdf" -c .setpdfwrite -f "./4e/lily-7d242e8d-1.eps" And it succeeded with the output :- GPL Ghostscript 8.70 (2009-07-31) Copyright (C) 2009 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file COPYING for details. GPL Ghostscript 8.70: Error: Font Renderer Plugin ( FreeType ) return code = -1 Can't render Font ArialMT with FAPI, will do with native GS renderer. Can't handle format 12 GPL Ghostscript 8.70: Error: Font Renderer Plugin ( FreeType ) return code = -1 Can't render Font DroidSansFallback with FAPI, will do with native GS renderer. I'm maintainer of lilypond for openSUSE which is my interest in this problem and unfortunately not very familiar with the workings of ghostscript. From the output with gs-8.70 I assume that gs can handle the missing fonts better. What puzzles me is why the variable "GS_LIB=/home/davepl/.fonts" allows lilypond to execute the above command without a problem. This happens with gs-8.70 and 8.64. There is a possible license conflict with gs-8.70 which has delayed the update for the distro but I will find out next week if it really is a problem. I'm not a novell employee only an openSUSE community member. I'll dig into the lilypond build and see if I can find the fonts. If you search the log for the exact command used above you will find the failure.
Re fonts :- /fonts/otf/CenturySchL-Roma.otf Belongs to lilypond /fonts/otf/emmentaler-20.otf Belongs to lilypond /usr/share/fonts/truetype/DroidSansFallback.ttf Found in a separate package called droid-fonts which I've now added as a build requirement for lilypond. If it's of any help I can tar.bz2 them and attach them to this bug. You have already explained half of the problem and if you can explain why the environment variable makes such a difference, it would be very much appreciated.
Created attachment 5878 [details] droid fonts
Created attachment 5879 [details] lilypond fonts
Note that there have been many segfaults fixed since 8.64 so please re-test with the HEAD version (or wait a couple of weeks until we have a release candidate or our release at the beginning of Feb.)
Created attachment 5927 [details] otstoy.tar.bz2 -- self-contained sample Please try the attached sample. Decompress the archive to to a current directory and run: gs -dNOSAFER -dEPSCrop -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 -sDEVICE=pdfwrite -sOutputFile=fail.pdf -c .setpdfwrite -f fail.eps I tried this on several hosts and several versions of Ghostscript but was unable to reproduce SEGV. Perhaps, it's related to FAPI, which I don't use. There will be some FAPI improvements in the upcoming release.
Command fails :- > gs -dNOSAFER -dEPSCrop -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 -sDEVICE=pdfwrite -sOutputFile=fail.pdf -c .setpdfwrite -f fail.eps GPL Ghostscript 8.70 (2009-07-31) Copyright (C) 2009 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file COPYING for details. Can't handle format 12 Decompressed the attachment into a new directory and executed the command.
Can you be a little more explicit ? When you say 'command fails' what exactly do you mean ? Do you still get a segmentation fault, or do you get some other problem? The 'Can't handle format 12' message is not a problem, the file still converts to PDF even with that warning. You hadn't mentioned that you were building Ghostscript to use the FreeType font rendering engine, this changes things quite markedly and invalidates the tests I ran because I wasn't using the FreeType interface. As Alex has mentioned the next release will contain some extensive improvements to the FreeType interface. You can see some of the changes in bug report #690448 which is being used to track the progress of the FreeType interface. There have already been a significant number of fixes, especially relating to segmentation faults and errors. I would suggest that you try the latest HEAD revision of the GS source, or wait until the next scheduled release which is only a week or so away.
There wasn't a segfault but the lilypond build still fails about 10% of the time after which a rebuild succeeds. I'll build a head version for lilypond to build against, which should be easy as long as there aren't too many changes and report back. I have lilypond building against both gs-8.64 and 8.70 ATM and it rebuilds every time openSUSE Factory changes, about once a week on average. Just to prevent any future confusion, this is the configure setup for the main build :- ./configure --build=%{buildsys} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --mandir=%{_mandir} \ --datadir=%{_datadir} \ --infodir=%{_infodir} \ --libdir=%{_libdir} \ --with-fontpath=%{fonts} \ --with-ijs \ --with-omni \ --with-jbig2dec \ --with-jasper \ --enable-dynamic \ --enable-cups \ --enable-shared \ --with-driversfile=%{S:41} \ --disable-gtk \ --disable-compile-inits \ --with-gnu-ld
With ghostscript 9.00 the result is not a crash, nevertheless it does not work:/usr/src/packages/BUILD/lilypond-2.12.3/out/lybook-db> gs -dEPSCrop -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dNOPAUSE -sDEVICE=png16m -sOutputFile="./d6/lily-50e2bfee.png" -r202 "./d6/lily-50e2bfee.eps" -c quit GPL Ghostscript 9.00 (2010-09-14) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file COPYING for details. Can't handle format 12 Error: /typecheck in --@0xb6b6f260-- Operand stack: 1.951 0.0 0.0 uni306B 1.951 0.0 0.0 uni306F 1.951 0.0 0.0 uni308D 1.951 77.7211 -24.8756 --dict:15/17(ro)(L)-- uni3044 uni3044 --nostringval-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop --nostringval-- 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 3 --nostringval-- %repeat_continue --nostringval-- %finish_show --nostringval-- --nostringval-- 6 3 15 --nostringval-- (gs_show_enum) %op_show_continue Dictionary stack: --dict:1177/3371(ro)(G)-- --dict:0/20(G)-- --dict:121/200(L)-- Current allocation mode is local Last OS error: 2 Current file position is 18904 GPL Ghostscript 9.00: Unrecoverable error, exit code 1
This piece of code /DroidSansFallback 3.61523438 output-scale div selectfont 1.9510 0.0000 0.0000 /uni306B 1.9510 0.0000 0.0000 /uni306F 1.9510 0.0000 0.0000 /uni308D 1.9510 0.0000 0.0000 /uni3044 4 print_glyphs 74.9001 -21.3256 moveto cause this break.
I cannot reproduce this problem. I've tested gs v. 8.71, 9.00, and the current development version. Lilypond 2.12.3 can be built with either version of Ghostscript. Feel free to reopen this bug of file a new one if there are still any problems with Ghostscript.
No gs problems for quite a while now, guile has taken gs's place.
I totally don't understand Dave's comment "guile has taken gs's place." Unless I'm missing something guile (GNU Ubiquitous Intelligent Language for Extensions) -- a library designed to help programmers create flexible applications -- is totally orthogonal to gs. gs is a specific application that does PCL, XPS, PDF, and PS conversion to printer formats, image formats, or PS, PDF, PCL, etc. -- how does guile replace that ?
(In reply to comment #17) > I totally don't understand Dave's comment "guile has taken gs's place." > > Unless I'm missing something guile (GNU Ubiquitous Intelligent Language for > Extensions) -- a library designed to help programmers create flexible > applications -- is totally orthogonal to gs. > > gs is a specific application that does PCL, XPS, PDF, and PS conversion to > printer formats, image formats, or PS, PDF, PCL, etc. -- how does guile > replace that ? I apologise for my familiar manner I was in the middle of getting lilypond to build with a 1.8 guile package as it can't use guile 2.x. Ghostscript 9 no longer segfaults at all, it may very rarely fail during the lilypond build if two or more simultaneous instances of gs are used but if only one instance is allowed, the build succeeds every time. This has been the case for quite a while.
AFAIR the gs failure was also aggravated by droid fonts which I removed from my lilypond documentation build and is also no longer recommended by lilypond. If this is of interest.