[Mono-bugs] [Bug 47689][Wis] Changed - The runtime should detect stack overflow

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 10 Feb 2004 08:41:32 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vargaz@freemail.hu.

http://bugzilla.ximian.com/show_bug.cgi?id=47689

--- shadow/47689	2004-01-19 07:13:54.000000000 -0500
+++ shadow/47689.tmp.9744	2004-02-10 08:41:32.000000000 -0500
@@ -77,6 +77,31 @@
 
 ------- Additional Comments From vargaz@freemail.hu  2004-01-07 08:40 -------
 *** Bug 52654 has been marked as a duplicate of this bug. ***
 
 ------- Additional Comments From vargaz@freemail.hu  2004-01-19 07:13 -------
 *** Bug 53048 has been marked as a duplicate of this bug. ***
+
+------- Additional Comments From vargaz@freemail.hu  2004-02-10 08:41 -------
+The following issues should be dealt with when implementing 
+stack overflow handling:
+
+- The process is notified of stack overflow by receiving a SIGSEGV
+  signal. Since the signal handler also uses the stack, it will 
+  cause another SIGSEGV. The solution is to use the sigaltstack function
+  to setup an alternate signal stack. Unfortunately, there are some
+  issues with sigaltstack and pthreads:
+
+http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pthread+sigaltstack&btnG=Google+Search
+
+- The signal handler needs to determine whenever the SIGSEGV is caused
+  by a stack overflow. This can be done by comparing the fault
+  address with the boundaries of the current threads stack.
+  The fault address can be obtained from the arguments passed to the
+  signal handler, but this is OS dependent.
+
+GNU smalltalk contains a library called 'sigsegv' which contains
+portable support for SIGSEGV handling for a lot of systems, but it is
+GPL, while the mono runtime is LGPL.
+
+http://www.smalltalk.org/versions/GNUSmalltalk.html
+