dotnet / dotnet/winforms

[test] DragDrop tests are resulting in dotnet.exe process crash

Open
#8,598 5 comments 1 reaction 0 assignees View on GitHub
test-bug
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### Test

PictureBox_SetData_DoDragDrop_RichTextBox_ReturnsExptected_Async and possibly others in this file.

### Issue description

Although these crashes are not frequent, they happen often enough to impede the CI build process. As these crashes occur in dotnet.exe, our tests are unable to collect dumps or provide detailed logs or call stacks.

I manually setup lab machine and locally debugged to collect dumps. Below are the call stack:

```CS
System.Private.CoreLib.dll!System.ModuleHandle.ResolveMethodHandle(int methodToken, System.RuntimeTypeHandle[] typeInstantiationContext, System.RuntimeTypeHandle[] methodInstantiationContext) Unknown
System.Private.CoreLib.dll!System.Reflection.CustomAttribute.FilterCustomAttributeRecord(System.Reflection.MetadataToken caCtorToken, System.Reflection.MetadataImport scope, System.Reflection.RuntimeModule decoratedModule, System.Reflection.MetadataToken decoratedToken, System.RuntimeType attributeFilterType, bool mustBeInheritable, ref System.RuntimeType.ListBuilder derivedAttributes, out System.RuntimeType attributeType, out System.IRuntimeMethodInfo ctorWithParameters, out bool isVarArg) Unknown
System.Private.CoreLib.dll!System.Reflection.CustomAttribute.AddCustomAttributes(ref System.RuntimeType.ListBuilder attributes, System.Reflection.RuntimeModule decoratedModule, int decoratedMetadataToken, System.RuntimeType attributeFilterType, bool mustBeInheritable, System.RuntimeType.ListBuilder derivedAttributes) Unknown
System.Private.CoreLib.dll!System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeModule decoratedModule, int decoratedMetadataToken, int pcaCount, System.RuntimeType attributeFilterType) Unknown
System.Private.CoreLib.dll!System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeMethodInfo method, System.RuntimeType caType, bool inherit) Unknown
System.Private.CoreLib.dll!System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) Unknown
System.Private.CoreLib.dll!System.Diagnostics.StackTrace.TryResolveStateMachineMethod(ref System.Reflection.MethodBase method, out System.Type declaringType) Unknown
System.Private.CoreLib.dll!System.Diagnostics.StackTrace.ToString(System.Diagnostics.StackTrace.TraceFormat traceFormat, System.Text.StringBuilder sb) Unknown
System.Private.CoreLib.dll!System.Diagnostics.StackTrace.ToString() Unknown
System.Windows.Forms.Primitives.dll!System.DisposalTracking.Tracker.Tracker() Unknown
System.Windows.Forms.dll!System.Windows.Forms.GdiCache.ScreenGraphicsScope.ScreenGraphicsScope(ref System.Windows.Forms.ScreenDcCache.ScreenDcScope scope) Unknown
System.Windows.Forms.dll!System.Windows.Forms.GdiCache.GetScreenDCGraphics() Unknown
System.Windows.Forms.dll!System.Windows.Forms.ProfessionalColorTable.InitCommonColors(ref System.Collections.Generic.Dictionary rgbTable) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ProfessionalColorTable.InitSystemColors(ref System.Collections.Generic.Dictionary rgbTable) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ProfessionalColorTable.InitThemedColors(ref System.Collections.Generic.Dictionary rgbTable) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ProfessionalColorTable.ColorTable.get() Unknown
System.Windows.Forms.dll!System.Windows.Forms.ProfessionalColorTable.FromKnownColor(System.Windows.Forms.ProfessionalColorTable.KnownColors color) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ProfessionalColorTable.ToolStripBorder.get() Unknown
System.Windows.Forms.dll!System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ToolStripRenderer.DrawToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.OnPaint(System.Windows.Forms.PaintEventArgs e) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e, short layer) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(Windows.Win32.Foundation.HWND hWnd, Interop.User32.WM msg, Windows.Win32.Foundation.WPARAM wparam, Windows.Win32.Foundation.LPARAM lparam) Unknown
[Native to Managed Transition]
user32.dll!UserCallWinProcCheckWow() Unknown
user32.dll!DispatchClientMessage() Unknown
user32.dll!__fnDWORD() Unknown
ntdll.dll!KiUserCallbackDispatcherContinue() Unknown
win32u.dll!NtUserDispatchMessage() Unknown
user32.dll!DispatchMessageWorker() Unknown
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.Interop.Mso.IMsoComponentManager.FPushMessageLoop(nuint dwComponentID, Interop.Mso.msoloop uReason, void* pvLoopData) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Interop.Mso.msoloop reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Interop.Mso.msoloop reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form form) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog() Unknown
System.Windows.Forms.UI.IntegrationTests.dll!System.Windows.Forms.UITests.ControlTestBase.RunFormWithoutControlAsync(System.Func createForm, System.Func testDriverAsync) Line 291 C#
> System.Windows.Forms.UI.IntegrationTests.dll!System.Windows.Forms.UITests.DragDropTests.PictureBox_SetData_DoDragDrop_RichTextBox_ReturnsExptected_Async() Line 486 C#
[Native to Managed Transition]
[Managed to Native Transition]
xunit.execution.dotnet.dll!Xunit.Sdk.TestInvoker.CallTestMethod(object testClassInstance) Line 150 C#
```

Collected dump for reference is copied: [here](https://microsoft-my.sharepoint.com/:u:/p/dreddy/EfKugeWjwH9NrlmUnLyCg7oB_uTMWi24NaWAPR1VKYokHQ?e=iDy2fH)
IInstructions to get a lab machine to investigate: [here](https://microsoft.sharepoint.com/teams/MerriesWinFormsandSetup/_layouts/15/Doc.aspx?sourcedoc={9c3495c9-2312-4fdc-9646-fe584e74c138}&action=edit&wd=target%28WinForms%20Intro.one%7C752c4588-c7c2-4f2f-9436-0b0283b7d454%2FDebug%20test%20failure%20on%20lab%20machines%7C53206cb5-864a-4884-ae42-cead5469ea9b%2F%29&wdorigin=703)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.