FS#22006 - [ghostscript] Segmentation fault when joining serveral PDF files into one

Attached to Project: Arch Linux
Opened by Musikolo (Musikolo) - Tuesday, 07 December 2010, 11:15 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 19 December 2010, 09:44 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

* Description:
Hi,

I've tried to join several PDF files into one by issuing the next command:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

but I get a "Segmentation fault" message. I found the above command at http://www.linux.com/archive/feed/36815

* Additional info:
- package version(s)
ghostscript 9.00-1

* Steps to reproduce:
Just issue the mentioned command.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Sunday, 19 December 2010, 09:44 GMT
Reason for closing:  Fixed
Comment by Thomas Dziedzic (tomd123) - Tuesday, 07 December 2010, 17:42 GMT
could you provide the sample pdfs for testing convenience?
Comment by Musikolo (Musikolo) - Wednesday, 08 December 2010, 02:49 GMT
Hi,

Any PDF files are fine to reproduce this error, for instance, the next two files show the "Segmentation fault" message on my PC:

- https://wiki.mozilla.org/images/e/ed/Analyst_report_Q1_2010.pdf
- http://www.boe.es/boe/dias/2005/12/30/pdfs/A42905-43094.pdf

[musikolo@MyPC ~]$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf A42905-43094.pdf Analyst_report_Q1_2010.pdf
Segmentation fault

Best regards!
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 08 December 2010, 22:46 GMT
  • Field changed: Category (Packages: Extra → Upstream Bugs)
I just run a simple test, just fail with only Analyst_report_Q1_2010.pdf, there is no need to join.

I tested with other command line another pdf ( http://marketing.optomausa.com/PDFs/datasheets/Optoma_HD66_Datasheet.pdf ) and also fails.

gs -sDEVICE=png16m -sOutputFile=x -dSAFER -dPARANOIDSAFER -dNOPAUSE -dFirstPage=1 -dLastPage=1 -q Optoma_HD66_Datasheet.pdf -c showpage -c quit

ghostscript 8.71 works OK

My time is limited now, can anyone report this to upstream? Thanks. http://bugs.ghostscript.com/
Comment by Musikolo (Musikolo) - Wednesday, 08 December 2010, 23:21 GMT
@djgera:

Done: http://bugs.ghostscript.com/show_bug.cgi?id=691827

Thanks for your support! ;)
Comment by Alex Cherepanov (alexcher) - Thursday, 09 December 2010, 03:40 GMT
Most likely, it's a local build problem.
I've tried my builds of v. 9.00 and the current development version
on Linux and Windows. The crash is not reproduced.

Please try to rebuild your gs and check how does it work.
Comment by Musikolo (Musikolo) - Thursday, 09 December 2010, 18:32 GMT
Please, see the recommendations suggested by the GhostScript team in order to fix this issue:
- http://bugs.ghostscript.com/show_bug.cgi?id=691827#c2

Best regards-
Comment by Thomas Dziedzic (tomd123) - Friday, 10 December 2010, 03:50 GMT
so they said to not use any external libs and that's that.. wonderful
Comment by ux (ubitux) - Tuesday, 14 December 2010, 19:51 GMT
I've reported a similar crash with ghostscript here: http://bugs.ghostscript.com/show_bug.cgi?id=691831

It's been fixed upstream with a single line fix. It was relative to a GCC 4.5.1 issue (at least for x86_64). It may be interesting to backport that fix at least. Or maybe build ghostscript with an older GCC version. Clang also does not seem to be concerned by that problem.

[~]% gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf A42905-43094.pdf Analyst_report_Q1_2010.pdf
zsh: segmentation fault gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf
[~]% gs-svn -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf A42905-43094.pdf Analyst_report_Q1_2010.pdf
[~]%

That fix may be relative to other fixes thought.
Comment by Andreas Radke (AndyRTR) - Saturday, 18 December 2010, 10:46 GMT
I've applied the gcc fix from svn commit #11948 to solve the gcc ANSI issue: http://ghostscript.com/pipermail/gs-commits/2010-December/012019.html

Some minor cleanups have been made to the pkg, please test ghostsript 9.00-2 from testing. Both here reported issues are solved for me (x86_64).
Comment by Leonid Isaev (lisaev) - Saturday, 18 December 2010, 17:29 GMT
BTW, 9.00-1 works on i686.
Comment by Leonid Isaev (lisaev) - Saturday, 18 December 2010, 20:12 GMT
ghostscript 9.00-2 works on i686
Comment by Musikolo (Musikolo) - Saturday, 18 December 2010, 22:00 GMT
Confirmed, using the same files, the previous command that used to fail, now works perfectly.

Thanks for fixing it so quickly! ;-)

Loading...