PR# 14648 Stack overflow in 'match_object'.

Problem Report Summary
Submitter: randyjohn
Category: Runtime
Priority: Low
Date: 2008/07/22
Class: Bug
Severity: Non-critical
Number: 14648
Release: 6.2.7.3753
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1; .NET CLR 3.0.04506.648)
Synopsis: Stack overflow in 'match_object'.

Description
Because objects are traversed recursively in 'match_object', it is possible to get a stack overflow.  All of my tests were done with 64-bit W_Code.  With a 5,000,000 byte stack (our default) and each call frame requiring just under 100 bytes, any set of linked objects with more than about 50,000 elements will cause a stack overflow (53,000 in practice).  A straight list is not a requirement.  When it happened to me, I was using a tree-like structure which could be traversed using a depth of no more than 26, but other traversal paths were possible.  Apparently, one of those was used by 'match_object'.  The solution, of course, is to use a non-recursive algorithm.  My current work-around is to increase the stack to 50,000,000.

As an aside, EStudio sometimes (always?) simply exits the program when the stack overflow occurs.  No error message!

   Randy
To Reproduce
class ROOT

inherit
	MEMORY

create
	make

feature

	make is
	local
		i: INTEGER
		l_list: LINKED_LIST[STRING]
	do
		create l_list.make
		from
			i := 1
		until
			i>53000  -- 52000 works OK.
		loop
			l_list.put_front(Void)
			i := i + 1
		end

		memory_count_map.do_nothing
		print("Press RETURN ")			-- This code is sometimes not reached in EStudio.
		io.read_line
	end

end
Problem Report Interactions