microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.39k stars 6.56k forks source link

Crash while editing layout #10712

Closed jrichman-r7 closed 3 years ago

jrichman-r7 commented 3 years ago

Microsoft PowerToys version

0.35.0

Running as admin

Yes

Area(s) with issue?

FancyZones Editor

Steps to reproduce

Tried to edit a custom layout made with a previous version with non-sequential section numbers. Honestly, it's quite weird. I had sections 1, 2, 5, and 6 or something like that. I clicked on the edit layout button, and it crashed. I reproduced it a couple times before deleting the layout and re-creating it. Then it worked fine :)

✔️ Expected Behavior

To be able to edit the layout.

❌ Actual Behavior

It crashed.

Other Software

No response

crutkas commented 3 years ago

Having that layout would have been critical to repro. @enricogior, thoughts if we don't have the file?

enricogior commented 3 years ago

@jrichman-r7 can you search the Event Viewer -> Windows Logs -> Application for the error report?

jrichman-r7 commented 3 years ago

Hey all, wow you're responsive. Sorry for not attaching the error logs.

Here are the logs. It does seem to be related to the non-contiguous indices based on my quick overview ;)

Exception

System.ArgumentException: Indices in model.CellChildMap are not contiguous
   Source: FancyZonesEditor
   TargetAssembly: FancyZonesEditor, Version=0.35.0.0, Culture=neutral, PublicKeyToken=null
   TargetModule: FancyZonesEditor.dll
   TargetSite: Void ModelToZones(FancyZonesEditor.Models.GridLayoutModel)
   at FancyZonesEditor.GridData.ModelToZones(GridLayoutModel model)
   at FancyZonesEditor.GridData.FromModel(GridLayoutModel model)
   at FancyZonesEditor.GridData..ctor(GridLayoutModel model)
   at FancyZonesEditor.GridEditor.GridEditor_Loaded(Object sender, RoutedEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

Environment

jrichman-r7 commented 3 years ago

Here's the output of the event in Event Viewer:

Faulting application name: FancyZonesEditor.exe, version: 0.35.0.0, time stamp: 0x5e222541 Faulting module name: KERNELBASE.dll, version: 10.0.18362.1411, time stamp: 0xeb8644a5 Exception code: 0xc000041d Fault offset: 0x0000000000043b29 Faulting process id: 0x1fd4 Faulting application start time: 0x01d72fcb1905cceb Faulting application path: C:\Program Files\PowerToys\modules\FancyZones\FancyZonesEditor.exe Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll Report Id: ff005f47-a080-4b7e-b962-93fbe6b22609 Faulting package full name: Faulting package-relative application ID:

enricogior commented 3 years ago

Closing this in favor of https://github.com/microsoft/PowerToys/issues/10738