Visual Studio: StackOverflow

R

Rob Meade

Hi all,

I think I may have created a bit of a problem earlier with some of my
classes....

I *think* that I may have inherited a class that was inheriting that class -
endless loop kinda scenario....although this wasn't built out of no where VS
pops this error up - whats more frustrating is that it does it now every
time i open the project in VS, its gives me an option to debug - yes, to
debug the deveng!!!! I'm not quite that advanced yet ... hehe..

Anyone got any ideas how I might recover my solution/project and get things
working again? I've tried amending the code in the files themselves but it
still fails...

Any help would be really appreciated.

Regards

Rob
 
B

Bruce Barker

vs has to load your components to implement intellesence and the
webdesigner. use the debbuger to find the bad component. once you know,
delete your dll's, so vs has nothing to load, then fix the bug in your code.
its bound to be the constructor of one of your objects.

-- bruce (sqlwork.com)
 
R

Rob Meade

...
use the debbuger

Hi guys,

Many thanks for the replies...I would love to try this, but I dont get given
the opportunity...

"my" code fails to load and initiates the debugger for VS (deveng etc) -
when you choose a debugger (doesn't matter which) - I then get another popup
which says..."disassembly cannot be displayed in run mode"....

This is followed by a popup which says "An unhandled exception of type
system.stackoverflowexception occured in mscorlib.dll.

When something does load its a load of numbers in one column down the page,
some kind of actions by the looks of it in the next, and the nvalues in the
third - I've never ever seen anything like this so have absolutely no idea
what it means...the line it queries is this one:

00000030 mov ebp,eax

Across the top of this page there's a tab which says "Disassembly" -
underneath that there's a drop down with the current value displaying
"System.strig.tochararray"

After closing the debugger VS then just sits there and hangs....I have to
end the process for deveng to get back into windows...
I am completely open to suggestions and advice!

Rob
 
S

Steven Berkovitz

Set a breakpoint somewhere early (like Page_Load) and step through it to see
whats causing your stack overflow.
 
R

Rob Meade

...
Set a breakpoint somewhere early (like Page_Load) and step through it to
see whats causing your stack overflow.

Argghhhhh!!!

hehe, you are all missing the point! I cannot put any break points in
because its Visual Studio that is dying, ie, I cannot fully open my project
to put a break point in to debug it - its the opening of hte project from
the START page in Visual Studio that causes the problem (well, thats where
it happens, its obviously my code not Visual Studio - but my point is the
same)...

Next! :eek:D

Rob
 
J

JIMCO Software

Rob said:
...


Argghhhhh!!!

hehe, you are all missing the point! I cannot put any break points in
because its Visual Studio that is dying, ie, I cannot fully open my
project to put a break point in to debug it - its the opening of hte
project from the START page in Visual Studio that causes the problem
(well, thats where it happens, its obviously my code not Visual
Studio - but my point is the same)...

Download the Microsoft Debugging Tools for Windows. (You can find them on
MSDN.) Attach cdb to the aspnet_wp.exe process (or w3wp process) in crash
mode. When the problem happens, it will generate a crash dump that you can
analyze in Windbg to see where the problem is.
 
R

Rob Meade

...
Download the Microsoft Debugging Tools for Windows. (You can find them on
MSDN.) Attach cdb to the aspnet_wp.exe process (or w3wp process) in crash
mode. When the problem happens, it will generate a crash dump that you
can analyze in Windbg to see where the problem is.

Hi Jim,

Cheers for the reply, currently downloading it now - sounds a bit
complicated but hopefully I'll get through it - I'll post up any problems I
have/find....

Wish me luck!

Oh, and I had a suggestion from a colleague to just create a new project and
import the various files that I needed for it - sound like a plan or just a
way to recreate the same problem with a new project?

Rob
 
R

Rob Meade

...
Download the Microsoft Debugging Tools for Windows. (You can find them on
MSDN.) Attach cdb to the aspnet_wp.exe process (or w3wp process) in crash
mode. When the problem happens, it will generate a crash dump that you
can analyze in Windbg to see where the problem is.

Hi Jim,

OK - installed, I dont have an option to "Attach cdb" but I do have an
option which says "Attach to process..." - I selected the aspnet_wp.exe
one - just to check though - my project has both a Webby part, and a windows
service - is it the same process for the windows service? Because nowt it
happening, VS still just kicks off and then gives me the option to debug
(choice of debuggers etc) - this new thing just sits there and does nowt -
made me think perhaps its attached to the wrong thing?

Regards

Rob
 
R

Rob Meade

...
Download the Microsoft Debugging Tools for Windows. (You can find them on
MSDN.) Attach cdb to the aspnet_wp.exe process (or w3wp process) in crash
mode. When the problem happens, it will generate a crash dump that you
can analyze in Windbg to see where the problem is.

I tried attaching it to the "deveng" - when I did that it just sat there, I
found an option that said "Goto unhandled exception" - I clicked that - I
got this in a popup window:

An exception 'System.StackOverflowException' has occurred in DefaultDomain.

However, a debugger that cannot handle the exception type is already
attached to the process.


The debugger in VS did previously give me content - not that I had any idea
what I was looking at - all I get with this is a grey screen - most likely
me not knowing what I'm looking at or what I should be doing with it but I
thought I'd followed your instructions thus far - any ideas Jim?

Thanks in advance for any further help.

Regards

Rob
 
J

JIMCO Software

Rob said:

Make sure that aspnet_wp.exe is running. Then go to a command prompt and
change into the directory where you installed the debugger. Run the
following command:

cscript adplus.vbs -crash -pn aspnet_wp.exe -quiet -o c:\aspnetdump

Once you see cdb on the task bar, reproduce your issue. When the stack
overflows, it will cause an AV in the process and it should create a crash
dump in the c:\aspnetdump folder. (Will be a file with a .dmp file
extension.)

Now you just need to open that dump file in Windbg and do a post-mortem
debug.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/DBGch04.asp?frame=true

If you can't figure it out, put the dump somewhere where I can get to it and
I'll analyze it for you.
 
R

Rob Meade

...

Make sure that aspnet_wp.exe is running.

check - I ran up a .net page that works...the exe is running..
Once you see cdb on the task bar, reproduce your issue.

saw the cdb on the task bar, opened VS, clicked on the link to the project.
When the stack overflows, it will cause an AV in the process
AV?

and it should create a crash dump in the c:\aspnetdump folder. (Will be a
file with a .dmp file extension.)

I have three files and a folder in there, but no dump file...loads of text
in the command window too...
Now you just need to open that dump file in Windbg and do a post-mortem
debug.

Not sure that I have the right file Jim :eek:(

Rob
 
R

Rob Meade

...
cscript adplus.vbs -crash -pn aspnet_wp.exe -quiet -o c:\aspnetdump

If I do that, but with devenv.exe instead I then reproduce the problem and
get 5 dump files....
 
R

Rob Meade

...
If you can't figure it out, put the dump somewhere where I can get to it
and I'll analyze it for you.

I just zipped up the contents of that folder it created and it weighs in at
113mb!!! I can make it available but are you sure you wanna download it?

Rob
 
R

Randall Parker

Rob,

A few ideas:

1) FIRST: Copy all your project somewhere else as backup.

2) Try deleting the dlls that you have built. You'll still have the source. Then try
to open the project.

