473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ContextSwitchDeadlock was detected

When I running my program in ste-by-step mode I get his error message, it
does not seem to apply when running in stand alone mode. What is the best to
debug this error message?

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x1a19d8 to
COM context 0x1a1b48 for 60 seconds. The thread that owns the destination
context/apartment is most likely either doing a non pumping wait or
processing a very long running operation without pumping Windows messages.
This situation generally has a negative performance impact and may even lead
to the application becoming non responsive or memory usage accumulating
continually over time. To avoid this problem, all single threaded apartment
(STA) threads should use pumping wait primitives (such as
CoWaitForMultipleHandles) and routinely pump messages during long running
operations.
Mar 14 '06 #1
4 12607
Good question that I'd like an answer to also. I got your error
message also today. I got a run time error on my target computer and
decided to process the data on my development computer and step through
it in the debugger to see exactly what was going wrong. Well I was
stepping through a perfectly benign for loop and at random times it
would either give the message you listed (about pumping, apartments,
and threads), or just hang. When it hung, it was supposed to step on a
perfectly fine code statement, like an endif statement or a boolean
test in an if statement. (The line of code that it would hang on would
vary from run to run.) Then it would make a sound like it was hitting
a breakpoint, even though the next statement didn't have a break point
set there. There was no yellow arrow, no highlighted line of code,
nothing. If I clicked on the Go triangle again, it would say, from a
balloon in the task tray,

"Microsoft Visual Studio Delay Notification
Microsoft Visual Studio is waiting for an internal operation to
complete. If you regularly encounter this delay during normal usage,
please report this problem to Microsoft."

The only way to get out of it was to kill off my app's executable that
was running (via Task manager or right-clicking in the task bar and
saying "Close Group". Then it would return to the development
environment.
I went to lunch and came back and then everything was OK - I couldn't
get anything strange to happen again. This after hours of pumping and
waiting messages before lunch! I still don't know what happened. Let
me know if anyone else has encountered these strange messages.

Mar 28 '06 #2
I post a bug mesage to the Express Website. So far no one has gotten back to
me. I can tell you that a Reboot will prolong the tiem between error
messages.

<ha******@hotmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Good question that I'd like an answer to also. I got your error
message also today. I got a run time error on my target computer and
decided to process the data on my development computer and step through
it in the debugger to see exactly what was going wrong. Well I was
stepping through a perfectly benign for loop and at random times it
would either give the message you listed (about pumping, apartments,
and threads), or just hang. When it hung, it was supposed to step on a
perfectly fine code statement, like an endif statement or a boolean
test in an if statement. (The line of code that it would hang on would
vary from run to run.) Then it would make a sound like it was hitting
a breakpoint, even though the next statement didn't have a break point
set there. There was no yellow arrow, no highlighted line of code,
nothing. If I clicked on the Go triangle again, it would say, from a
balloon in the task tray,

"Microsoft Visual Studio Delay Notification
Microsoft Visual Studio is waiting for an internal operation to
complete. If you regularly encounter this delay during normal usage,
please report this problem to Microsoft."

The only way to get out of it was to kill off my app's executable that
was running (via Task manager or right-clicking in the task bar and
saying "Close Group". Then it would return to the development
environment.
I went to lunch and came back and then everything was OK - I couldn't
get anything strange to happen again. This after hours of pumping and
waiting messages before lunch! I still don't know what happened. Let
me know if anyone else has encountered these strange messages.

Mar 28 '06 #3
ContextSwitchDeadlock is one of several new Machine Debugging
Assistants (MDA). It is not compiled into release builds so that's
probably why you don't see them outside of the debugger. It can be
disabled via the config file.

<http://msdn2.microsoft.com/en-us/library/d21c150d(en-us,VS.80).aspx>

Brian

ha******@hotmail.com wrote:
Good question that I'd like an answer to also. I got your error
message also today. I got a run time error on my target computer and
decided to process the data on my development computer and step through
it in the debugger to see exactly what was going wrong. Well I was
stepping through a perfectly benign for loop and at random times it
would either give the message you listed (about pumping, apartments,
and threads), or just hang. When it hung, it was supposed to step on a
perfectly fine code statement, like an endif statement or a boolean
test in an if statement. (The line of code that it would hang on would
vary from run to run.) Then it would make a sound like it was hitting
a breakpoint, even though the next statement didn't have a break point
set there. There was no yellow arrow, no highlighted line of code,
nothing. If I clicked on the Go triangle again, it would say, from a
balloon in the task tray,

"Microsoft Visual Studio Delay Notification
Microsoft Visual Studio is waiting for an internal operation to
complete. If you regularly encounter this delay during normal usage,
please report this problem to Microsoft."

The only way to get out of it was to kill off my app's executable that
was running (via Task manager or right-clicking in the task bar and
saying "Close Group". Then it would return to the development
environment.
I went to lunch and came back and then everything was OK - I couldn't
get anything strange to happen again. This after hours of pumping and
waiting messages before lunch! I still don't know what happened. Let
me know if anyone else has encountered these strange messages.


Mar 28 '06 #4

Brian Gideon wrote:
Machine Debugging Assistants (MDA).


Err. Managed Debugging Assistants.

Mar 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chandika | last post by:
Hi all, One of my database was suspected, So I try to recover database then it gives this error Err. 823 Torn Page Detected 823, ... 24, spid51 i/o error Torn Page (Detected) during read...
3
by: Tim Reynolds | last post by:
I support a .Net application running on a SERVER accessing MF Db2 data. Occasionally, we have some type of connection problem that we have been unable to debug up to this point. We typically...
3
by: Laura | last post by:
I've just installed the DB2 Run-time client in a Solaris machine. Then I finnish the installation configuring the connection: 1. machine catalog was OK: ========================== $ db2 catalog...
32
by: Clunixchit | last post by:
How can i read lines of a file and place each line read in an array? for exemple; array=line1 array=line2 ...
0
by: Jesper | last post by:
Hi, In a single-threaded app I'm getting a ContextSwitchDeadlock MDA everytime I debug the app - in fact - I cant debug my app as I'm iterrupted by this funtionality before I can locate any...
1
by: Waldy | last post by:
Hi there, every time I try stepping through C# projects in VS 2005, I am plagued by the ContextSwitchDeadlock error messages. Is there any way of avoiding this?
7
by: Kalpana | last post by:
Hi, As iam working on convertion of C#1.1 to 2.0. Iam facing a problem (screen is flickered) while opening and closing any artifacts. When i tried to debug it is througing ContextSwitchDeadlock...
3
by: Benjamin Vigneaux | last post by:
Hello!! Well... this code works perfectly... what it does: It navigates a folder tree of N-Levels and it moves all the files from each folder to the root folder, then deletes the empty folders....
1
by: =?Utf-8?B?SkI=?= | last post by:
Hello As I debug the C# code with a break point and by pressing F11 I eventually get a message stating: ContextSwitchDeadlock was detected Message: The CLR has been unable to transition from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.