I get a segmentation fault when trying to process a specific pdf with different dPDFSETTINGS. It works fine if I use -dPDFSETTINGS=/default or -dPDFSETTINGS=/printer, but otherwise it just segfaults. It doesn't happen with all pdfs.
(gdb) run -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -sOutputFile=output.pdf input.pdf
Starting program: /usr/bin/gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -sOutputFile=output.pdf input.pdf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 6.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6e8ef57 in ?? () from /usr/lib/x86_64-linux-gnu/libgs.so.9
Linux 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
libgs9/bionic-updates,bionic-security,now 9.26~dfsg+0-0ubuntu0.18.04.13 amd64 [installed,automatic]
I tried installing different package versions to see if it changed anything, but I had the same issue.
I tried with:
libgs9-common=9.22~dfsg+1-0ubuntu1 libgs9=9.22~dfsg+1-0ubuntu1 ghostscript=9.22~dfsg+1-0ubuntu1
Please attach your PDF file.
Also, I request that you test with the 9.53.0 release candidate available at
If it works with that release, we've already fixed it (probably the case).
Unfortunately I can't provide the PDF as it has private information. Is there anything else I could do instead?
I have installed 9.53.0 and it still segfaults:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile=Meeting_Brief_20200813_small-gs9.53.0.pdf Meeting_Brief_20200813.pdf
GPL Ghostscript RELEASE CANDIDATE 2 9.53.0 (2020-08-27)
Copyright (C) 2020 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 6.
Segmentation fault (core dumped)
(In reply to Violeta from comment #3)
> Unfortunately I can't provide the PDF as it has private information. Is
> there anything else I could do instead?
There are basically three options:
1) If you're prepared to share the file, just not publicly, send it to one of us. You can either email it (not exactly secure) or place it on a secure site and tell us (by email) how to retrieve it. You may find it easier to discuss this with us in real-time. You can talk to us in the #ghostscript IRC channel on freenode. Best time is UK office hours but there can be developers there more or less any time.
2) You can find another problem file which you can share, or redact/remove the private information from the original file (making sure it still fails afterwards, obviously). We can't work on your problem in the dark, we need the file and command line to find and solve the bug.
3) You could debug the problem yourself, we're open to accepting patches form the community, though we would need at least some explanation of the problem.
I found a file that fails with -dPDFSETTINGS=/ebook but runs to completion without -dPDFSETTINGS. This happens on the current development version in debug and release builds. The file is too big to attach but can be downloaded here
Commit 89ff7003acfdc52e3d3bcca930de6961f33ae927 fixes this problem.
While working on it I uncovered a different issue (which is unlikely ever to cause a real-world problem) and this is tracked in bug 702885