Last active
October 19, 2021 08:16
-
-
Save WimObiwan/5d4e88316f6727cde8f96ac651c647b2 to your computer and use it in GitHub Desktop.
WinDbg troubleshoot deadlocks caused by WinForms STA-violations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* START EXE IN WINDBG | |
* Based on https://web.archive.org/web/20160223063851/http://blogs.msdn.com/b/dsui_team/archive/2012/10/31/debugging-windows-forms-application-hangs-during-systemevents.userpreferencechanged.aspx | |
sxe ld clrjit | |
g | |
.sympath srv*http://msdl.microsoft.com/download/symbols | |
.reload | |
.loadby sos.dll clr | |
* If above command fails, run ("g"), and one second later, press the break button. Then try the .loadby command again | |
!name2ee System_Windows_Forms_ni System.Windows.Forms.Application+MarshalingControl..ctor | |
* LOOK FOR "JITTED Code Address:" e.g. "JITTED Code Address: 647ad2b4" | |
* Replace "xxxxxxxx" by that address e.g. 647ad2b4 | |
bp xxxxxxxx ".echo MarshalingControl creation detected. Callstack follows.;!clrstack;.echo ==============================;gc" | |
g | |
* Analyze every output of "MarshalingControl creation detected. Callstack follows." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment