Solved

Current thread is in a stack overflow state - random occurence

Posted on 2010-09-02
2
807 Views
Last Modified: 2012-05-10
Experts,
Here's my issue:
I have an ASP.Net 2.0 application running on an XP sp3 development laptop (Pentium M 1.86GHz 2GB RAM) using an SQL Server 2000 database and the IDE is VS2008.  This laptop has been used for 3 years and all software is up to date.  The application runs without any issues on this laptop and there are no issues within VS2008...the application builds normally, no warnings or errors on build, and has been running in production (Windows 2003 server) for nearly 4 years.

Recently I began testing the application on a new laptop (i7-720QM Quad Core 1.60GHz 6MB 4GB RAM) running Windows 7 Ultimate, SQL Server 2005, and VS2008 targeting the 2.0 framework.  The application builds without errors or warnings in the IDE and runs as expected on the laptop or when being debugged except:

- One page that is large (35,000+ lines of code) and produces a complex cost report is generating a "Cannot evaluate expression because the current thread is in a stack overflow state" error.  The error occurs at different locations in the code even though the same data queries are being used to produce the report.  Commenting out sections of the report only moves the error to another location!  If enough code is commented out the page runs without error...and it doesn't seem to matter which code is commented out.  If no code is commented out the error often occurs before the Page_Load event or just after the event begins.

Considering the application runs without problems on the XP laptop I have to think there is something going on with the new laptop's architecture...what I don't know and I'm not sure how to isolate this issue.

Any thoughts?
Thanks!

0
Comment
Question by:heathde
2 Comments
 
LVL 3

Accepted Solution

by:
Peter_Werner earned 500 total points
Comment Utility
I can imagine that the new OS has has a new API that uses more stack and that is enough to overflow the stack of your threads. Unfortunately you can't configure the default thread size. It is possible by some binary hacking and disabling system file protection, but that is hardcore hackery.

You could review your code and try to replace bigger local variables by global ones, but I can imagine it's not quite possible.

Another way is to create some wrapper code and roll your own threads.  If you create a thread you can specify the stack size.  http://support.microsoft.com/kb/932909

Another approach is to investigate the stack usage by Sysinternal's Process explorer
(check the stack usage in the working environment and in the crashing one).
http://support.microsoft.com/kb/932909
0
 

Author Comment

by:heathde
Comment Utility
Peter,
Thanks for the quick response and direction...the page does contain several large local arrays which may be the problem.  I didn't think stack size would be an issue on the new laptop but having read some stuff related to your post I can see that you might be right.  I'll look over the code and see what changes I can make.
Thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Article by: Lee
Windows 7 Ultimate and Enterprise (and 2008 R2) introduced a new feature you may not be aware of - Boot from VHD.   Boot from VHD (or what Microsoft refers to asNative Boot allows you to install Windows to a VHD (Virtual Hard Disk) file that is t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now