I've used the Scribus DTP program to generate one fairly simple PDF with an image, another with an image containing an imagemask. I've attached both. Having used Acroread 7 (on Linux) to print them as Lvl 2 postscript files, I tried to do a ps2ps on them. ps2ps works fine on the one without a mask, on the one containing the (pdf)imagemask, it dies with: mcornils@asus:~/imagemask$ ps2ps imagemask-acroprint.ps imagemask-acrops2ps.ps Error: /VMerror in --.imagemask1-- VM status: 2 922113 2256740 Current allocation mode is local Last OS error: 2 Current file position is 59458 AFPL Ghostscript 8.53: Unrecoverable error, exit code 1 Ugh!? VMError? I'll attach both the PDF files generated by Scribus and the ugly mess called "Postscript file" generated from that by Acroread 7, with and without the problem (the imagemask). My skills reading Postscript are not good enough to get closer to solving this bug, unfortunately.
Created attachment 1853 [details] Generated by Acroread 7, causes ps2ps to die on it
Created attachment 1854 [details] Similar Acrobat 7-generated file, this time with just an image, not an imagemask. Works fine with ps2ps.
Created attachment 1855 [details] Original PDF as exported from Scribus, way more readable, containing a masked image.
Created attachment 1856 [details] Original PDF as exported from Scribus, way more readable, NOT containing a masked image.
This is another case of an excessively big pattern cell but the fix the bug 687434 is ineffective here. All corners of the pattern BBox fall on the page and the BBox remains unchanged, which causes an attempt to allocate 3GB for the pattern accumulator. Perhaps, Ghostscript can implement an unbuffered pattern rendering or modify the pattern paint function to have a single pattern cell per page for big patterns.
*** This bug has been marked as a duplicate of 688396 ***