Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

Stack overflow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mikhail Pilin - 12 Sep 2005 08:59 GMT
I have got .NET application which has been compiled under Visual Studio 2005
Beta 2. It is absolutely correctly wotk under v2.0.50215 framework under
Windows XP for IA32. I have got the stack overflow problem when I try to run
this application under Windows 2003-64 for AMD64. How can run my application
under AMD64?
Willy Denoyette [MVP] - 12 Sep 2005 12:43 GMT
By attaching a debugger and inspecting your call stack, stack overflow is an
indication the you recurse too deeply, that it works on 32 bit windows is no
guarantee that it works on 64 bit OSses, the stack is still a scarse
resource and the number of slots taken per stack frame is larger than on 32
bit windows (the number of caller-saved register is much larger).
Note that i v2.0 you can allocate more stack space for your threads using
the Thread constructor overload with maxStackSize argument.

Willy.

>I have got .NET application which has been compiled under Visual Studio
>2005 Beta 2. It is absolutely correctly wotk under v2.0.50215 framework
>under Windows XP for IA32. I have got the stack overflow problem when I try
>to run this application under Windows 2003-64 for AMD64. How can run my
>application under AMD64?
Mikhail Pilin - 12 Sep 2005 13:08 GMT
Thank you very much for you answer, but could you tell me how much stack
size is for AMD64 platforms by default? How can increase stack size in .NET
applications if I do not have sources for them?

> By attaching a debugger and inspecting your call stack, stack overflow is
> an indication the you recurse too deeply, that it works on 32 bit windows
[quoted text clipped - 11 lines]
>>try to run this application under Windows 2003-64 for AMD64. How can run
>>my application under AMD64?
Willy Denoyette [MVP] - 12 Sep 2005 16:46 GMT
Not sure how much it is in v2.0, but I guess "stack reserve" is still 1MB
per thread.
The stack size can be specified for threads created in your application by
using the Thread constructor overload that takes a second maxStackSize
argument. The main thread stack size can be changed using the (Win64) PSDK's
tool Editbin.exe (see /STACK option).

Willy.

> Thank you very much for you answer, but could you tell me how much stack
> size is for AMD64 platforms by default? How can increase stack size in
[quoted text clipped - 16 lines]
>>>try to run this application under Windows 2003-64 for AMD64. How can run
>>>my application under AMD64?
Mikhail Pilin - 14 Sep 2005 08:35 GMT
I write following simple test to catch StackOverflowException in C#
application. As a result it is work under v1.1.4322, but do not work at all
under framework v2.0.50215 for both IA32 and AMD64 platforms.

using System;
namespace StackOverflowTest
{
   internal class Program
   {
       private static void Recurse()
       {
           Recurse();
       }
       internal static void Main(string[] args)
       {
           try
           {
               Recurse();
           }
           catch (StackOverflowException)
           {
               Console.WriteLine("StackOverflowException has been
catched");
           }
       }
   }
}
Willy Denoyette [MVP] - 14 Sep 2005 22:52 GMT
Works for me using 2.0.50727.
Note that the CLR doesn't guarantee that StackOverflowException can be
catched, if your stack guard page is overwritten, there is simply no space
left to handle the exception.

Wily.

PS. I would strongly suggest you post Beta2 issues to the forums for Whidbey
at http://forums.microsoft.com
This NG is for released versions of the framework.

>I write following simple test to catch StackOverflowException in C#
>application. As a result it is work under v1.1.4322, but do not work at all
[quoted text clipped - 23 lines]
>    }
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.