Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Visual Studio .NET 2003 Hangs when clicking on a function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sam c - 09 Mar 2005 21:57 GMT
I have some code that looks a bit like this (note: this isn't the
actual code, it's just here in an attempt to help me explain what
actions I'm doing):

void foo(int bar1)
{
}

void foo(float bar2)
{

 foo(3);
}

If I move the cursor by mouse to the word "foo" on the line "foo(3)"
and then do any of the following:

 - press "control-f" to search for this function
 - hilite the word "foo" by double clicking it and then right click
with the mouse

Then .NET will hang.

It's actually interesting, because if I use the keyboard it seems to
avoid the hang in most cases.

I thought it was an intellisense problem, but I turned off every
intellisense option I could find, and I even tried making the .ncb file
for the solution read only (suggested somewhere else on this forum).

Anyone have any other ideas?  Unfortunately I have the bad habit of
doing silly things like clicking on functions with my mouse and then
searching for them, or trying to right click on them to "go to
definition".

thanks,
sam
David Lowndes - 10 Mar 2005 14:25 GMT
>I have some code that looks a bit like this (note: this isn't the
>actual code,

Sam,

Can you reproduce the problem in a new project?

Dave
sam c - 12 Mar 2005 02:38 GMT
Hi Dave-

I was able to narrow down the problem.  If I make a new project
(default win32 console application) and paste the following code into
the .cpp file containing the default implementation of "main()"(ie,
just replace everything in that file with this)

-------------------- begin cut ------------------

// crash2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

namespace BAZ
{

I32 Foo(Bar *byzA, Bar *byzB, Rame *res)
{
}

void Foo(Bar *in_byz, Bop *mosh, Bip *bip)
{
}

void Foo(Bar *in_byz, Bip *bip)
{
 Foo(&bez, (Bop *)jojo, bip);
}

} // namespace BAZ

-------------------------  end cut -------------------------------

Then here are the steps to cause the hang (I tested this on a few other
people's .NET installations here as well)

1)  Find the line "Foo(&bez, (Bop *)jojo, bip);"
2)  Double click the word "Foo" part the function name is hilited
3)  Press "control f" to initialize the find dialog  -OR- right click
on the selected "Foo" string and then select "Go To Definition" (I have
the option to initialize the find dialog based on what is hilited, so
that might be part of the reason it crashes when i hit "control-f" --
not positive about that though)
4)  Sit and wonder why .NET is hanging and if it is a part of
microsoft's secure computing initiative

Like I said, I've tried this on multiple different computers here and
it hangs on all of them..   The key part seems to be the fact that the
functions are sitting inside the namespace-- if I remove the namespace,
then it doesn't cause a hang.

Are you able to reproduce this at all on your end?  I'm still trying to
find an option somewhere that will prevent the hang... argh!

And just to be complete, here is the version info in the "About" window
for my visual studio .net install:

Microsoft Development Environment 2003 Version 7.1.3088
Microsoft .NET Framework 1.1 Version 1.1.4322 SP1
Microsoft Visual C++ .NET   69462-112-0090057-18350

-sam
Severian - 12 Mar 2005 04:31 GMT
>Hi Dave-
>
>I was able to narrow down the problem.  If I make a new project
>(default win32 console application) and paste the following code into
>the .cpp file containing the default implementation of "main()"(ie,
>just replace everything in that file with this)

<snip>

>Then here are the steps to cause the hang (I tested this on a few other
>people's .NET installations here as well)
[quoted text clipped - 23 lines]
>Microsoft .NET Framework 1.1 Version 1.1.4322 SP1
>Microsoft Visual C++ .NET   69462-112-0090057-18350

I haven't tested your particular program, but browse information can
cause some weird stuff. If your project is build with browse info,
rebuild the entire thing. If *parts* of your project are, but others
not, turn it all on or all off.

Also beware of any files on network drives that are unavailable; these
can cause seemingly interminable hangs just about anytime anywhere.

--
Sev
David Lowndes - 12 Mar 2005 09:05 GMT
>I was able to narrow down the problem.

Thanks Sam. I can repro it too.

>Then here are the steps to cause the hang (I tested this on a few other
>people's .NET installations here as well)
>
>1)  Find the line "Foo(&bez, (Bop *)jojo, bip);"

The first time I tried it, It hung for me even before this stage - all
I did was paste your code into the editor, switch to my newsreader to
read your instructions and then click back to VS and it was dead!

You might want to try a similar move yourself.

>Like I said, I've tried this on multiple different computers here and
>it hangs on all of them..   The key part seems to be the fact that the
>functions are sitting inside the namespace-- if I remove the namespace,
>then it doesn't cause a hang.

I'd suspect Intellisense as the culprit, but disabling the statement
completion settings doesn't resolve the problem for me - however,
trying the repro again, it then hung when I pressed Ctrl+F as you
described. I suspect the precise hang point may be timing as much as
anything else.

The only good news I have is that it doesn't occur in VS2005 B1.

I suggest that you contact MS support (phone). I'd be pretty confident
it's a bug so you shouldn't be charged, and they may know of a
work-around or have a patch available.

Dave
Signature

MVP VC++ FAQ: http://www.mvps.org/vcfaq

sam c - 18 Mar 2005 22:32 GMT
Just wanted to follow up on the thread..  I talked to Microsoft, it is
indeed a bug, and it will be fixed in visual studio service pack 1.
Until then, you're basically SOL!

-sam
David Lowndes - 21 Mar 2005 10:33 GMT
>Just wanted to follow up on the thread..  I talked to Microsoft, it is
>indeed a bug, and it will be fixed in visual studio service pack 1.
>Until then, you're basically SOL!

Thanks for the confirmation Sam.

I guess we'll see VS2005 RTM way before a VS2003 service pack.

Dave

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.