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? 7 18612
Gorge Bush <bi********@mic rocock.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.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
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.co m
"Gorge Bush" <bi********@mic rocock.cum> wrote in message
news:%2******** *******@tk2msft ngp13.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?
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********@mic rocock.cum> wrote in message
news:%2******** *******@tk2msft ngp13.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?
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.
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?
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?
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********@mic rocock.cum> wrote in message
news:uZ******** ******@tk2msftn gp13.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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 if that's your only reason not to help,
please do. Otherwise, I guess it's OK. But, just remember, I'm not asking
you to do my work for me, just to point out my error.
My problem is not with the algorithm itself (standard divide and conquer on...
|
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 it I get a stack overflow:
Unhandled exception at 0x0041e715 in NewMD.exe: 0xC00000FD: Stack overflow.
The call stack is:
NewMD.exe!_chkstk() Line 91
NewMD.exe!mainCRTStartup() Line 259 +0x19
|
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 2meg, as well as a few other Compiler and
Linker options set. I want to access the DLL's functionality in a C# app, so
I've wrapped the vendor's DLL in a new C++ DLL that publicly exposes managed
classes usable by C#. I've set the Stack Reserve Size...
|
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). This object does in turn does create several other objects, but therer is no memberwise cloning or deep copies. So, we are at a loss why we are running out of stack so early.
Is there a way to monitor the stack size at runtime to see if we can...
|
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 through. When it does, the app
looks to see what kind of data it is, and does something with it, such as
parse the data, write it to a file, ignore it, etc.
The code almost completes when it throws a stack overflow exception. The
code makes no...
| |
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.
My function consists of two inputs of each 8192 size of array.
And output too same.
Can any body give some suggestion.
Is it compiler problem or my code problem.
|
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 CWinFormsDialog is
in the process of being shown. A stack overflow occurs and the stack trace
shows that the MFC internal function "_AfxNextControl" is getting called
continually.
I've been able to easily recreate this behaviour in the "MFC04" sample
|
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 destabilize rest of
the application. And, it is truly possible to do that, however I can't
see any way to prevent from crashing the application when a stack
overflow exception appears inside a domain which is supposed to serve
as a sandbox.
|
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 exception. although I am not recursively calling any function plz help me its very important for me hanging for weeks for this...
using visaul C++ .Net
#include< math.h>
#include< time.h>
#include<List>
using namespace System;
using namespace...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |