Bug 689918 - Ghostscript 8.62 and 8.63 segmentation fault
Summary: Ghostscript 8.62 and 8.63 segmentation fault
Status: NOTIFIED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.62
Hardware: PC Linux
: P2 normal
Assignee: leonardo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-23 16:23 UTC by Leonid Lukomskij
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
L01-001-K-12345600-00DSG60k.pdf (13.30 MB, application/pdf)
2008-06-23 16:30 UTC, Leonid Lukomskij
Details
vg,txt (20.73 KB, text/plain)
2008-06-26 18:52 UTC, Alex Cherepanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Lukomskij 2008-06-23 16:23:03 UTC
Hello,

I tried to process pdf file via Ghostscript 8.62. It crashed. I tried 8.63svn -
it crashed too.

I have follows:

$ ../bin/gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=tiffsep -sOutputFile=l01.tif
L01-001-K-12345600-00DSG60k.pdf
GPL Ghostscript SVN PRE-RELEASE 8.63 (2008-03-01)
Copyright (C) 2008 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
Segmentation fault


Best regards

Leonid Lukomskij
Comment 1 Leonid Lukomskij 2008-06-23 16:30:43 UTC
Created attachment 4144 [details]
L01-001-K-12345600-00DSG60k.pdf

This is problem file
Comment 2 Ken Sharp 2008-06-24 00:22:32 UTC
This is possibly a duplicate of #689581 which is also a crash using tiffsep and
PDF files. The crash in that case is due to transparency and compressed colour
representation, I'm not certain if this file contains transparency, but its
moderately complicated, so I expect it may.

Note that 689581 appears to be a memory corruption problem, if this is the same
issue it may be difficult to reproduce. I could only reproduce with a release
build, not a debug build, under Windows.

Comment 3 Leonid Lukomskij 2008-06-24 04:46:47 UTC
I think this is not tiffsep problem. I have the same result with jpeg device:

$ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -sOutputFile=l01.tif
L01-001-K-12345600-00DSG60k.pdf
GPL Ghostscript 8.62 (2008-02-29)
Copyright (C) 2008 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
Segmentation fault

I tried this file with 8.61 and it was processed without problems
Comment 4 Alex Cherepanov 2008-06-25 16:08:07 UTC
I confirm that:
v. 8.61 renders the file correctly.
v. 8.62 crashes
current revision renders the file incorrectly but doesn't crash.

It would be great to find at what revision occurred the changes.


Comment 5 Alex Cherepanov 2008-06-26 17:47:55 UTC
The crash was introduced by the rev:
r8510 | leonardo | 2008-01-28 18:02:59 -0500 (Mon, 28 Jan 2008) | 28 lines
Fix (graphics) : Optimize filling a path with a shading color.

And fixed by the rev:
r8597 | leonardo | 2008-03-12 17:32:03 -0500 (Wed, 12 Mar 2008) | 13 lines
Fix (graphics) : Optimize filling a path with a shading color (continuewd 3).
Bug 689748 "gs segfaults".

I've applied the diff between rev. 8596 and 8597 to the rev. 8510. 
The resulting version doesn't crash but renders the file incorrectly.
This proves that rev. 8510 also introduced incorrect rendering.

Reassigning to the author of the patch.
Comment 6 Alex Cherepanov 2008-06-26 18:52:53 UTC
Created attachment 4161 [details]
vg,txt

Valgring reports quite a few warnings in the current build when it runs the
sample file. -dNOGC avoids GC-related warnings.
$ valgrind ./gs/debugobj/gs -dNOGC -dNOPAUSE -dBATCH -sDEVICE=bmp16m \
  -sOutputFile=/dev/null ../foo.pdf >vg.txt 2>&1
Comment 7 leonardo 2008-06-29 04:48:13 UTC
Sedtting P2 for a crashing bug.
Comment 8 leonardo 2008-07-27 09:05:25 UTC
Patch 
http://ghostscript.com/pipermail/gs-cvs/2008-July/008461.html
should fix nthe indeterminizm in cmd_write_trapezoid_cmd .
Comment 9 leonardo 2008-07-27 10:09:32 UTC
The incorrect rendering is moved to a new bug 689982 "A wrong shading raster". 
I'll close this one because there is no crash with current revision. Likely 
the crash was fixwd with r8597 (see Comment #5). See also Comment #8.