Solved

Application stalled and now I get an exception?

Posted on 2014-01-10
8
277 Views
Last Modified: 2014-01-13
Not sure what caused this but my application stalled on startup so I stopped the execution and then restarted my app. When I got the point in the image it threw an exception (see attachment). Any ideas on why this happened and how to resolve it?

thanks,
Screenshot.jpg
0
Comment
Question by:BlakeMcKenna
  • 4
  • 3
8 Comments
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39772883
Hi BlakeMcKenna;

It is hard to tell from the exception dialog box. What is more helpful is to see if there is any inner exception which would be more meaningful. When you get this exception in the section of the dialog box "Action" click on Copy exception details to the clipboard then post that into a Code block, Code icon above. Also see if this is occurring in your code, "Make sure you do not have an infinite loop or infinite recursion. Too many method calls is often indicative of a very deep or unbounded recursion".
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39773364
Since this happens on the declaration of Private variables, it is outside of a method, so I would not look for recursion, even it if is the most common cause of a StackOverflowException.

We would need to see more of the code to understand what happens.

Could it be in the déclarations of a Structure? Structures should be small objects. Microsoft suggests no more than 16 bytes for a Structure. In such a case, changing the Structure to a Class could solve the problem
0
 

Author Comment

by:BlakeMcKenna
ID: 39776686
I figured it out. It was a Private declaration to instantiate a Form from the main assembly.

Public Class FileIndicator

     Private BH As New BusinessLayer.CalBusiness
     Private EH As New ErrorHandling.ErrorHandler

     Private frm As New frmEquipmentSetup    'Line in question

Open in new window


Not sure why this would do that. When I came to the line in question, it executed then went back up to the first declaration of the BH variable, which started an infinite loop. I don't understand why it would do that though?
0
Technology Partners: 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!

 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39776704
So this is what caused the error, "Make sure you do not have an infinite loop or infinite recursion. Too many method calls is often indicative of a very deep or unbounded recursion".

Good, glad to see you found it.
0
 

Author Comment

by:BlakeMcKenna
ID: 39776716
But I don't understand why it would execute that statement and then return to the top of the declarations?
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39776736
As far why that declaration was causing an infinite loop I would suspect that creating that form frmEquipmentSetup  makes a new  FileIndicator instance which call starts the infinite loop going.
0
 

Author Comment

by:BlakeMcKenna
ID: 39776940
that makes sense!

thanks
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39776952
Did you mark the correct post as the solution?
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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