Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Crash when opening config on VS2022 Preview 4.1
rgwood
#1 Posted : Thursday, September 30, 2021 5:22:10 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
NCrunch version: 4.9.0.8
VS version: 2022 Preview 4.1

Steps to reproduce:

1. Open VS (either a solution or without code), wait for NCrunch icon in bottom right to load
2. Press Alt-U to open NCrunch menu, select Configuration

After that, VS hangs for a bit then crashes. There is an Error event from the source ".NET Runtime" in the Application event log:
Quote:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ComponentModel.Win32Exception
at MS.Win32.UnsafeNativeMethods.GetWindowText(System.Runtime.InteropServices.HandleRef, System.Text.StringBuilder, Int32)
at System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(System.Windows.Media.Visual)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double, Double, Double, Double)
at System.Windows.Window.CreateSourceWindow(Boolean)
at System.Windows.Window.ShowHelper(System.Object)
at Microsoft.VisualStudio.PlatformUI.Shell.Controls.CustomChromeWindow.DwmOwnsBorderChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty, System.Object, System.Windows.PropertyMetadata, Boolean, Boolean, System.Windows.OperationType, Boolean)
at System.Windows.DependencyObject.SetValue(System.Windows.DependencyPropertyKey, System.Object)
at Microsoft.VisualStudio.PlatformUI.Shell.Controls.CustomChromeWindow.UpdateGlowBorder(Boolean, Boolean)
at Microsoft.VisualStudio.PlatformUI.Shell.Controls.CustomChromeWindow.WmNcCalcSize(IntPtr, IntPtr, IntPtr, Boolean ByRef)
at Microsoft.VisualStudio.PlatformUI.Shell.Controls.FloatingWindow.HwndSourceHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

Fixes attempted unsuccessfully:
1. Delete contents of %USERPROFILE%\AppData\Roaming\NCrunch
2. Uninstall/reinstall NCrunch
Remco
#2 Posted : Thursday, September 30, 2021 9:38:03 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,420

Thanks: 838 times
Was thanked: 1136 time(s) in 1062 post(s)
Thanks for sharing this issue.

At first glance this looks to me to be an internal VS problem which is probably being triggered by the NCrunch tool window. We're looking into it to see if there's anything that can be done about it from our side. Could you try removing any .user files for the relevant solution to see if resetting the tool window layout resolves it?
rgwood
#3 Posted : Thursday, September 30, 2021 11:28:12 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Thanks for the quick reply. Same result after deleting .user files and restarting VS.
Remco
#4 Posted : Thursday, September 30, 2021 11:32:59 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,420

Thanks: 838 times
Was thanked: 1136 time(s) in 1062 post(s)
rgwood;15678 wrote:
Thanks for the quick reply. Same result after deleting .user files and restarting VS.



Thanks, we're trying to reproduce this.

Can you confirm if any of the other NCrunch tool windows work for you? (i.e. Tests Window, Processing Queue, etc).
rgwood
#5 Posted : Thursday, September 30, 2021 11:41:06 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Tests Window: crash
Processing Queue: crash
Distributed Processing: crash
Submit Bug Report: opens correctly
LicenseDetails and About: opens window, window closes immediately thereafter (in much less than a second), does not crash
Remco
#6 Posted : Friday, October 1, 2021 5:16:36 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,420

Thanks: 838 times
Was thanked: 1136 time(s) in 1062 post(s)
We've conducted some in-depth testing around known scenarios here involving differences in VS install state and have been unable to reproduce this issue.

The following issue reports are extremely interesting:
https://github.com/dotnet/wpf/issues/4181
https://developercommunity.visualstudio.com/t/random-exceptions-in-windowautomationpeergetnameco/998916

Right now, it looks to me like there are two likely causes here:
1. Something external has implemented an O/S level hook that causes VS to crash when executing this code path. Because NCrunch triggers the code path due to its tool window, NCrunch indirectly triggers the crash.
2. There is a bug in VS which is surfaced by something in your install state, which causes it to crash when attempting to open tool windows created by packages.

In either case, there is nothing we can do on the side of NCrunch to resolve this problem. Presently we cannot reproduce it, which makes it impossible for us to engineer any kind of workaround, and as we don't have any code running in the affected code path, we can't implement a speculative fix.

I recommend removing any third party software you have installed that may implement WPF hooks (NCrunch doesn't do this). You might need to remove and reinstall VS.
1 user thanked Remco for this useful post.
rgwood on 10/2/2021(UTC)
rgwood
#7 Posted : Friday, October 1, 2021 6:03:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Thanks for the testing+investigation.

I've tried stopping software that seems like it might be using hooks (PowerToys, Power Automate, 1Password, SnagIt), no luck. Also tried disabling other VS extensions without any luck. I'll try reinstalling VS when I have time.
rgwood
#8 Posted : Friday, October 1, 2021 6:20:03 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Still crashing after a VS reinstall. Will keep trying to figure out what might be installing a hook.
rgwood
#9 Posted : Saturday, October 2, 2021 4:16:19 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
I've reinstalled Windows (to rule out any malware that might be installing that hook) but this issue is still occurring; seems like VS is the only remaining suspect.

I've filed an issue on Developer Community with crash logs etc.: https://developercommuni...-on-VS-2022-Prev/1544656
1 user thanked rgwood for this useful post.
Remco on 10/2/2021(UTC)
rgwood
#10 Posted : Tuesday, October 12, 2021 3:56:29 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/2/2020(UTC)
Posts: 8
Location: Canada

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
FYI this issue seems to have gone away after upgrading to Windows 11 (from whatever the latest stable version of Windows 10 before that was). Thanks again for looking into it.
1 user thanked rgwood for this useful post.
Remco on 10/13/2021(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.272 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download