Solved

Current thread is in a stack overflow state - random occurence

Posted on 2010-09-02
2
822 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Peter_Werner earned 500 total points
ID: 33590432
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
ID: 33591551
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
Suggested Courses

626 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