Bug 690209

Summary: Stack overflow in procedure definition causes /undefined error
Product: Ghostscript Reporter: Alex Cherepanov <alex>
Component: PS InterpreterAssignee: Alex Cherepanov <alex>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Windows NT   
Customer: Word Size: ---
Attachments: zero.ps.gz - sample program

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.