Bug 692572 - Ghostscript is not able to render a PDF file generated by itself
Summary: Ghostscript is not able to render a PDF file generated by itself
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 9.04
Hardware: PC Linux
: P4 major
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 11:49 UTC by Till Kamppeter
Modified: 2011-10-06 12:11 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
book-ps2pdf.pdf (39.42 KB, application/pdf)
2011-10-06 11:49 UTC, Till Kamppeter
Details
book2-pstopdf.pdf (41.42 KB, application/pdf)
2011-10-06 11:50 UTC, Till Kamppeter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Till Kamppeter 2011-10-06 11:49:38 UTC
Created attachment 7969 [details]
book-ps2pdf.pdf

I use Ghostscript 9.04 under Ubuntu Oneiric 64-bit.

After fixing the library problems which caused bug 692539, I could turn the PostScript file book.ps attached there to a PDF file using Ghostscript, either manually via

ps2pdf book.ps book-ps2pdf.pdf

or CUPS on Oneiric does

/usr/lib/cups/filter/pstopdf 1 1 1 1 '' book.ps > book-pstopdf.pdf

which also uses Ghostscript with the "pdfwrite" device.

If I try to render these files with Ghostscript, output device does not matter, I got the problem at least with "cups" (both color space 1/RGB and 17/RGBW), "ps2write", and "x11alpha", I get always a segmentation fault on page 4, where the figure is.

gs book-ps2pdf.pdf

is enough to reproduce the segfault, at least on Linux/Unix.

The sample PDF files display perfectly with evince (Poppler-based).

Sample files attached.
Comment 1 Till Kamppeter 2011-10-06 11:50:42 UTC
Created attachment 7970 [details]
book2-pstopdf.pdf
Comment 2 Till Kamppeter 2011-10-06 11:55:08 UTC
Stack trace:

till@till:~/ghostscript/testfiles$ gs book2-ps2pdf.pdf 
GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 4.
Page 1
>>showpage, press <return> to continue<<
Page 2
>>showpage, press <return> to continue<<
Page 3
Loading NimbusMonL-Regu font from /usr/share/fonts/type1/gsfonts/n022003l.pfb... 3601744 2210008 6349728 5008124 3 done.
>>showpage, press <return> to continue<<
Page 4

Segmentation fault (core dumped)

