Solved

Application stalled and now I get an exception?

Posted on 2014-01-10
8
270 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 62

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
 
LVL 62

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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 62

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 62

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now