Ghostscript head (r10626) can't open the attached file when built with our jbig2 decoder but does with the Luratech decoder. The command line I'm using for testing: bin/gs -sDEVICE=ppmraw -o test.ppm ./new_3.reg_c.pdf
Created attachment 5903 [details] new_3.reg_c.pdf
*** This bug has been marked as a duplicate of bug 690094 ***
Re-opening this bug, because coming fix makes original problem in 690094 re-visible. I make this a primary bug for "runlength too large in export symbol table" problem.
*** Bug 691206 has been marked as a duplicate of this bug. ***
This problem has been caused by accidently bound checking export symbol table size with number of non-export symbol. A fix has been committed as r11057. Closing.
Changing customer bugs that have been resolved more than a year ago to closed.
This problem still persists for me on a recent Ubuntu 12.04 system when using the "convert" command of the imagemagick library (which obviously relies on Ghostscript for PDF conversion). The end result is that PDFS with JBIG2-Images are not properly displayed in all applications which rely on certain libraries as you can see in this screenshot of evince displaying an affected PDF document: http://i.imgur.com/gBp5N.png Unfortunately, we have thousands of affectedPDF documents, which renders the whole PDF toolkit on Debian/Ubuntu unusable. The documents are displayed in Adobe Reader properly, on all major platforms. This is the error message I receive when using the PDF tools on commandline: $ convert a.pdf a.png **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. **** Warning: considering '0000000000 XXXXX n' as a free entry. jbig2dec FATAL ERROR decoding image: could not allocate image data buffer! [-195083301 bytes] jbig2dec FATAL ERROR decoding image: couldn't allocate reference image (segment 0x03) **** Warning: File has insufficient data for an image. jbig2dec FATAL ERROR decoding image: runlength too large in export symbol table (243 > 21 - 0) (segment 0x02) **** Error reading a content stream. The page may be incomplete. **** File did not complete the page properly and may be damaged. **** Warning: File has unbalanced q/Q operators (too many q's) jbig2dec FATAL ERROR decoding image: runlength too large in export symbol table (246 > 67 - 2) (segment 0x02) **** Warning: File has insufficient data for an image.
To put my last post in context of the previous bug report by Marcos Woehrmann, I ran the same command on my PDF file, which resulted in the same error message: $ gs -sDEVICE=ppmraw -o test.ppm ./2.2_ocr.pdf GPL Ghostscript 9.05 (2012-02-08) 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 34. Page 1 Loading NimbusSanL-Regu font from /usr/share/fonts/type1/gsfonts/n019003l.pfb... 2643628 1308258 4175636 2866323 3 done. Page 2 jbig2dec FATAL ERROR decoding image: could not allocate image data buffer! [-195083301 bytes] jbig2dec FATAL ERROR decoding image: couldn't allocate reference image (segment 0x03) **** Warning: File has insufficient data for an image. Loading NimbusSanL-Bold font from /usr/share/fonts/type1/gsfonts/n019004l.pfb... 2740864 1414672 5682436 4369131 3 done. Page 3 jbig2dec FATAL ERROR decoding image: runlength too large in export symbol table (243 > 21 - 0) (segment 0x02) **** Error reading a content stream. The page may be incomplete. **** File did not complete the page properly and may be damaged. **** Warning: File has unbalanced q/Q operators (too many q's) Page 4 jbig2dec FATAL ERROR decoding image: runlength too large in export symbol table (246 > 67 - 2) (segment 0x02) **** Warning: File has insufficient data for an image. Loading NimbusRomNo9L-Regu font from /usr/share/fonts/type1/gsfonts/n021003l.pfb... 2885108 1569748 4322860 3018277 3 done. Loading NimbusSanL-ReguItal font from /usr/share/fonts/type1/gsfonts/n019023l.pfb... 2982156 1657246 4460100 3141740 3 done. Page 5 jbig2dec FATAL ERROR decoding image: runlength too large in export symbol table (329 > 82 - 0) (segment 0x02) **** Error reading a content stream. The page may be incomplete. **** File did not complete the page properly and may be damaged. **** Warning: File has unbalanced q/Q operators (too many q's) Page 6 Loading NimbusSanL-BoldItal font from /usr/share/fonts/type1/gsfonts/n019024l.pfb... 3119772 1784079 4346204 3032786 3 done. ^C
(In reply to comment #7) > This problem still persists for me on a recent Ubuntu 12.04 system when using > the "convert" command of the imagemagick library (which obviously relies on > Ghostscript for PDF conversion). > > The end result is that PDFS with JBIG2-Images are not properly displayed in all > applications which rely on certain libraries as you can see in this screenshot > of evince displaying an affected PDF document: http://i.imgur.com/gBp5N.png > > Unfortunately, we have thousands of affectedPDF documents, which renders the > whole PDF toolkit on Debian/Ubuntu unusable. The documents are displayed in > Adobe Reader properly, on all major platforms. As far as I'm aware, the specimen file attached to this report *does* render correctly, which is why this bug is closed. It is, of course, entirely possible that you have uncovered another very similar bug. However, without a sample file we cannot tell. The first thing I would suggest is that you get hold of the latest copy of Ghostscript (9.06) and build it from source *without* using shared libraries. I am uncertain if the Ubuntu Ghostscript package uses jbig2dec as a shared library or not (though I suspect it does), but if it does the fact that we have fixed jbig2dec will not be reflected in a newer version of Ghostscript, if it is still loading an old version of the jbig2 decoder because an old version of jbig2dec has been packed by the distributor. If you build from source, using the library code we supply rather than system shared libraries, you will be running the same code we have here. Your later example helpfully supplies a Ghostscript command line rather than a 'convert' invocation. This is most helpful, thank you! If you do open a bug report (see below) please do give us a Ghostscript command line to work with, its much easier for us. If the problem persists, then I would suggest you open a new bug (rather than reopening this one) and attach a sample file there so that we can properly investigate the problem. If you cannot share a document publicly we can give you instructions on providing one privately.
Ken, thanks for the kind insight you provided. In retrospect, I should have installed the current version of GS way before creating noise on this bug report - the issue has been fixed by compiling GS version 9.05 on my Ubuntu system as described in http://askubuntu.com/a/86524 . I'm very happy about this, but also a bit embarrassed: After noticing that this bug has been closed in Sept 2011, I imagined this very change has already found its way into the latest version of Ubuntu. Again, thank you very much for your help and keep up the good work. I'm going to compile the latest GS on a few more systems now :)
I also compiled and 'make install'ed the gs 9.06, following instruction here: http://askubuntu.com/a/86524 It worked! My system is Ubuntu (Lucid) 10.04 LTS.