Created attachment 7910 [details] /home/till/CityMap-evince-pdftopdf.pdf Original Ubuntu bug reports: https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/842411 https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/842435 https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/853918 The bugs contain all symbolic stack traces, but the users did not attach their input files. So I tried to reproduce it by myself and got https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/856766 The Ubuntu bug tracking system will add a stack trace here, too. The command line to reproduce it is cat ~/ghostscript/testfiles/CityMap-evince-pdftopdf.pdf | /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -sMediaType=Plain -sOutputType=0 -r300x600 -dMediaPosition=7 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=17 -dcupsInteger0=2 -scupsPageSizeName=Letter -I/usr/share/cups/fonts -c -f -_ > out.raster The output is INFO: Start rendering... INFO: Processing page 1... sfopen: gs_parse_file_name failed. sfopen: gs_parse_file_name failed. ./base/gsicc_manage.c:866: gsicc_open_search(): Could not find ps_gray.icc | ./base/gsicc_manage.c:198: gsicc_initialize_iccsmask(): failed to load gray smask profile Segmentation fault (core dumped) The input file is also attached here.
The retracer of Launchpad considered my bug report https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/856766 as the same as https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/842435 so have especially a look into the stack trace there.
This works for me for v. 9.04 and current development version with the default build.
Ales, can you boot a live CD of Ubuntu Oneiric beta2 and check there? The patches we are using are all backports from the Ghostscript repo, but perhaps some of them need additional backports.
The crash is because we are ignoring the error return value from gsicc_initialize_iccsmask() at line 587 in base/gstrans.c having failed to load the required ICC profile. As for why we're failing to find ps_gray, I don't know. It *seems* to be finding the default_*.icc files, which are in the same directory. Using -sICCProfilesDir=... doesn't seem to work, either, don't know why. So, fixing the crash is easy enough, line 587 in base/trans.c, change: code = gsicc_initialize_iccsmask(icc_manager); to: code = gsicc_initialize_iccsmask(icc_manager); if (code < 0) return(code);
So, it looks like the reason -sICCProfilesDir doesn't have the desired effect here is that gs_vmreclaim() is being called during the job, and is having the effect of returning the ICC profile path in the current context to the default value (which is the empty "%rom%iccprofiles0" in this case). I am still unclear how the installed version on Oneiric finds the "default_*.icc" profiles, then fails to find the ps_gray.icc, *but* I suspect it is related to the above issue with the command line parameter. That's about as far as I can take this..........
The crash went away actually with the fix from comment #4. I have applied the fix to the Ubuntu Oneiric package (9.04~dfsg-0ubuntu9) now. Thank you very much. I leave the bug open, as the more important part of the fix, finding the profiles at all, is still missing.
Created attachment 7911 [details] patch for gs_lev2.ps This fairly simple patch resolves the problem of failing to find the ICC profiles directory (and of -sICCProfilesDir= not working correctly) for me.
That's it. I have tested my case and now it works perfectly! Thanks.
I've committed the change in the patch: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=568854
*** Bug 692754 has been marked as a duplicate of this bug. ***