473,320 Members | 1,572 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,320 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 12601
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.