3) Try selectively deleting subsets of your pages from your dirs and opening the project.

4) Try importing half your files into a new project and try closing and opening the
project. If that works then try copying in another quarter. Repeat the close and
open. See if you can narrow down to a file that causes the problem.
 
R

Rob Meade

...
2) Try deleting the dlls that you have built. You'll still have the
source. Then try to open the project.

Hi Randall,

Thanks for your reply. Its quite coincidental that I just tried this, as
soon as the dll's were gone the project opened again in VS!! It amazes me
that it was reading these at all when in a state of development, its seems
to be too easy to get yourself into one of these "round and round we go"
positions :(

Now all I have to do is try and find out what was going on!

Regards

Rob
 
R

Rob Meade

...
Now you just need to open that dump file in Windbg and do a post-mortem
debug.

Didn't have a lot of luck with the Windbg thing, as above, but when I opened
one of the files in notepad I saw this...

---
--- 1st chance DLL_Load exception ----
---------------------------------------------------------------
Sat Oct 29 22:25:55.302 2005 (GMT+1): System.Exception: An exception
occurred while trying to create an instance of
FrontPageHouseKeeper.FrontPageHouseKeeperBase. The exception was "Object
reference not set to an instance of an object.". --->
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.String.ToCharArray(Int32 startIndex, Int32 length)
at System.ServiceProcess.ServiceController.ValidServiceName(String
serviceName)
at System.ServiceProcess.ServiceBase.set_ServiceName(String value)
at System.ServiceProcess.ServiceBase..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
at FrontPageHouseKeeper.ApplicationConfiguration..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
at FrontPageHouseKeeper.ApplicationConfiguration..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
at FrontPageHouseKeeper.ApplicationConfiguration..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
at FrontPageHouseKeeper.ApplicationConfiguration..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
at FrontPageHouseKeeper.ApplicationConfiguration..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
at FrontPageHouseKeeper.ApplicationConfiguration..ctor()
at FrontPageHouseKeeper.FrontPageHouseKeeperBase..ctor()
[repeats for a VERY long time]

Not entirely sure where things have gone tits up but at least now, since
deleting the dll's I can open the project to have a look!..

Thanks for your help Jim - appreciated.

Regards

Rob
 
J

JIMCO Software

Rob said:
...


Didn't have a lot of luck with the Windbg thing, as above, but when I
opened one of the files in notepad I saw this...

That's it, Rob. You've just found the overflow.

AV means "access violates." That's what causes the process to crash.

If you want to point me to the dumps, I'll be glad to have a look as well,
but you've found the problem.

Keep this skill set handy. There are many times when this type of debugging
is what is required. You're only scratching the very thin surface here.
After a few years of doing it a lot, you can uncover just about any problem
using this method. Not many people know how to do it either. ;)
 
R

Rob Meade

...
One more thing. You need to load an extension into windbg to see the
managed stacks. That's all detailed in the link I sent you. If you want
something more high-level, I wrote an MSDN article on it as well:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;892277

Hi Jim,

Many thanks for all the info and links - I'll check it out.

Ironically, you maybe interested in the app I'm writing - well probably
not - but hey I'll tell you about it anyway :D

We run a clustered web service at work, IIS/Application Center 2000 - and
FPSE's...I'd noticed a while back that when we remove users in the Frontpage
Administration - it removes their permissions, but if you check the
permissions page again they are still listed, just with no access to the
side of it, so I've written a service which will periodically check the
_roles.ini files and correct them, ie remove the lines which have no access
levels granted to them. So far this has been working nicely, in addition
I've added support for an Active Directory lookup so that it will map NT
names to proper names, email addresses, phone numbers, dump them all the SQL
Server which then allows our "Webmasters" page to have a decent lookup.
I've just started expanding it to work on more than 1 web site - which is
when I encountered my lovely error! :eek:) I should now be able to map the
webiste ID (wsvc1 etc) to its name ("Default Web Site" etc), and then get
the list of Webmasters for each of the sites.

Neat huh - well I think so ;o)

Just thought I'd mention it as I know you write a lot of FP addins and
bobbins :eek:)

Regards

Rob
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top