How to guard against inifinte loops?

When GtProcessStackOverflowChecker Object subclass: #GtProcessStackOverflowChecker instanceVariableNames: 'process watcherProcess depth' classVariableNames: 'CurrentCheckerClass' package: 'GToolkit-Utility-StackOverflow' is installed on a process, it raises an exception when it detects GtStackOverflowError Error subclass: #GtStackOverflowError instanceVariableNames: '' classVariableNames: '' package: 'GToolkit-Utility-StackOverflow' . See the example below.

testStackOverflow
	<gtExample>

	GtStackOverflowChecker suspendStackOverflowWatchersDuring: 
		[ | end overflowed |
		overflowed := false.
		GtProcessStackOverflowChecker startForProcess: Processor activeProcess.
		end := DateAndTime now + 2 seconds.
		[self recurseUntil: [DateAndTime now > end]] 
			on: GtStackOverflowError
			do: [overflowed := true].
		self assert: overflowed]