VB.NET - Troubleshooting a StackOverflow Exception

How can I go about troubleshooting this exception?

It happens randomly, I'm running the IDE and app in the background and when it happens all I can see on the notice box is the StackOverflow Exception and the "ok" button... the rest of the box is black so I can't see any details, etc...

When this exception occurs how can I see what is causing it? I appears to highlight a function that is called (in light grey), but that function calls a variety of other subs & functions as well...
What is the best way to find out where this is happening exactly? (ApplicationEvents didn't log anything or add anything to the event viewer either)

I have no idea what could be causing this error :(

Hanging application TSN.exe, version, hang module hungapp, version, hang address 0x00000000.

Category: 101 Event ID: 1002
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hello, mcainc,

This sort of problem is sometimes a result of unterminated recursion.  Do any of your routines make recursive (or reentrant) calls?  If you can't pinpoint the problem by inspection, you may have to add some tracing lines to your code.  (It's slow and a bit old fashioned, but works.)


mcaincAuthor Commented:
hey randy,

my classes go kind of deep... call other classes, etc. it is an irc chat client (that allows for multiple connections) so there is a ton of stuff thats going on everywhere

i tried to profile the application with ANTS on a machine here... and when i came back the machine was locked up

this sucks, i wish there was a way to show me what function or object locked up

i guess i will try to add a ton of tracing lines to the app & its classes to see which one was fired last

would a try / catch be able to catch a stack overflow exception?
Hi, mcainc,

No, I think that try/catch can't handle this error.  I don't know the details, but the exception handling probably need some space on the stack in order to function.  I found some words in the following link that may be helpful in understanding this (and if you can work in C++ may even provde hope for catching the exception).


The fact that the problem seems to be random makes it doubly difficult to track down.  If you could find a circumstance where the problem was reliably reproduced it would help quite a lot.

You say that the application is very deep with multiple connections.  Is it possible that it actually requires more stack than what is available?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcaincAuthor Commented:
turns out it was a 3rd party dll that was acting up due to some malformed files it loaded... glad thats over!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.