stackoverflowexception

How do I prevent and/or handle a StackOverflowException? (C#)

I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writing. The problem seems to be that the user can write an Xsl script that is infinitely recursive, and it just blows up on the call to the Transform method. (That is, th...

StackOverflowException caused by a linq query

edit #2: Question solved halfways. Look below As a follow-up question, does anyone know of a non-intrusive way to solve what i'm trying to do below (namely, linking objects to each other without triggering infinite loops)? I try to create a asp.net-mvc web application, and get a StackOverFlowException. A controller triggers the follo...

StackOverflowException serializing a .netTiers entity

I have a simple WCF service: public Order[] GetOrdersByStatus(int statusid) { OrderService os = new OrderService(); TList<Order> orders = os.GetByOrderStateID(statusid); return orders.ToArray(); } when this returns it throws a StackOverflowException in mscorlib. Any idea what could be causing this? The OrderService is a...

Many returned records cause stackoverflow with Hibernate

If there are many return records from DB. It will get stackoverflow problem. User is a class, which has a one to many relationship (to 3 other classes). When I print out the SQL, i found that the system runs the same query many time to get the data from DB. Does anyone know what the problem is? result.addAll(getCurrentSession().cr...

operator ThisClass() causing stack overflow

I want to keep the class simple and not defined a constructor so i can do Pt data = {0, 5}; so i figured the best way convert Pt_t from a short to long or vice versa is to do something like this. template <class T> struct Pt_t { T x, y; template <class T2> operator Pt_t<T2>() { Pt_t pt = {x, y}; return pt; } }; The compiler do...

How can I guarantee catching a EXCEPTION_STACK_OVERFLOW structured exception in C++ under Visual Studio 2005?

Background I have an application with a Poof-Crash[1]. I'm fairly certain it is due to a blown stack. The application is Multi-Threaded. I am compiling with "Enable C++ Exceptions: Yes With SEH Exceptions (/EHa)". I have written an SE Translator function and called _set_se_translator() with it. I have written functions for and set...

How to get more than 1000 items in HSQLDB in CASE WHEN statement?

I'm running the following query in Hypersonic DB (HSQLDB): SELECT (CASE foo WHEN 'a' THEN 'bar' WHEN 'b' THEN 'biz' .... ELSE 'fin' END ) FROM MyTable LIMIT 1 When the number of "WHEN" clauses exceeds about 1000, I get a Java StackOverflowError thrown by the JDBC driver in org.hsqldb.jdbc.Util.sqlException(). Here's the reall...

Could this simple C# code result in a stack overflow?

I have a class library that mainly logs the string to text file. One of its method is LogString(string str) so I'm just wondering based on the function below if I call it for many times like over 600 times, does it cause stackoverflow? public void LogString(string str) { try { if (filePathFilenameE...

stack overflow exception using template asp.net

We are using FW2.0 web application which is developed using VS2005. Our win2003 server had Windows update on last week with FW3.5 SP1, after that we struck-up in web application login issue. Basically our application works with both windows authentication as well anonyms But after install the FW3.5 SP1, the windows integrated authenti...

debug stack overflow in windows?

So I'm trying to debug this strange problem where a process ends without calling some destructors... In the VS (2005) debugger, I hit 'Break all' and look around in the call stacks of the threads of the misteriously disappearing process, when I see this: This definitely looks like a SO in the making, which would explain why the proce...

StackOverflowException without recursion or infinite loop?

Hello, Background I have a DataGridView control which I am using, and I added my handler below to the DataGridView.CellFormatting event so the values in some cells can be made more human-readable. This event handler has been working great, formatting all values without issue. Recently however, I have discovered a very rare circumstan...

Help catching StackOverflowException with WinDbg and ADPlus

Short Version I want an ADPlus script that will do a full memory dump on the first-chance StackOverflowException, before anything is cleaned up, and ignore all other exception types. Log Version After a release of new ASP.NET code, we started getting intermittent StackOverflowExceptions. We've looked for infinite recursions and all t...

How can I avoid this infinite loop?

It feels like there must be some semi-simple solution to this, but I just can't figure it out. Edit: The previous example showed the infinite loop more clearly, but this gives a bit more context. Check out the pre-edit for a quick overview of the problem. The following 2 classes represent the View-Models of the Model View View-Model (...

Stack overflow when replacing ' with '' in VB 6.0

I'm looking into some legacy VB 6.0 code (an Access XP application) to solve a problem with a SQL statement by the Access app. I need to use replace single quotes with 2 single quotes for cases where a customer name has an apostrophe in the name (e.g. "Doctor's Surgery": Replace(customerName, "'", "''") Which will escape the single qu...

How do you change default stack size for managed executable.net

We have discovered that one of our auto generated assemblies is throwing a StackOverflowException on new(). This class has (bear with me please) 400+ simple properties that are initialised (most by default(string) etc) in a constructor. We notice that its fine on 64 bits but on 32 bits it goes bang! We need to test if it's reasonable ...

Is there a way to detect and debug circular references when using StructureMap?

Lately I've been using a larger number of smaller objects, because they are simpler and easier to reuse. Most of the time there isn't any problem injecting these objects into one another using StructureMap (great tool, btw). But occasionally, I f*** up, and I get myself a nice circular reference in the guise of a stack overflow excepti...

What is a stack overflow?

What is a stack overflow error? What type of programs/programming languages is it likely to occur in? Is it unlikely to occur in web application code? ...

Why this Linq code always throws System.StackOverflowException?

//A query to a local object var deletionCommands = commands .Where(a => a.Operation != Operation.Addition) .Select(a => new { a.Prestador.cod_prestador, a.Prestador.cod_desdobramento }) ; //A Linq-To-SQL query var toDelete = db.Prestadors .Where(a => deletionCommands.Contains(new { a.cod_prestador, a.cod_desdobram...

Why is my swf causing the Flash Player to crash.

I've got a flex-based swf, which is loading an AS 2-based swf and then, negotiating further activity via a LocalConnection. From time to time, the AS 2-swf can request that the flex-based swf load a movie. I've arranged this via on(release){} functions. The AS 2-swf, I'm making in Swish Max. In Swish, when i set the on (release) on a ...

Why do I get a StackOverflowException when I specify the size of an INTEGER array to be 200,000,000?

200,000,000 is much less than the maximum 32-bit INTEGER, 2,147,483,647. ...