Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Helge Blischke Newsgroups: comp.lang.postscript Subject: Re: The most severe ghostscript error I've been able to conjure so far Followup-To: comp.lang.postscript Date: Mon, 13 Aug 2012 16:34:16 +0200 Lines: 145 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: individual.net N/daFIxIlMf7V8d3VLVtpAUy7LBjh3jBu1Y6vUa8AEGeIGC1LCbP1gVSHMg+n0Kvw8 Cancel-Lock: sha1:Nm8M+wU3sHj9IIYMVicLEHBlbfE= User-Agent: KNode/0.99.01 Xref: csiph.com comp.lang.postscript:882 luser- -droog wrote: > Here it is. Kablooey! > Look, you can see the flags! > > 520(1)10:35 PM:ps 0> vi currot.ps > > GPL Ghostscript 8.62 (2008-02-29) > Copyright (C) 2008 Artifex Software, Inc. All rights reserved. > This software comes with NO WARRANTY: see the file PUBLIC for details. > Unrecoverable error: stackunderflow in exch > Operand stack: > --nostringval-- > > Unexpected interpreter error -17. > Error object: (f80)op(4:exch)0xb787ba60 > Operand stack at 0x8f68fb8: > 0x8f5d5e4: 0x02 dict --Lwrx--- 0x0018 0x08f5acf8 > Execution stack at 0x8f68f7c: > 0x8f5ef4c: 0x0f oper --F---e-- 0x0000 0xb785e800 = %interp_exit > 0x8f5ef54: 0x0d name --S---e-- 0x0307 0x08f4cd98 = .runexec2 > 0x8f5ef5c: 0x03 file --S-rx--- 0x0001 0x08faa328 > 0x8f5ef64: 0x05 mpry --G-rxe-- 0x0006 0x08f8202c > 0x8f5ef6c: 0x0e null --F---e-- 0x0003 0xb786e480 > 0x8f5ef74: 0x0e null --F------ 0xbffc 0xbffc2ff8 > 0x8f5ef7c: 0x0b int --F------ 0x0002 0x00000002 = 2 > 0x8f5ef84: 0x0f oper --F---e-- 0x0000 0xb786e410 = %stopped_push > 0x8f5ef8c: 0x03 file --S-rxe-- 0x0001 0x08faa328 > 0x8f5ef94: 0x05 mpry --G-rxe-- 0x0002 0x08f82aec > 0x8f5ef9c: 0x05 mpry --G-rxe-- 0x0007 0x08f82ac0 > 0x8f5efa4: 0x0e null --F---e-- 0x0003 0xb786e480 > 0x8f5efac: 0x01 bool --F------ 0x0001 0x08fa0000 = false > 0x8f5efb4: 0x0b int --F------ 0x0000 0x00000001 = 1 > 0x8f5efbc: 0x0f oper --F---e-- 0x0000 0xb786e410 = %stopped_push > 0x8f5efc4: 0x0e null --F---e-- 0x0000 0xb785ead0 > 0x8f5efcc: 0x0b int --F------ 0x0000 0x00000771 = 1905 > 0x8f5efd4: 0x0b int --F------ 0x0000 0x00000001 = 1 > 0x8f5efdc: 0x0b int --F------ 0x0000 0x00000003 = 3 > 0x8f5efe4: 0x0f oper --F---e-- 0x0000 0xb785e810 = %oparray_pop > 0x8f5efec: 0x0e null --F---e-- 0x0000 0xb785ead0 > 0x8f5eff4: 0x0b int --F------ 0x0005 0x00000770 = 1904 > 0x8f5effc: 0x0b int --F------ 0x0002 0x00000001 = 1 > 0x8f5f004: 0x0b int --F------ 0x0000 0x00000003 = 3 > 0x8f5f00c: 0x0f oper --F---e-- 0x0000 0xb785e810 = %oparray_pop > 0x8f5f014: 0x0e null --F---e-- 0x0000 0xb785ead0 > 0x8f5f01c: 0x0b int --F------ 0x0000 0x00000760 = 1888 > 0x8f5f024: 0x0b int --F------ 0x0000 0x00000001 = 1 > 0x8f5f02c: 0x0b int --F------ 0x0003 0x00000003 = 3 > 0x8f5f034: 0x0f oper --F---e-- 0x0000 0xb785e810 = %oparray_pop > 0x8f5f03c: 0x0e null --F---e-- 0x0000 0xb785ead0 > 0x8f5f044: 0x0b int --F------ 0x0002 0x000006eb = 1771 > 0x8f5f04c: 0x0b int --F------ 0x000e 0x00000001 = 1 > 0x8f5f054: 0x0b int --F------ 0x0000 0x00000003 = 3 > 0x8f5f05c: 0x0f oper --F---e-- 0x0000 0xb785e810 = %oparray_pop > 0x8f5f064: 0x0e null --F---e-- 0x0000 0xb785e860 > 0x8f5f06c: 0x0e null --F------ 0xbffc 0xbffc2ff8 > 0x8f5f074: 0x0f oper --F---e-- 0x0000 0xb785e840 = %errorexec_pop > 0x8f5f07c: 0x0d name --S---e-- 0x0307 0x08f4cd98 = .runexec2 > 0x8f5f084: 0x03 file --S-rx--- 0x0001 0x08faa418 > 0x8f5f08c: 0x05 mpry --G-rxe-- 0x0006 0x08f8202c > 0x8f5f094: 0x0e null --F---e-- 0x0003 0xb786e480 > 0x8f5f09c: 0x0e null --F------ 0xbffc 0xbffc2ff8 > 0x8f5f0a4: 0x0b int --F------ 0x0002 0x00000002 = 2 > 0x8f5f0ac: 0x0f oper --F---e-- 0x0000 0xb786e410 = %stopped_push > 0x8f5f0b4: 0x03 file --S-rxe-- 0x0001 0x08faa418 > 0x8f5f0bc: 0x04 arry -nLwrxe-- 0x0001 0x09187d80 > 0x8f5f0c4: 0x0e null --F---e-- 0x0002 0xb786e480 > 0x8f5f0cc: 0x04 arry -nLwrxe-- 0x000a 0x09187bf4 > 0x8f5f0d4: 0x0f oper --F---e-- 0x0000 0xb786e3d0 = %loop_continue > 0x8f5f0dc: 0x05 mpry --G-rxe-- 0x002a 0x08f82f98 > 0x8f5f0e4: 0x05 mpry --G-rxe-- 0x003f 0x08f82f6e > Dictionary stack at 0x8f68f24: > 0x8f68bec: 0x02 dict --Gwrx--- 0x0000 0x08f4f73c > 0x8f68bf4: 0x02 dict --Gwrx--- 0x0000 0x08fadb60 > 0x8f68bfc: 0x02 dict --Lwrx--- 0x0000 0x08f59ea8 > 0x8f68c04: 0x02 dict -nLwrx--- 0xb787 0x09187e1c > > shell returned 255 > > Press ENTER or type command to continue > > > Now, can anyone tell what I did wrong? > I'll wait 24 hours before saying what I think. > We'll make a little contest out of it. > Related question: What's the "correct" way > to explicitly invoke the error mechanism? > > > %! > > /resolve { > 6 dict begin > matrix currentmatrix > matrix defaultmatrix > matrix invertmatrix > matrix concatmatrix aload pop > /ty exch def > /tx exch def > /d exch def > /c exch def > /b exch def > /a exch def > { > a d ne > b neg c ne or > { errordict /undefinedresult get exec } if > } loop > end > } def > > 1 2 scale > resolve I replaced the line { errordict /undefinedresult get exec } if by {(this is an object) errordict/undefinedresult get exec} if and got the result Error: /undefinedresult in (this is an object) Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- -- nostringval-- 2 %stopped_push --nostringval-- --nostringval-- -- nostringval-- false 1 %stopped_push 1941 1 3 %oparray_pop 1835 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push -- nostringval-- --nostringval-- --nostringval-- %loop_continue Dictionary stack: --dict:1181/1684(ro)(G)-- --dict:0/20(G)-- --dict:80/200(L)-- -- dict:6/6(L)-- Current allocation mode is local Last OS error: 2 Current file position is 594 GPL Ghostscript 9.05: Unrecoverable error, exit code 1 BTW, the "correct" way of calling the error handler with Ghostscript is error_object /error_name signalerror . Helge