Find recursion

H

Hilton

Hi,

A couple of my customers have reported "StackOverflowException" - no stack
trace, cannot reproduce, outa luck. I gave myself 30 minutes and wrote some
code which found two methods in my EXE that had recursion; in both cases I
had called "this.XYZ" instead of "base.XYZ" in a "get".

I'd be happy to make the EXE available. Warning, it was written in under an
hour, not my best creation; i.e. it might not catch all recursion, hardly
tested at all, but it might help you - it sure as hell helped me. Let me
know if anyone is interested. Also, it there is any/sufficient interest,
I'd be happy to expand the functionality of it and fix bugs etc (within
reason :)).

Hilton
 
J

joker

That's interesting.

I've actually recently observed a condition where I had a method that
was overloaded. For example.

private void DoSomething(object o)
{
if (o is bool)
{
DoSomething((bool)o);
}
}

private void DoSomething(bool b)
{
// do all the work in this method.
}

This actually "sometimes" resulted in recursion. (I typed the above
code from memory, so if it isn't completly correct forgive me). I had
to solve the issue by renaming the method that accepted the bool.

I might be interested in the source of your program, but I'm too
chicken to accept exe's

Thanks,
 
H

Hilton

Hi,

In my case it was the simple case of "return this.Bla" instead of "return
base.Bla"

Hilton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top