till@till:~/ghostscript/testfiles$ gdb -c core /usr/bin/gs
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/gs...Reading symbols from /usr/lib/debug/usr/bin/gs...done.
done.
[New LWP 23078]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Core was generated by `gs book2-ps2pdf.pdf'.
Program terminated with signal 11, Segmentation fault.
#0  gx_remap_ICC (pcc=0x1a389f0, pcs=0x1a5a8e0, pdc=0x1a38a90, pis=0x1362a78, 
    dev=0x13b9f28, select=gs_color_select_texture) at ./base/gsicc.c:354
354	    if (icc_link->is_identity) {
(gdb) bt full
#0  gx_remap_ICC (pcc=0x1a389f0, pcs=0x1a5a8e0, pdc=0x1a38a90, pis=0x1362a78, 
    dev=0x13b9f28, select=gs_color_select_texture) at ./base/gsicc.c:354
        icc_link = 0x0
        rendering_params = {rendering_intent = gsRELATIVECOLORIMETRIC, 
          graphics_type_tag = GS_TEXT_TAG, black_point_comp = BP_ON}
        psrc = {0, 1561, 32767, 0, 64208, 29427, 32767, 0, 64264, 29427, 
          32767, 0, 62996, 1605}
        psrc_cm = {0 <repeats 14 times>}
        psrc_temp = <optimized out>
        conc = {2, 0, 0, 0, -12920, 316, 0, 0, -6762, 1605, 32642, 0, 10, 0}
        k = <optimized out>
        i = <optimized out>
        num_des_comps = 3
        dev_profile = 0x14c6910
#1  0x00007f82063da7dc in gx_remap_color (pgs=0x1362a78) at ./base/gxcmap.c:552
        pcs = <optimized out>
        code = <optimized out>
#2  0x00007f82063cd710 in gs_text_begin (pgs=0x1362a78, text=0x7fff72f3fb80, 
    mem=0x133c8e8, ppte=0x7fff72f3fc08) at ./base/gstext.c:264
        code_dc = <optimized out>
        pcpath = 0x1a388b0
---Type <return> to continue, or q <return> to quit---
        code = <optimized out>
#3  0x00007f82063cd7e8 in gs_show_begin (pgs=<optimized out>, 
    str=<optimized out>, size=<optimized out>, mem=<optimized out>, 
    ppte=<optimized out>) at ./base/gstext.c:313
        text = {operation = 132097, data = {
            bytes = 0x1a5b5b7 "!\"#$!%!&'%()&(\"'*", chars = 0x1a5b5b7, 
            glyphs = 0x1a5b5b7, d_char = 27637175, d_glyph = 27637175}, 
          size = 17, delta_all = {x = 6.9266237246314891e-310, 
            y = 1.0912067251774148e-316}, delta_space = {
            x = 1.143712168305385e-316, y = 6.95323889356111e-310}, space = {
            s_char = 23149456, s_glyph = 23149456}, x_widths = 0x0, 
          y_widths = 0x7f82061c7f68, widths_size = 132222}
#4  0x00007f82061bbb01 in zshow (i_ctx_p=0x137ea78) at ./psi/zchar.c:57
        op = 0x13679a8
        penum = <optimized out>
        code = <optimized out>
#5  0x00007f820619c3fa in interp (pi_ctx_p=0x133c3e8, pref=<optimized out>, 
    perror_object=0x7fff72f40a50) at ./psi/interp.c:1539
        index = <optimized out>
        i_ctx_p = 0x137ea78
        iref_packed = 0x144ae12
---Type <return> to continue, or q <return> to quit---
        icount = 0
        iosp = <optimized out>
        iesp = 0x136afe8
        code = <optimized out>
        token = {tas = {type_attrs = 3460, rsize = 369}, value = {
            intval = 20183376, boolval = 63824, realval = 3.30559806e-38, 
            saveid = 20183376, bytes = 0x133f950 "\001", 
            const_bytes = 0x133f950 "\001", refs = 0x133f950, 
            const_refs = 0x133f950, pname = 0x133f950, 
            const_pname = 0x133f950, pdict = 0x133f950, 
            const_pdict = 0x133f950, packed = 0x133f950, 
            writable_packed = 0x133f950, opproc = 0x133f950, 
            pfile = 0x133f950, pdevice = 0x133f950, pstruct = 0x133f950}}
        pvalue = 0x155aab0
        opindex = <optimized out>
        whichp = <optimized out>
        ierror = {code = -22, line = 1563, obj = 0x7fff72f3fc80, full = {
            tas = {type_attrs = 3968, rsize = 658}, value = {
              intval = 102421296, boolval = 54064, realval = 2.91193369e-35, 
              saveid = 140196424897328, 
              bytes = 0x7f82061ad330 "H\211\\$\320H\211l$\330H\211\373L\211|$\37---Type <return> to continue, or q <return> to quit---
0L\211d$\340L\211l$\350L\211t$\360H\203\354xH\213\257h\002", 
              const_bytes = 0x7f82061ad330 "H\211\\$\320H\211l$\330H\211\373L\211|$\370L\211d$\340L\211l$\350L\211t$\360H\203\354xH\213\257h\002", 
              refs = 0x7f82061ad330, const_refs = 0x7f82061ad330, 
              pname = 0x7f82061ad330, const_pname = 0x7f82061ad330, 
              pdict = 0x7f82061ad330, const_pdict = 0x7f82061ad330, 
              packed = 0x7f82061ad330, writable_packed = 0x7f82061ad330, 
              opproc = 0x7f82061ad330 <zfile>, pfile = 0x7f82061ad330, 
              pdevice = 0x7f82061ad330, pstruct = 0x7f82061ad330}}}
        int_nt = 0x1347ab8
        ticks_left = 52
#6  0x00007f820619ce63 in gs_call_interp (perror_object=0x7fff72f40a50, 
    pexit_code=0x7fff72f40a6c, user_errors=1, pref=<optimized out>, 
    pi_ctx_p=0x133c3e8) at ./psi/interp.c:490
        doref = {tas = {type_attrs = 1512, rsize = 3}, value = {
            intval = 20565950, boolval = 53182, realval = 3.41281813e-38, 
            saveid = 20565950, bytes = 0x139cfbe "\373\300\350\005P", 
            const_bytes = 0x139cfbe "\373\300\350\005P", refs = 0x139cfbe, 
            const_refs = 0x139cfbe, pname = 0x139cfbe, 
            const_pname = 0x139cfbe, pdict = 0x139cfbe, 
            const_pdict = 0x139cfbe, packed = 0x139cfbe, 
---Type <return> to continue, or q <return> to quit---
            writable_packed = 0x139cfbe, opproc = 0x139cfbe, 
            pfile = 0x139cfbe, pdevice = 0x139cfbe, pstruct = 0x139cfbe}}
        error_name = {tas = {type_attrs = 3332, rsize = 251}, value = {
            intval = 20182432, boolval = 62880, realval = 3.30533349e-38, 
            saveid = 20182432, bytes = 0x133f5a0 "\001", 
            const_bytes = 0x133f5a0 "\001", refs = 0x133f5a0, 
            const_refs = 0x133f5a0, pname = 0x133f5a0, 
            const_pname = 0x133f5a0, pdict = 0x133f5a0, 
            const_pdict = 0x133f5a0, packed = 0x133f5a0, 
            writable_packed = 0x133f5a0, opproc = 0x133f5a0, 
            pfile = 0x133f5a0, pdevice = 0x133f5a0, pstruct = 0x133f5a0}}
        ccode = <optimized out>
        saref = {tas = {type_attrs = 2668, rsize = 29428}, value = {
            intval = 1, boolval = 1, realval = 1.40129846e-45, saveid = 1, 
            bytes = 0x1 <Address 0x1 out of bounds>, 
            const_bytes = 0x1 <Address 0x1 out of bounds>, refs = 0x1, 
            const_refs = 0x1, pname = 0x1, const_pname = 0x1, pdict = 0x1, 
            const_pdict = 0x1, packed = 0x1, writable_packed = 0x1, 
            opproc = 0x1, pfile = 0x1, pdevice = 0x1, pstruct = 0x1}}
        i_ctx_p = 0x137ea78
        perrordict = 0x135cbe8
---Type <return> to continue, or q <return> to quit---
        gc_signal = 0
        epref = 0x7fff72f409a0
        code = <optimized out>
#7  gs_interpret (pi_ctx_p=0x133c3e8, pref=<optimized out>, user_errors=1, 
    pexit_code=0x7fff72f40a6c, perror_object=0x7fff72f40a50)
    at ./psi/interp.c:448
        i_ctx_p = <optimized out>
        error_root = {next = 0x1343cf0, ptype = 0x7f8206768c40, 
          p = 0x7fff72f40958, free_on_unregister = 0}
#8  0x00007f8206192683 in gs_main_interpret (perror_object=<optimized out>, 
    pexit_code=<optimized out>, user_errors=<optimized out>, 
    pref=0x7fff72f40a30, minst=<optimized out>) at ./psi/imain.c:239
        code = 0
#9  gs_main_run_string_end (minst=<optimized out>, 
    user_errors=<optimized out>, pexit_code=<optimized out>, 
    perror_object=<optimized out>) at ./psi/imain.c:591
        rstr = {tas = {type_attrs = 4704, rsize = 0}, value = {intval = 0, 
            boolval = 0, realval = 0, saveid = 0, bytes = 0x0, 
            const_bytes = 0x0, refs = 0x0, const_refs = 0x0, pname = 0x0, 
            const_pname = 0x0, pdict = 0x0, const_pdict = 0x0, packed = 0x0, 
            writable_packed = 0x0, opproc = 0, pfile = 0x0, pdevice = 0x0, 
---Type <return> to continue, or q <return> to quit---
            pstruct = 0x0}}
#10 0x00007f82061933fb in run_string (minst=0x133c350, str=<optimized out>, 
    options=<optimized out>) at ./psi/imainarg.c:822
        exit_code = 0
        error_object = {tas = {type_attrs = 3585, rsize = 658}, value = {
            intval = 102421296, boolval = 54064, realval = 2.91193369e-35, 
            saveid = 140196424897328, 
            bytes = 0x7f82061ad330 "H\211\\$\320H\211l$\330H\211\373L\211|$\370L\211d$\340L\211l$\350L\211t$\360H\203\354xH\213\257h\002", 
            const_bytes = 0x7f82061ad330 "H\211\\$\320H\211l$\330H\211\373L\211|$\370L\211d$\340L\211l$\350L\211t$\360H\203\354xH\213\257h\002", 
            refs = 0x7f82061ad330, const_refs = 0x7f82061ad330, 
            pname = 0x7f82061ad330, const_pname = 0x7f82061ad330, 
            pdict = 0x7f82061ad330, const_pdict = 0x7f82061ad330, 
            packed = 0x7f82061ad330, writable_packed = 0x7f82061ad330, 
            opproc = 0x7f82061ad330 <zfile>, pfile = 0x7f82061ad330, 
            pdevice = 0x7f82061ad330, pstruct = 0x7f82061ad330}}
        code = <optimized out>
#11 0x00007f8206193561 in runarg (minst=0x133c350, pre=0x7f82064c583d "", 
    arg=<optimized out>, post=0x7f820643b45f ".runfile", options=3)
    at ./psi/imainarg.c:813
---Type <return> to continue, or q <return> to quit---
        len = <optimized out>
        code = <optimized out>
        line = 0x14e5100 "<626f6f6b322d7073327064662e706466>.runfile"
#12 0x00007f8206194f63 in gs_main_init_with_args (minst=0x133c350, argc=2, 
    argv=0x7fff72f41618) at ./psi/imainarg.c:221
        arg = 0x7fff72f437c9 "book2-ps2pdf.pdf"
        args = {expand_ats = 1, 
          arg_fopen = 0x7f8206193300 <gs_main_arg_fopen>, 
          fopen_data = 0x133c350, argp = 0x7fff72f41628, argn = 0, depth = 0, 
          cstr = "\305\000\000\000i\000\000\000 \000\000\000\v\000\000\000A\001d\000\202\000\024\220\006\017\000\020\001A\000\000\201\000 \004\000\000!\000\004\002\f\004\000\000\230\000@\000\000@\n\000\b@\002`\214\000\000\000\004\212\000\200\000 \002@\021\021\200@\000\001\002\025\000@p\023\364r\377\177\000\000\360\023\364r\377\177\000\000\210\231\343\006\202\177\000\000\000\000\000\000\000\000\000\000\343m\313\005\202\177\000\000\360\f\364r\377\177\000\000\242h\302\006\202\177\000\000\000\000\000\000\000\000\000\000\260]\311\005\202\177\000\000H\366\340\006\202\177\000\000Lp\302\006\202\177\000\000\340$\341\006\202\177\000\000\330I\341\006\202\177\000\000\210\231\343\006\202\177\000\000\000\000\000\000\000\000\000\000\t\003@\020\n@\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\001\200\000@\213\003\006\202\177\000\000\000\000\340'\350\345\376\377\210\231\343\006\202\177\000\000\000\000\000\000\000\000\000\000\343m\313\005\202"..., 
