[Mono-list] Segmentation fault / StackOverflowException not thrown

Paolo Molaro lupus@ximian.com
Tue, 15 Jul 2003 15:16:12 +0200


On 07/11/03 Michael Levy wrote:
> shows the problem. The code basically causes a method (or property, depending
> on what you have un-commented) to recursivly call itsel until it blows the
> stack. I would expect that this sort of pathological recursion should generate 
> a StackoverflowException when executed, but it simpley causes a Segmentation fault.
> I have not been able to confirm this behaviour on Windows. I am using the lates
> release of mono (0.25).

Stack overflow detection is not yet implemented in the segmentation
fault signal handler and the current handler dies because there is no
more room in the stack for it to run. The fix is a bit tricky (using
sigaltstack and then checking if the segmentation fault was actually
caused by a stack overflow). Any volunteers?

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better