Bug 312719 (MONO47689) - The runtime should detect stack overflow
Summary: The runtime should detect stack overflow
Status: RESOLVED MOVED
Alias: MONO47689
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-17 22:55 UTC by Juergen
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:14:22 UTC


---- Reported by pumrs@web.de 2003-08-17 15:55:26 MST ----

Please fill in this template when reporting a bug, unless you know what you are doing. 
Description of Problem: 
 
 
Steps to reproduce the problem: 
1. write ASPX-page like this: 
<%@ Page Language="C#" %> 
<HTML> 
<Body> 
<script language="C#" runat="Server"> 
  public class buggie{ 
    string m_hugo = ""; 
    public string hugo{ 
	 set{hugo = value;} } 
  } 
</Script> 
<% buggie bg = new buggie(); 
   bg.hugo = "oh, a bug"; 
%> 
</body> 
</html> 
2. open this page with XSP 
3.  
 
Actual Results: 
XSP stops with Memory Access Failure 
 
Expected Results: 
Error message in compiler or at runtime in in XSP 
 
How often does this happen?  
every time 
 
Additional Information:



---- Additional Comments From gonzalo@ximian.com 2003-08-18 05:50:38 MST ----

Another test case:

class C
{
    int Prop {
        set { Prop = value; }
    }

    static void Main ()
    {
         C c = new C ();
         c.Prop = 1;
    }
}





---- Additional Comments From vargaz@freemail.hu 2003-09-28 09:32:44 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO46612 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@freemail.hu 2004-01-07 08:39:52 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO52653 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@freemail.hu 2004-01-07 08:40:07 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO52654 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@freemail.hu 2004-01-19 07:13:53 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO53048 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@freemail.hu 2004-02-10 08:41:31 MST ----

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




---- Additional Comments From vargaz@freemail.hu 2004-02-10 08:56:49 MST ----

libsigsegv home page:

http://sourceforge.net/projects/libsigsegv/



---- Additional Comments From vargaz@freemail.hu 2004-02-18 16:37:43 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO54552 has been marked as a duplicate of this bug. ***



---- Additional Comments From gonzalo@ximian.com 2004-02-18 22:45:35 MST ----

Notice that csc does NOT compile the code in https://bugzilla.novell.com/show_bug.cgi?id=MONO54552. It says
something like:
CS0516: constructor 'C.C(int)' cannot call itself

so there's a bug in the compiler too.



---- Additional Comments From bmaurer@users.sf.net 2004-02-19 13:37:52 MST ----

Thanks for catching this, Gonzalo!



---- Additional Comments From bmaurer@users.sf.net 2004-02-19 13:38:51 MST ----

Ack, i got the wrong bug, sorry



---- Additional Comments From vargaz@freemail.hu 2004-02-23 10:04:17 MST ----

Stack overflow handling is now implemented on x86/linux.



---- Additional Comments From vargaz@freemail.hu 2004-03-10 18:11:27 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO55442 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@freemail.hu 2004-07-30 06:54:26 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO62115 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@gmail.com 2004-10-21 15:21:38 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO68639 has been marked as a duplicate of this bug. ***



---- Additional Comments From bmaurer@users.sf.net 2004-11-29 13:23:48 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO69958 has been marked as a duplicate of this bug. ***



---- Additional Comments From danielmorgan@verizon.net 2005-01-08 22:24:10 MST ----

StackOverFlowException still not implemented on Win32?

In Mono 1.1.3 and Mono 1.0.5 on Win32, a StackOverFlowException is not
thrown; Mono just exits.

// recursiontest.cs - test for StackOverlowException
using System;

class RecursionTest 
{
	public static void DoTest () 
	{
		DoTest ();
	}

	public static void Main (string[] args) 
	{
		DoTest ();
	}
}




---- Additional Comments From vargaz@gmail.com 2005-03-18 11:35:41 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO73841 has been marked as a duplicate of this bug. ***



---- Additional Comments From bmaurer@users.sf.net 2005-05-30 11:35:50 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO75099 has been marked as a duplicate of this bug. ***



---- Additional Comments From bmaurer@users.sf.net 2005-06-24 22:30:56 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO75376 has been marked as a duplicate of this bug. ***



---- Additional Comments From bmaurer@users.sf.net 2005-07-17 21:43:31 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO75571 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@gmail.com 2005-08-18 09:32:52 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO75842 has been marked as a duplicate of this bug. ***



---- Additional Comments From patrik.torstensson@gmail.com 2005-09-15 08:05:35 MST ----

Stack overflow is now handled for win32 in svn. 

One problem still exists, the current stack overflow code doesn't 
install any new guard page that makes multiple stack overflows to 
fail (for the same thread stack).



---- Additional Comments From miguel@ximian.com 2006-10-06 20:19:35 MST ----

This is now supported on platforms and builds that support it.

Clsoing. 



---- Additional Comments From vargaz@gmail.com 2006-10-07 07:56:54 MST ----

I think we should keep this open, as lots of platforms still don't
support it.




---- Additional Comments From lupus@ximian.com 2006-11-25 14:05:41 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO79782 has been marked as a duplicate of this bug. ***



---- Additional Comments From vargaz@gmail.com 2007-08-01 06:18:04 MST ----



*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO81685 ***


Unknown operating system unknown. Setting to default OS "Other".
This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"