---Type <return> to continue, or q <return> to quit---
          sources = {{is_file = 1, u = {s = {parsed = 0, 
                  chars = 0x7f8200000001 <Address 0x7f8200000001 out of bounds>, memory = 0x7f8206e3c2c8, str = 0x7f8205cadcd8 "\314D"}, file = 0x0}}, {
              is_file = 115579272, u = {s = {parsed = 97146040, 
                  chars = 0x7f8206e39988 "", memory = 0xffffffff, 
                  str = 0x7f8206e39988 ""}, file = 0x7f8205ca54b8}}, {
              is_file = 0, u = {s = {parsed = 115590688, 
                  chars = 0x1ffffffff <Address 0x1ffffffff out of bounds>, 
                  memory = 0x133c290, 
                  str = 0x88a190 <Address 0x88a190 out of bounds>}, 
                file = 0x7f8206e3c620}}, {is_file = 4195672, u = {s = {
                  parsed = 0, chars = 0x0, memory = 0x7f8206040000, 
                  str = 0x7f8206c27fb4 "H\211\303d\213\004%\030"}, 
                file = 0x0}}, {is_file = 1, u = {s = {parsed = 0, 
                  chars = 0x1 <Address 0x1 out of bounds>, 
                  memory = 0x7f8205cadcd8, str = 0x7f8206054928 "&\210"}, 
                file = 0x0}}, {is_file = 115578040, u = {s = {
                  parsed = 20169200, chars = 0x0, memory = 0x7fff72f41430, 
                  str = 0x100 <Address 0x100 out of bounds>}, 
                file = 0x133c1f0}}, {is_file = -1, u = {s = {
                  parsed = 1928598656, chars = 0x7fff72f41450 "", 
---Type <return> to continue, or q <return> to quit---
                  memory = 0x0, str = 0x601048 "`]\031\006\202\177"}, 
                file = 0x7fff72f41480}}, {is_file = 0, u = {s = {parsed = 0, 
                  chars = 0x0, memory = 0x0, 
                  str = 0x7f8206c27fb4 "H\211\303d\213\004%\030"}, 
                file = 0x0}}, {is_file = 1, u = {s = {parsed = 0, 
                  chars = 0x7f820643b076 "init_main_instance", 
                  memory = 0x7f8206054928, 
                  str = 0xa0 <Address 0xa0 out of bounds>}, file = 0x0}}, {
              is_file = 0, u = {s = {parsed = 2, 
                  chars = 0x7fff72f41618 "\306\067\364r\377\177", 
                  memory = 0x7fff72f41610, 
                  str = 0x7f8206c2e725 "I\211\303L\213L$0L\213D$(H\213|$ H\213t$\030H\213T$\020H\213L$\bH\213\004$H\203\304HA\377\343ffffff.\017\037\204"}, 
                file = 0x2}}}}
        code = 0
#13 0x0000000000400955 in main (argc=2, argv=0x7fff72f41618)
    at ./psi/dxmainc.c:84
        exit_status = <optimized out>
        code = 0
        code1 = <optimized out>
        instance = 0x133c1f0
---Type <return> to continue, or q <return> to quit---
        exit_code = 0
(gdb) quit
till@till:~/ghostscript/testfiles$
Comment 3 Chris Liddell (chrisl) 2011-10-06 12:11:03 UTC
Both files work fine using our supplied lcms.