Bug 690209 - Stack overflow in procedure definition causes /undefined error
Summary: Stack overflow in procedure definition causes /undefined error
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: master
Hardware: PC Windows NT
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-19 19:17 UTC by Alex Cherepanov
Modified: 2009-02-07 22:07 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
zero.ps.gz - sample program (235 bytes, application/gzip)
2008-12-19 19:19 UTC, Alex Cherepanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Cherepanov 2008-12-19 19:17:40 UTC
An attempt to define a procedure that exceeds 64K elementc
causes /undefined error and a low level stack dump instead of
the normal /stackoverflow .
Comment 1 Alex Cherepanov 2008-12-19 19:19:23 UTC
Created attachment 4665 [details]
zero.ps.gz - sample program
Comment 2 Alex Cherepanov 2009-02-07 15:59:01 UTC
Correct handling of the operand stack overflow requires one more element.
So the maximum operand stack size should be reduced by 1 element
relatively to the size set by rev. 6889 for the bug 688764.


Index: gs/Resource/Init/gs_init.ps
===================================================================
--- gs/Resource/Init/gs_init.ps	(revision 9454)
+++ gs/Resource/Init/gs_init.ps	(working copy)
@@ -209,7 +209,7 @@
 	% during initialization.
   /MaxDictStack 500
   /MaxExecStack 5000
-  /MaxOpStack 65414
+  /MaxOpStack 65413
   .dicttomark .setuserparams
 } if
 
Comment 3 Alex Cherepanov 2009-02-07 22:07:40 UTC
The patch is committed as a rev. 9456.

CET 27-05.ps, page 1 prints /MaxOpStack value and shows different result.