all groups > visual studio .net debugging > october 2007 >
You're in the

visual studio .net debugging

group:

Debugger hangs when breaking into event handler


Debugger hangs when breaking into event handler James Rosenfeld
10/23/2007 6:40:02 AM
visual studio .net debugging:
Greetings,

I'm having an issue where VS 2005's debugger hangs when entering an event
handler method for a DateTimePicker control. I have a pretty basic main form
that has a DateTimePicker in a tab control and I added an event handler for
the ValueChanged event. Initially I noticed this problem when testing that
code for the first time - an exception was thrown in the method and VS came
to the foreground, moved the caret to the line that threw the exception and
hung. Killing my application (after a minute or two of waiting) unfroze VS
and the exception assistant was displayed. I then tried setting a breakpoint
at the beginning of the method with the same result: VS came to the
foreground, highlighted the line of code, then hung until I killed my
application.

I experimented breaking into different places in my code; the
Application.Run() call, the main form Load event handler, and a button event
handler - all these worked normally. I'm running VS 2005 on Vista x64 with
VS SP1 and the Vista hotfixes installed.

RE: Debugger hangs when breaking into event handler jetan NO[at]SPAM online.microsoft.com (
10/25/2007 5:41:27 AM
Hi James,

We have several places to look for this type of issue.

First, have you set the symbol server in your VS2005 debugger? If so, it is
possible that the VS2005 debugger is trying to load symbols for the
application which caused the hang.

Second, there are 2 types of hang: low CPU hang and high CPU hang. You may
download Process Explorer from the link below to examine the CPU usage of
your VS2005 debugger to see if this is the low CPU or high CPU hang:
http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx

Third, I would suspect this is the low CPU hang. So it is very possible
that the VS2005 process is loading some files or registies. In this
situation, it is very informative to use "Process Monitor" from the link
below to check the file/registry activity of VS2005 at the time of the
hang. If the VS2005 process is keeping reading some files, these disk I/O
will certainly cause the hang:
http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx

Fourth, the debugging way to understand the hang is using a debugger to
break the VS2005 IDE and examine the call stack. I have written a blog
entry talks about how to debug the hang with windbg or Process Explorer:
"How to debug application crash/hang in production environment?"
http://blogs.msdn.com/msdnts/archive/2006/11/24/how-to-debug-application-cra
sh-hang-in-production-environment.aspx

Finally, have you tried this on a x86 Windows? Does this problem still
exist? If you create a new project on the 64bit Vista, can this problem be
reproduced?

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

RE: Debugger hangs when breaking into event handler jetan NO[at]SPAM online.microsoft.com (
10/30/2007 3:05:57 AM
Hi,

Have you reviewed my reply to you? Does it make sense to you? If you still
need help, please feel free to feedback, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

AddThis Social Bookmark Button