Entware / Entware-ng

Entware-ng
GNU General Public License v2.0
1.21k stars 152 forks source link

rtndev\ghostscript execstackoverflow in .findfont #169

Closed futurechild closed 8 years ago

futurechild commented 8 years ago

ghostscript (at least for me) is unable to process pdf files with text content, pdf's without text work as expected. This is on a clean installation of entware-ng with ghostscript, ghostscript-fonts-std, ghostscript-gnu-gs-fonts-other.

`ASUSWRT-Merlin RT-AC68U_3.0.0.4 Thu Dec 24 18:54:10 UTC 2015 admin@router:/tmp/home/root# gs /opt/share/ghostscript/9.16/examples/annots.pdf GPL Ghostscript 9.16 (2015-03-30) Copyright (C) 2015 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details.

*\ Warning: GenericResourceDir doesn't point to a valid resource directory. the -sGenericResourceDir=... option can be used to set this.

Processing pages 1 through 6. Page 1 Can't find (or can't open) font file /opt/share/ghostscript/9.10/Resource/Font/ArialMT. Can't find (or can't open) font file ArialMT. Can't find (or can't open) font file /opt/share/ghostscript/9.10/Resource/Font/ArialMT. Can't find (or can't open) font file ArialMT. Querying operating system for font files... destroyed state - fontconfig init failedDidn't find this font on the system! Substituting font Helvetica for ArialMT. Can't find (or can't open) font file /opt/share/ghostscript/9.10/Resource/Font/NimbusSan-Reg. Loading NimbusSan-Reg font from /opt/share/ghostscript/9.16/Resource/Font/NimbusSan-Reg... Can't find (or can't open) font file /opt/share/ghostscript/9.10/Resource/Font/--nostringval--. Can't find font with non-string name: --nostringval--. Didn't find this font on the system! Substituting font Courier for --nostringval--. Can't find (or can't open) font file /opt/share/ghostscript/9.10/Resource/Font/NimbusMon-Reg. Loading NimbusMon-Reg font from /opt/share/ghostscript/9.16/Resource/Font/NimbusMon-Reg... Can't find (or can't open) font file /opt/share/ghostscript/9.10/Resource/Font/--nostringval--. Can't find font with non-string name: --nostringval--. Didn't find this font on the system!

<-- Snip -->

Substituting font Times-Roman for --nostringval--. Unrecoverable error: execstackoverflow in .findfont Operand stack: --nostringval-- --nostringval-- 0.999999 1.0 --nostringval-- Arial 12 FontObject --nostringval-- --nostringval-- Arial Arial Font Arial 28852576 Arial --nostringval-- Arial ArialMT ArialMT Helvetica Font Helvetica 28858138 Helvetica --nostringval-- Helvetica NimbusSan-Reg NimbusSan-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusSan-Reg false --nostringval-- --nostringval-- NimbusSan-Reg --nostringval-- Courier Font Courier 28967917 Courier --nostringval-- Courier NimbusMon-Reg NimbusMon-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusMon-Reg false --nostringval-- --nostringval-- NimbusMon-Reg --nostringval-- Courier Font Courier 29113498 Courier --nostringval-- Courier NimbusMon-Reg NimbusMon-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusMon-Reg false --nostringval-- --nostringval-- NimbusMon-Reg --nostringval-- Courier Font Courier 29262455 Courier

<-- Snip -->

Unexpected interpreter error -5. Error object: (1488)op_array(1827)0x1381968:.findfont Operand stack at 0x135e600: 0x1347390: 0x0c mark -nF------ 0x0000 0x015e0001 0x13473a0: 0x02 dict -nLwrx--- 0x0000 0x015ebd38 0x13473b0: 0x10 real -nF------ 0x0000 0x3f7fffea = 0.999999 0x13473c0: 0x10 real -nF------ 0x0000 0x3f800001 = 1.0 0x13473d0: 0x02 dict -nLwrx--- 0x0000 0x015ebd38 0x13473e0: 0x0d name -nS------ 0x080a 0x0139af80 = Arial 0x13473f0: 0x0b int -nF------ 0x0000 0x0000000c = 12

<-- Snip -->

Unrecoverable error: execstackoverflow in .findfont Operand stack: --nostringval-- --nostringval-- 0.999999 1.0 --nostringval-- Arial 12 FontObject --nostringval-- --nostringval-- Arial Arial Font Arial 28852576 Arial --nostringval-- Arial ArialMT ArialMT Helvetica Font Helvetica 28858138 Helvetica --nostringval-- Helvetica NimbusSan-Reg NimbusSan-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusSan-Reg false --nostringval-- --nostringval-- NimbusSan-Reg --nostringval-- Courier Font Courier 28967917 Courier --nostringval-- Courier NimbusMon-Reg NimbusMon-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusMon-Reg false --nostringval-- --nostringval-- NimbusMon-Reg --nostringval-- Courier Font Courier 29113498 Courier --nostringval-- Courier NimbusMon-Reg NimbusMon-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusMon-Reg false --nostringval-- --nostringval-- NimbusMon-Reg --nostringval-- Courier Font Courier 29262455 Courier --nostringval-- Courier NimbusMon-Reg NimbusMon-Reg /opt/share/ghostscript/9.16/Resource/Font/NimbusMon-Reg false --nostringval-- --nostringval-- NimbusMon-Reg --nostringval-- Courier Font Courier 294145

<-- Snip -->

`

futurechild commented 8 years ago

The following changes seem so solve the above issue: Makefile: from:--with-fontpath=/opt/share/fonts/ghostscript/fonts/:/opt/share/ghostscript/9.06/Resource/Font/ to:--with-fontpath=/opt/share/fonts/ghostscript/fonts/:/opt/share/ghostscript/9.16/Resource/Font/

files/gs: from:GS_LIB=/opt/share/ghostscript/9.10/Resource exec /opt/bin/gs.orig "$@" to:GS_LIB=/opt/share/ghostscript/9.16/Resource exec /opt/bin/gs.orig "$@"

ryzhovau commented 8 years ago

Thanks for PR! New binaries will arrive soon.