Solved

Current thread is in a stack overflow state - random occurence

Posted on 2010-09-02
2
819 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

First some basics on Windows 7 Backup.  It has 2 components one is a file based backup which is stored in .zip files each zip is split at around 200 Megabytes and there is the Image Backup which is as the name implies a total image of the partition …
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
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 a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

751 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