Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Current thread is in a stack overflow state - random occurence

Posted on 2010-09-02
2
Medium Priority
?
825 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
Suggested Courses

660 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