Summary: | Some PDFs make GS segfault with small space_params->MaxBitmap others with large space_params->MaxBitmap | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Till Kamppeter <till.kamppeter> |
Component: | PDF Interpreter | Assignee: | Ray Johnston <ray.johnston> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 8.71 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: |
R220.ppd
EntryConditions-evince.pdf CityMap-evince.pdf |
Description
Till Kamppeter
2010-03-11 18:58:51 UTC
Created attachment 6050 [details]
R220.ppd
PPD file for the sample command lines.
Created attachment 6051 [details]
EntryConditions-evince.pdf
PDF file which segfaults on big space_params->MaxBitmap.
Created attachment 6052 [details]
CityMap-evince.pdf
PDF file which segfaults on small space_params->MaxBitmap.
Note that the thresholds of space_params->MaxBitmap for getting a segfault or not can depend on the hardware, architecture, and operating system. I have done all tests only on 64-bit Intel under 64-bit Linux (Ubuntu Lucid). Ghostscript is built as shared library (libgs). Since MaxBitmap controls the internal decision to use the clist banding or not, I'll take this and attempt to duplicate it on my 64-bit ubuntu machine (peeves, an Intel i7 machine w/ 6Gb RAM). If the case that fails with a LARGE MaxBitmap is non clist related, I may break this into separate bugs and assign to an appropriate engineer. Is space_params->MaxBitmap=0 (and also space_params->BufferSpace=0) meaning zero or unlimited? Ubuntu bug report for this bug: https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/534525 The CityMap.pdf file is from bug #691014. Hmm, Till, I just saw the commit message on #irc and wondered what clean-up is done... I think doing exit(1) within a driver is a bit frown upon. (although we all do it from time to time...) - does pstoraster actually use the exit value of the ghostscript process? Even if it does, "return GS_error;" or one of the other things I have seen elsewhere is preferred and probably will set the exit value of the gs process also... I'd let others comment on what's the preferred approach - but I am pretty sure I have not seen any other driver in gs doing exit() within a driver method. I have seen that gs_exit() frees all memory and closes the rendering process but does not close Ghostscript. Mike Sweet probably did not realize it because he did not have any offending input file which made his driver run into the gs_exit() calls. So I added "exit(1)" to each of the gs_exit() calls and this eliminated the segfaults which were caused by the driver going on working on the data structures which were freed by gs_exit(). Now the segfaults are eliminated but not the incapacity of the driver to render the offending files. Hin-Tak, can you tell me how to replace the sequence "gs_exit(); exit(1)" so that Ghostscript gets correctly shut down in case of an error? Hin-Tak, problem solved. I have found out how to error out correctly. The corrected gdevcups.c is committed now. This solves the bug of segfaults reported here and with forcing banding mode in addition the file EntryConditions-evince.pdf gets rendered correctly. The problem of CityMap-evince.pdfbug is most probably bug #691014. So I close this bug as fixed. I see you have found the answer - in general, driver routines should not exit() but return an error status to the caller (which would then dealt with the error status accordingly). |