Bug 509329 - ps2pdf and gs segfault when trying to create a pdf file
ps2pdf and gs segfault when trying to create a pdf file
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: ghostscript (Show other bugs)
11
i586 Linux
low Severity high
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Reopened
: 509615 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-02 05:13 EDT by Wim Van Hoydonck
Modified: 2010-03-16 11:23 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-16 11:23:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
latex test file (192 bytes, text/plain)
2009-07-02 05:13 EDT, Wim Van Hoydonck
no flags Details
postscript file generated from the dvi-file (29.09 KB, application/postscript)
2009-07-02 17:03 EDT, Wim Van Hoydonck
no flags Details

  None (edit)
Description Wim Van Hoydonck 2009-07-02 05:13:03 EDT
Created attachment 350253 [details]
latex test file

Description of problem:
ps2pdf and gs produce a segfault when converting a ps file to pdf
this is on a brand-new fedora 11 installation on a athec lug N011 netbook.

Version-Release number of selected component (if applicable):
8.64-6

How reproducible:
convert a postscript file to pdf

Steps to Reproduce:
1. latex test.tex 
2. dvips test.dvi
3. ps2pdf test.ps
  
Actual results:
Segmentation fault

Expected results:
a pdf file

Additional info:
same result when directly using gs:
gs -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=test2.pdf -c save pop -f test.ps
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 PUBLIC for details.
Segmentation fault
Comment 1 Tim Waugh 2009-07-02 09:00:22 EDT
I haven't been able to reproduce this.

Please install the ghostscript-debuginfo package, along with the 'gdb' package (if you don't already have that):

yum --enablerepo=fedora-debuginfo install ghostscript-debuginfo gdb

Then run your 'gs' command line as before but with 'gdb --args' at the beginning, i.e.:

gdb --args gs -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite
-sOutputFile=test2.pdf -c save pop -f test.ps

At the '(gdb)' prompt, enter 'run'.  Then enter 'bt' and paste the result in here.  Thanks.
Comment 2 Wim Van Hoydonck 2009-07-02 09:31:01 EDT
Hi Tim,

thanks for the quick response.

I've done what you asked, results pasted below and I left out all warnings about missing debuginfo:

[wrmvanhoydonck@n011 textest]$ gdb --args gs -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=test2.pdf -c save pop -f test.ps
GNU gdb (GDB) Fedora (6.8.50.20090302-27.fc11)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) run
Starting program: /usr/bin/gs -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=test2.pdf -c save pop -f test.ps
...
warnings about missing debug info for other libraries omitted
...
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 PUBLIC for details.

Program received signal SIGSEGV, Segmentation fault.
pdf_attach_charproc (pdev=<value optimized out>, pdfont=<value optimized out>, 
    pcp=0x4bfffd2, glyph=134743967, char_code=0, gnstr=0xd000566c)
    at base/gdevpdti.c:248
248         for (pcpo = pdfont->u.simple.s.type3.char_procs; pcpo != NULL; pcpo = pcpo->char_next) {
(gdb) bt
#0  pdf_attach_charproc (pdev=<value optimized out>, 
    pdfont=<value optimized out>, pcp=0x4bfffd2, glyph=134743967, char_code=0, 
    gnstr=0xd000566c) at base/gdevpdti.c:248
#1  0xec002280 in ?? ()
#2  0x04bfffd2 in ?? ()
#3  0x0808079f in ?? ()
#4  0x00000000 in ?? ()


more info about my system:
[wrmvanhoydonck@n011 textest]$ uname -a
Linux n011 2.6.29.5-191.fc11.i586 #1 SMP Tue Jun 16 23:11:39 EDT 2009 i686 i686 i386 GNU/Linux
Comment 3 Tim Waugh 2009-07-02 11:23:32 EDT
Thanks.  Could you attach your test.ps file please?
Comment 4 Wim Van Hoydonck 2009-07-02 17:03:07 EDT
Created attachment 350347 [details]
postscript file generated from the dvi-file

Here it is
Comment 5 Tim Waugh 2009-07-03 05:39:52 EDT
Please fetch this new package:
http://koji.fedoraproject.org/koji/buildinfo?buildID=112836

Make sure to download the 'ghostscript' and 'ghostscript-debuginfo' packages, then install them (e.g. 'rpm -Uvh ghostscript*.rpm').

Try running gdb again as in comment #1 and see what you get this time.  Thanks.
Comment 6 Wim Van Hoydonck 2009-07-03 08:07:34 EDT
gdb: Program exited normally.

With the new packages, the segfault is gone.

Thanks a lot for fixing this.
Comment 7 Tim Waugh 2009-07-03 09:55:09 EDT
Oh. :-(

I didn't change anything except the optimization flags.  Can you please try reverting to the previous packages to check if the problem reappears again?

rpm --nodeps -e ghostscript ghostscript-debuginfo
yum install ghostscript
Comment 8 Wim Van Hoydonck 2009-07-03 11:22:23 EDT
Ok, I installed ghostscript-8.64-6 again.
The problem does not reappear, ps2pdf and gs work again.
Comment 9 Tim Waugh 2009-07-03 11:54:24 EDT
Strange.  Oh well, please re-open this if it happens again.
Comment 10 Tim Waugh 2009-07-19 06:19:45 EDT
Re-opening to mark a duplicate.
Comment 11 Tim Waugh 2009-07-19 06:21:44 EDT
*** Bug 509615 has been marked as a duplicate of this bug. ***
Comment 12 armando 2009-07-21 23:27:15 EDT
I have reproduced the bug on a fresh fedora 11 (32bit) using
also the test.ps file posted here (see also previous bug 509615).
I'm now going to try the new packages proposed in #5 and let you
know of the result.
Comment 13 armando 2009-07-21 23:52:56 EDT
With the new packages proposed in #5 the problem is gone!

I then removed the new packages with:
rpm --nodeps -e ghostscript ghostscript-debuginfo

and reistalled the 8.64-6.f11.i586 version with:

yum install ghostscript  

This time the problem did not appear again, even though
I reverted to the original packages, just like in #8. 
I also reverted to 8.64-6 for ghostscript-devel, ghostscript-gtk
and ghostscript-doc and removed ghostscript-debuginfo-8.64-9,
i.e. supposedly fully reverting to the original 8.64-6 
configuration, and the bug still does not re-appear. Somehow
installing 8.64-9 fixes the bug, even when one reverts
to 8.64-6 later!

I'll stick with what is working for me right now. Thanks for
your help.
Comment 14 Tim Waugh 2010-03-16 11:23:43 EDT
OK, closing.

Note You need to log in before you can comment on or make changes to this bug.