473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Stack Overflow Exception

Hi there,
all was going well with my first C# project until now as I am
getting a Stack Overflow exception. I haven't seen one of those since DOS
programming days and back then all you did was up the stack size. How do I
get around this in .Net?
Nov 16 '05 #1
7 18573
Gorge Bush <bi********@microcock.cum> wrote:
all was going well with my first C# project until now as I am
getting a Stack Overflow exception. I haven't seen one of those since DOS
programming days and back then all you did was up the stack size. How do I
get around this in .Net?


Chances are it's because you've got a recursive property, eg:

string Foo
{
get { return Foo; }
}

I suggest you track down the last call you can make before the
overflow, and hopefully it'll be obvious.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Gorge,

Chances are this is the result of some sort infinite loop/recursion.
Can you post the code that does it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Gorge Bush" <bi********@microcock.cum> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi there,
all was going well with my first C# project until now as I am
getting a Stack Overflow exception. I haven't seen one of those since DOS
programming days and back then all you did was up the stack size. How do
I
get around this in .Net?

Nov 16 '05 #3
Hi,

This problem exist in all environment I can think of, if you write a
recursive method incorrectly you will get it, like

void Foo( parameters )
{
Foo( .... );
}

do u have any recursive method?

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Gorge Bush" <bi********@microcock.cum> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi there,
all was going well with my first C# project until now as I am getting a Stack Overflow exception. I haven't seen one of those since DOS
programming days and back then all you did was up the stack size. How do I get around this in .Net?

Nov 16 '05 #4
Found it! In the code for setting a property, I was refering to the
property name instead of the member variable.

Thanks for the speedy replies.
Nov 16 '05 #5
you probably have a recursive call that doesn't end. look at the call stack
and identify which method, operator overload, or most likely property is the
offender.

"Gorge Bush" wrote:
Hi there,
all was going well with my first C# project until now as I am
getting a Stack Overflow exception. I haven't seen one of those since DOS
programming days and back then all you did was up the stack size. How do I
get around this in .Net?

Nov 16 '05 #6

Can you trace the overflow to a specific call? I've seen the good old stack
overflow a couple times in my .Net experience, and it's usually been because
of an infinite loop or a local variable having the same name as a property.

Give us a code sample and we may be able to spot it for you.

-James
"Gorge Bush" wrote:
Hi there,
all was going well with my first C# project until now as I am
getting a Stack Overflow exception. I haven't seen one of those since DOS
programming days and back then all you did was up the stack size. How do I
get around this in .Net?

Nov 16 '05 #7
Hi

Good to know you solve it,

Try to use the recommended naming convention as this will decrease the
likely of this to happen again.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Gorge Bush" <bi********@microcock.cum> wrote in message
news:uZ**************@tk2msftngp13.phx.gbl...
Found it! In the code for setting a property, I was refering to the
property name instead of the member variable.

Thanks for the speedy replies.

Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Aguilar, James | last post by:
Hello all, To begin, yes, this -is- a homework assignment. However, it is for my Algorithms class, and my instructor has given us explicit permission to use "expert" groups like newsgroups, so...
2
by: David W. Walker | last post by:
I am attempting to port a C code that runs OK on a number of Linux and Unix machines to Windows XP using Visual Studio C++. I have set the program up as a console application, but when I try to run...
1
by: Lee Greco | last post by:
A third party vendor has provided me a C++ .Net DLL, a .lib and all necessary ..h files, as well as a sample C++ .NET app that uses the DLL. The sample app needs the Stack Reserve Size set to...
5
by: jbix | last post by:
We have a stack overflow happening. We are NOT doing any recusion. We do have an object being created in Global that is being handed the Context (which I assume is specific to the request thread). ...
9
by: Eric Webster | last post by:
I have a fairly simple VB.Net program I'm developing that listens to data coming over the internet and processes it. The data comes in as events - the app is idle until another chunk of data comes...
5
by: samuraign | last post by:
Hi, My C-code is working properly in Cygwin. But when I run the same code in VC++ or LCC, I use to get stack overflow exception during run time. It is not entring into my function from testbench....
1
by: Aled Hughes | last post by:
Hi, I've discovered a stack-overflow crash scenario when using CWinformsDialog to show a managed UserControl as a dialog in MFC8. Basically all you have to do is press ESCape whilst the...
0
by: pawel.kedzior | last post by:
Hi One of the issues which AppDomains are facing is problem of unsecure code execution in a sandbox. One of its aspects are unhandled exceptions thrown inside domains - they should not...
1
by: SaimaAsif | last post by:
Working on discrete event simulator implemented using sorted list, for asunchronous coomunication. As I tried to put more than 10000 value in the loop. its giving me error of stack overflow...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.