Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #875 > unrolled thread

The most severe ghostscript error I've been able to conjure so far

Started byluser- -droog <mijoryx@yahoo.com>
First post2012-08-12 20:56 -0700
Last post2012-08-22 03:31 -0700
Articles 5 — 3 participants

Back to article view | Back to comp.lang.postscript


Contents

  The most severe ghostscript error I've been able to conjure so far luser- -droog <mijoryx@yahoo.com> - 2012-08-12 20:56 -0700
    Re: The most severe ghostscript error I've been able to conjure so far tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-13 01:53 -0400
    Re: The most severe ghostscript error I've been able to conjure so far Helge Blischke <h.blischke@acm.org> - 2012-08-13 16:34 +0200
      Re: The most severe ghostscript error I've been able to conjure so far luser- -droog <mijoryx@yahoo.com> - 2012-08-13 15:14 -0700
    Re: The most severe ghostscript error I've been able to conjure so far luser- -droog <mijoryx@yahoo.com> - 2012-08-22 03:31 -0700

#875 — The most severe ghostscript error I've been able to conjure so far

Fromluser- -droog <mijoryx@yahoo.com>
Date2012-08-12 20:56 -0700
SubjectThe most severe ghostscript error I've been able to conjure so far
Message-ID<a1c4f2af-7003-4759-b464-d92be003a256@googlegroups.com>
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

[toc] | [next] | [standalone]


#878

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2012-08-13 01:53 -0400
Message-ID<1itysalawono9.34l42xkzmuuv$.dlg@40tude.net>
In reply to#875
On Sun, 12 Aug 2012 20:56:35 -0700 (PDT), luser- -droog wrote:

> Here it is. Kablooey!
> Look, you can see the flags!
> ...
> Unexpected interpreter error -17.
> ...
> shell returned 255
> ...
> Now, can anyone tell what I did wrong? ...

Let me be the first to holler, "Uncle!" :-) . Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.

[toc] | [prev] | [next] | [standalone]


#882

FromHelge Blischke <h.blischke@acm.org>
Date2012-08-13 16:34 +0200
Message-ID<a8shjbFj8pU1@mid.individual.net>
In reply to#875
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

[toc] | [prev] | [next] | [standalone]


#884

Fromluser- -droog <mijoryx@yahoo.com>
Date2012-08-13 15:14 -0700
Message-ID<9ac70658-5913-43a3-9372-049ceca25563@googlegroups.com>
In reply to#882
On Monday, August 13, 2012 9:34:16 AM UTC-5, Helge Blischke wrote:
> 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

Thanks, that clears up a bit of mystery.
This was all a sidebar to the real issue:
decomposing a matrix. I've posted the final
version to
http://stackoverflow.com/questions/11777305/postscript-discover-rotate-scale-value/11942636#11942636 .

The errordict idiom (*with* an object)
is probably the most portable since it is
part of the standard. But this seems acceptable, too.
Adobe's .error appears to do the same thing as
Ghostscript's signalerror. Don't know abut Jaws...

cat currot.ps
%!
%make Adobe-style interpreters mimic ghostscript's error call
/.error where { pop /signalerror {.error} def } if

%"Safe" seed randomizer
{ 0 4{ 8 bitshift (/dev/random)(r)file read pop add }repeat srand } stopped
{ usertime 10 { %can't open file, chop some vegetables
    save 128 string 99 2 getinterval 1 vmreclaim pop restore
              } repeat usertime 8 bitshift add srand } if

%translate, scale, rotate
% extracts rotation, scaling and translation parameters
% from the CTM (assuming it's "easy" to do)
%
%eg.
% PS> rand 100 mod          %get random number 0..99
% PS> { 1 rotate } repeat   %rotate
% PS> tsr 4 pop =           %print rotation angle
%
% -  tsr  theta Sx Sy Tx Ty
/tsr { {
    6 dict begin
    matrix currentmatrix % get CTM
    matrix defaultmatrix % get Default
    matrix invertmatrix  % get the "undo" of the Default
    matrix concatmatrix  % CTM * Default^-1 =  Default-->CTM
    aload pop % dump the matrix
    %exit
    /ty exch def
    /tx exch def
    /d exch def
    /c exch def
    /b exch def
    /a exch def % name the components
        a d ne
        b neg c ne or  %ie. not "Jacobian", not "conformal"
        { [ a b c d tx ty ] /tsr cvx /undefinedresult signalerror } if

        b a atan % theta
        a a mul b b mul add sqrt dup % Sx Sy (uniform scaling)
        tx ty % translation
    end
exit } loop } def

%1 2 scale resolve  %test error trigger
rand 100 mod
{ 1 rotate } repeat
rand 100 mod
{ rand 3 mod .5 add dup scale } repeat
tsr pstack

[toc] | [prev] | [next] | [standalone]


#894

Fromluser- -droog <mijoryx@yahoo.com>
Date2012-08-22 03:31 -0700
Message-ID<59625654-7077-48ae-8a7f-31b29cb4a4e8@googlegroups.com>
In reply to#875
On Sunday, August 12, 2012 10:56:35 PM UTC-5, 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
> 

I'm not picking on ghostscript here (much :). Xpost has the
same kind of C-level backup error handler that does a hex
dump. But it's not triggering for me at the moment.

But for the ps hackers, this kind of dump gives a lot of info
about how the objects are laid out in memory (= data-structure).
1 byte type, 1 byte flags, 1 short something, 1 long payload.
And there are hints that extra values in the type code are being
used for something else. I've never heard of a "mpry --G-rxe--"
in the PLRM.

-- 
insomnia+boredom=hyper-analytical

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web