[227] ContextSwitchDeadlock while debugging

Hello,

this seems to be a R# related exception because it occured during
debugging unit tests using R# unit testing feature after closing
QuickWatch dialog which was opened about three or four minutes. Sorry
that the exception text is in German, maybe you or someone else in this
forum could translate it. I have no time for that :(

ContextSwitchDeadlock was detected
Message: Die CLR konnte 60 Sekunden lang keinen Übergang vom COM-Kontext
0x1966d0 zum COM-Kontext 0x196560 durchführen. Der Thread, der Besitzer
des Zielkontexts/-apartments ist, wartet entweder, ohne Meldungen zu
verschieben, oder verarbeitet eine äußerst lang dauernde Operation, ohne
Windows-Meldungen zu verschieben. Eine solche Situation beeinträchtigt
in der Regel die Leistung und kann sogar dazu führen, dass die Anwendung
nicht mehr reagiert oder die Speicherauslastung immer weiter zunimmt.
Zur Vermeidung dieses Problems sollten alle STA-Threads
(Singlethread-Apartment) primitive Typen verwenden, die beim Warten
Meldungen verschieben (z.B. CoWaitForMultipleHandles), und bei lange
dauernden Operationen generell Meldungen verschieben.

Marco

4 comments
Comment actions Permalink

Hello Marco,

why do you care of this exception? It seems it is rather harmless...


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello,

this seems to be a R# related exception because it occured during
debugging unit tests using R# unit testing feature after closing
QuickWatch dialog which was opened about three or four minutes. Sorry
that the exception text is in German, maybe you or someone else in
this forum could translate it. I have no time for that :(

ContextSwitchDeadlock was detected
Message: Die CLR konnte 60 Sekunden lang keinen Übergang vom
COM-Kontext
0x1966d0 zum COM-Kontext 0x196560 durchführen. Der Thread, der
Besitzer
des Zielkontexts/-apartments ist, wartet entweder, ohne Meldungen zu
verschieben, oder verarbeitet eine äußerst lang dauernde Operation,
ohne
Windows-Meldungen zu verschieben. Eine solche Situation beeinträchtigt
in der Regel die Leistung und kann sogar dazu führen, dass die
Anwendung
nicht mehr reagiert oder die Speicherauslastung immer weiter zunimmt.
Zur Vermeidung dieses Problems sollten alle STA-Threads
(Singlethread-Apartment) primitive Typen verwenden, die beim Warten
Meldungen verschieben (z.B. CoWaitForMultipleHandles), und bei lange
dauernden Operationen generell Meldungen verschieben.
Marco



0
Comment actions Permalink

Hello Dmitry,

Hello Marco,

why do you care of this exception? It seems it is rather harmless...

Maybe it is. But maybe there is a bug in the unit testing feature
(debugging mode).

0
Comment actions Permalink

Hello Marco,

I doubt a situation where you get this warning can be called a bug. Rather,
it is
an interoperability issue - managed code gets executed at an unexpected moment,
if
I understand it correctly.

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello Dmitry,

>> Hello Marco,
>>
>> why do you care of this exception? It seems it is rather harmless...
>>

Maybe it is. But maybe there is a bug in the unit testing feature
(debugging mode).



0
Comment actions Permalink

This "Warning" is quite frequent when debugging managed code, if you have
another manage code object running in the background. I have found that
this annoying little item doesn't harm the system, it just causes your
testing environment to slow waaaaaaay down to the point of being
non-responsive. VSTO built add-ins are always doing this.

Regards,

Thaddaeus.
"Marco von Frieling" <nospam.fex@web.de> wrote in message
news:dvua3u$iq7$1@is.intellij.net...

Hello Dmitry,

>> Hello Marco,
>>
>> why do you care of this exception? It seems it is rather harmless...

Maybe it is. But maybe there is a bug in the unit testing feature
(debugging mode).



0

Please sign in to leave a comment.