See Ubuntu bug report https://bugs.launchpad.net/bugs/281419 The reporter complains that ps2ascii (Ghostscript wrapper script to extract the text out of a PostScript file) doe not work any more in Ghostscript 8.63. The script crashes with the following error, independent of the input file: ------------------------------------------------------------------------------ Username@Kubuntu:~$ ps2ascii Error: /rangecheck in --put-- Operand stack: --nostringval-- false setshared .inew --nostringval-- --nostringval-- 1500 --nostringval-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1904 2 3 %oparray_pop 1903 2 3 %oparray_pop 1887 2 3 %oparray_pop 1771 2 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- Dictionary stack: --dict:1163/1684(G)-- --dict:0/20(G)-- --dict:94/200(L)-- --dict:1163/1684(G)-- Current allocation mode is global Current file position is 8319 GPL Ghostscript 8.63: Unrecoverable error, exit code 1 ------------------------------------------------------------------------------ I have tried to fix/work around it by removing the "-dDELAYBIND" command line option from the Ghostscript command line by editing the /usr/bin/ps2ascii script appropriately. It worked for me (I tried only 2 files), but the reporter tells that Ghostscript segfaults then. The reporter then replaced "-dDELAYBIND" by "-dNOBIND" then and was successful with all his files then. WDYT? Is this a viable fix? I am very grateful for a quick answer, as tomorrow, Thursday, October 16, Ubuntu Intrepid has release freeze.
I cannot reproduce this problem in the current revision on Win32 or x86 Linux.
I can't duplicate this either. I'm using Ubuntu 8.04 on an amd64 system with Ghostscript 8.63.
I cannot reproduce with 8.63 or HEAD on x86_64 Ubuntu 8.04, nor with HEAD on Ubuntu 8.10. I can reproduce with the gs executable shipping with Ubuntu 8.10. So the culprit is likely one of the patches the Ubuntu applies in their package.
Ok, I've confirmed using the ubuntu intrepid source package ghostscript_8.63.dfsg.1-0ubuntu5: ./configure && make bin/gs -Ilib -q -dNODISPLAY -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE -c stop -f lib/ps2ascii.ps examples/alphabet.ps -c quit [...works...] rm -rf bin obj debian/rules patch [add -lpaper to EXTRALIBS in the makefile] ./configure && make bin/gs -Ilib -q -dNODISPLAY -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE -c stop -f lib/ps2ascii.ps examples/alphabet.ps -c quit Error: /rangecheck in --put-- So the culprit is indeed one of the patches, and it's not our bug. If you want help sorting this problem, it would help to at least track down which patch is responsible.
I have found the patch which is the culprit: It is the patch debian/patches/11_gs-cjk_font_glyph_handling_fix, which seems to add a complete CJK handling subsystem. Can you check this patch and perhaps find out if it is still needed and if so, if you could fix it. Can you also check the need of debian/patches/12_gs-cjk_vertical_writing_metrics_fix?
Please provide URLs to the patches or attach them to the bug report.
Created attachment 4514 [details] 11_gs-cjk_font_glyph_handling_fix.dpatch Patch to add advanced CJK support. This patch causes this bug.
Created attachment 4515 [details] 12_gs-cjk_vertical_writing_metrics_fix.dpatch Additional patch for vertical CJK printing
Created attachment 4516 [details] 13_gs-cjk_cjkps_examples.dpatch Patch which adds test files for the above two patches
Created attachment 4519 [details] patch Extend the size of the array for procedures scheduled for binding in the DELAYBIND mode to 2000. Prevent an overflow when 3rd party code (such as Ubuntu CJKV patch) defines and binds many procedures.
The patch is committed as a rev. 9174. DELAYBIND mode is not covered by regression testing. Regressions cannot happen.
I have checked and it works. Text extraction works perfectly now for me with both PostScript and PDF input file.