Bug 691619 - pdf2ps segfaults on attached file
Summary: pdf2ps segfaults on attached file
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 15:55 UTC by keinbiervorvier
Modified: 2011-09-20 20:56 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
pdf file which gives gs cannot display or convert to ps (62.91 KB, application/pdf)
2010-09-16 15:55 UTC, keinbiervorvier
Details
possible patch (2.66 KB, patch)
2010-11-10 16:55 UTC, Chris Liddell (chrisl)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description keinbiervorvier 2010-09-16 15:55:44 UTC
Created attachment 6729 [details]
pdf file which gives gs cannot display or convert to ps

this applies to current HEAD.

The attached pdf file displays fine in acroread, okular, xpdf, but gs segfaults with this commandline (pdf2ps)

$ gs -q -dNOPAUSE -DBATCH -P- -DSAFER -sDEVICE=pswrite -sOutputFile=foo.ps -c save pop -f integrating_AB.pdf
Segmentation fault


and exits with error when trying to display the pdf

$ gs integrating_AB.pdf
GPL Ghostscript SVN PRE-RELEASE 9.01 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Error: /rangecheck in --run--
Operand stack:
   --dict:10/19(L)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_pop   1893   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1151/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:108/127(ro)(G)--   --dict:293/300(ro)(G)--   --dict:23/30(L)--   --dict:6/8(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--
Current allocation mode is local
Last OS error: 11
GPL Ghostscript SVN PRE-RELEASE 9.01: Unrecoverable error, exit code 1


Cheers
T.
Comment 1 Alex Cherepanov 2010-09-17 03:26:47 UTC
Error: /rangecheck in --run-- is a well-known bug in x11alpha
device triggered by transparency. Use -sDEVICE=x11 to work around.

SEGV happens because penum->dev->device_icc_profile
is NULL. The device is "bbox". The stack is:
gs_image_class_4_color
gx_image_enum_begin
gx_begin_image1
gx_default_begin_typed_image
bbox_begin_typed_image
gx_default_begin_image
gdev_vector_begin_image
psw_begin_image
gx_default_begin_typed_image
pdf14_put_image
gx_update_pdf14_compositor
pdf14_create_compositor
send_pdf14trans
gs_state_update_pdf14trans
gs_pop_pdf14trans_device
zpoppdf14devicefilter
Comment 2 Chris Liddell (chrisl) 2010-11-10 16:55:53 UTC
Created attachment 6887 [details]
possible patch

This patch adds a reference to the "parent" device's ICC profile when we use the bounding box internally.
Comment 3 Michael Vrhel 2011-04-09 05:42:39 UTC
Works with rev 12380.  I did not see any ps2write issues either.
Comment 4 keinbiervorvier 2011-04-09 23:38:18 UTC
I confirm that this works with rev 12380

Thanks
T.