[gs-bugs] [Bug 692352] GS PDF conversion eats up and corrupts memory

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Wed Jul 27 17:39:50 UTC 2011


--- Comment #5 from Alex Cherepanov <alex.cherepanov at artifex.com> 2011-07-27 17:39:49 UTC ---
Created an attachment (id=7722)
 --> (http://bugs.ghostscript.com/attachment.cgi?id=7722)
experimental patch

The problem is caused by excessive memory allocation in .buildshading operator
and a large number of shadings in the sample file.

Running the shading in save-restore context solves the problem. The file runs
quickly and takes little memory. Unfortunately, this patch causes SEGV in
a few files from the regression suite, for instance:
gs -P -r72 -sDEVICE=pkmraw -o new.pkm  Bug689189.pdf

The crash appears to be related to premature freeing of the color space 
structure. Running with -dNOGC cures the crash.

There are other strange things related to smooth shading.
Normally, PDF interpreter caches the data generated by .buildshading .
Switching this function off doesn't help with memory allocation.
Apparently, the memory allocated by .buildshading cannot be reclaimed by GC.

Smooth shading has to copy shading data to a reusable stream.
This part of the code doesn't cause excessive memory usage or other problems.

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list