Bug 694318 - Seg fault in pdfwrite
Summary: Seg fault in pdfwrite
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Linux
: P1 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-14 06:44 UTC by Marcos H. Woehrmann
Modified: 2013-06-19 07:50 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2013-06-14 06:44:12 UTC
The following command line seg faults:

  gbin/gs -sDEVICE=pdfwrite -r300 -o test.pdf -sDEFAULTPAPERSIZE=letter ./Bug694290.pd
Comment 2 Marcos H. Woehrmann 2013-06-14 06:47:03 UTC
Here's the (probably not helpful) stack trace from gdb:

(gdb) run -sDEVICE=pdfwrite -r300 -o test2.pdf -sDEFAULTPAPERSIZE=letter /home/marcos/cluster/tests_private/comparefiles/Bug694290.pdf

Starting program: /home/marcos/artifex/ghostpdl/gs/debugbin/gs -sDEVICE=pdfwrite -r300 -o test2.pdf -sDEFAULTPAPERSIZE=letter /home/marcos/cluster/tests_private/comparefiles/Bug694290.pdf
[Thread debugging using libthread_db enabled]
GPL Ghostscript GIT PRERELEASE 9.08 (2013-01-29)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 16.
Page 1
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8
Page 9

Program received signal SIGSEGV, Segmentation fault.
0x00000000005971f4 in igc_reloc_struct_ptr (obj=0x2ba9f48, gcst=0x7fffffffc5e0) at ./psi/igc.c:1305
1305                     (pfree->o_back << obj_back_shift));
(gdb) where
#0  0x00000000005971f4 in igc_reloc_struct_ptr (obj=0x2ba9f48, gcst=0x7fffffffc5e0) at ./psi/igc.c:1305
#1  0x000000000095e3c7 in basic_reloc_ptrs (vptr=0x18c7490, size=120, pstype=0xba9e80, gcst=0x7fffffffc5e0) at ./base/gsmemory.c:347
#2  0x000000000079adfd in pdf_substream_save_elt_reloc_ptrs (vptr=0x18c7490, size=1320, pstype=0xba9ee0, gcst=0x7fffffffc5e0) at ./devices/vector/gdevpdf.c:58
#3  0x0000000000596fc8 in gc_do_reloc (cp=0x18c4fd0, mem=0x1870648, pstate=0x7fffffffc5e0) at ./psi/igc.c:1247
#4  0x000000000059480d in gs_gc_reclaim (pspaces=0x18bd528, global=1) at ./psi/igc.c:449
#5  0x0000000000686f18 in context_reclaim (pspaces=0x18bd528, global=1) at ./psi/zcontext.c:280
#6  0x0000000000549193 in gs_vmreclaim (dmem=0x18bd520, global=1) at ./psi/ireclaim.c:155
#7  0x0000000000548ede in ireclaim (dmem=0x18bd520, space=-1) at ./psi/ireclaim.c:77
#8  0x00000000005423ff in interp_reclaim (pi_ctx_p=0x186e3f0, space=-1) at ./psi/interp.c:441
#9  0x0000000000545aa0 in interp (pi_ctx_p=0x186e3f0, pref=0x7fffffffd760, perror_object=0x7fffffffd9d0) at ./psi/interp.c:1713
#10 0x000000000054268d in gs_call_interp (pi_ctx_p=0x186e3f0, pref=0x7fffffffd8d0, user_errors=1, pexit_code=0x7fffffffd9ec, perror_object=0x7fffffffd9d0)
    at ./psi/interp.c:510
#11 0x00000000005424a7 in gs_interpret (pi_ctx_p=0x186e3f0, pref=0x7fffffffd8d0, user_errors=1, pexit_code=0x7fffffffd9ec, perror_object=0x7fffffffd9d0)
    at ./psi/interp.c:468
#12 0x000000000053493d in gs_main_interpret (minst=0x186e350, pref=0x7fffffffd8d0, user_errors=1, pexit_code=0x7fffffffd9ec, perror_object=0x7fffffffd9d0)
    at ./psi/imain.c:241
#13 0x00000000005357f7 in gs_main_run_string_end (minst=0x186e350, user_errors=1, pexit_code=0x7fffffffd9ec, perror_object=0x7fffffffd9d0) at ./psi/imain.c:621
#14 0x00000000005356a9 in gs_main_run_string_with_length (minst=0x186e350, 
    str=0x1c35b60 "<2f686f6d652f6d6172636f732f636c75737465722f74657374735f707269766174652f636f6d7061726566696c65732f4275673639343239302e706466>.runfile", 
    length=132, user_errors=1, pexit_code=0x7fffffffd9ec, perror_object=0x7fffffffd9d0) at ./psi/imain.c:579
#15 0x000000000053560e in gs_main_run_string (minst=0x186e350, 
    str=0x1c35b60 "<2f686f6d652f6d6172636f732f636c75737465722f74657374735f707269766174652f636f6d7061726566696c65732f4275673639343239302e706466>.runfile", 
    user_errors=1, pexit_code=0x7fffffffd9ec, perror_object=0x7fffffffd9d0) at ./psi/imain.c:561
#16 0x0000000000538ca9 in run_string (minst=0x186e350, 
    str=0x1c35b60 "<2f686f6d652f6d6172636f732f636c75737465722f74657374735f707269766174652f636f6d7061726566696c65732f4275673639343239302e706466>.runfile", 
    options=3) at ./psi/imainarg.c:897
#17 0x0000000000538c2b in runarg (minst=0x186e350, pre=0xac9683 "", arg=0x7fffffffe9b9 "/home/marcos/cluster/tests_private/comparefiles/Bug694290.pdf", 
    post=0xac978d ".runfile", options=3) at ./psi/imainarg.c:887
#18 0x000000000053886c in argproc (minst=0x186e350, arg=0x7fffffffe9b9 "/home/marcos/cluster/tests_private/comparefiles/Bug694290.pdf") at ./psi/imainarg.c:811
#19 0x0000000000536dda in gs_main_init_with_args (minst=0x186e350, argc=7, argv=0x7fffffffe628) at ./psi/imainarg.c:233
#20 0x0000000000468a83 in main (argc=7, argv=0x7fffffffe628) at ./psi/gs.c:96
(gdb)
Comment 3 Chris Liddell (chrisl) 2013-06-19 07:50:49 UTC
Fixed in:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=fea396d5