srwi / EverythingToolbar

Everything integration for the Windows taskbar.
Other
9.87k stars 434 forks source link

Corrupt search term history file causes EverythingToolbar to crash #238

Closed ZzzzzzzSkyward closed 2 years ago

ZzzzzzzSkyward commented 2 years ago

Describe the bug Losing focus of Toolbar leads to explorer.exe crash.

Steps to reproduce

  1. click toolbar. Type or click, whatever you like.
  2. click elsewhere.

Expected behavior Should not crash.

Log file output Add the log file output from %TEMP%\EverythingToolbar.log below.

Log output ``` 2022-06-01 09:34:13.5519|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 09:34:14.0063|ERROR|IPC is not available.| 2022-06-01 09:34:14.0063|ERROR|Failed to get Everything version number. Is Everything running?| 2022-06-01 09:36:22.4031|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 09:36:22.5231|INFO|Everything version: 1.4.1| 2022-06-01 10:18:55.8991|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 10:18:56.0821|INFO|Everything version: 1.4.1| 2022-06-01 10:19:00.6258|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 10:19:00.8131|INFO|Everything version: 1.4.1| 2022-06-01 10:19:13.1598|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 10:19:13.3443|INFO|Everything version: 1.4.1| 2022-06-01 10:21:25.1208|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 10:21:25.3038|INFO|Everything version: 1.4.1| 2022-06-01 13:33:07.3407|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:33:07.4907|INFO|Everything version: 1.4.1| 2022-06-01 13:41:10.2449|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:41:10.3897|INFO|Everything version: 1.4.1| 2022-06-01 13:41:31.3789|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:41:31.5232|INFO|Everything version: 1.4.1| 2022-06-01 13:41:58.4701|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:41:58.6105|INFO|Everything version: 1.4.1| 2022-06-01 13:42:18.4557|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:42:18.5972|INFO|Everything version: 1.4.1| 2022-06-01 13:43:25.2203|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:43:25.4401|INFO|Everything version: 1.4.1| 2022-06-01 13:44:12.2764|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:44:12.5065|INFO|Everything version: 1.4.1| 2022-06-01 13:44:24.6470|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:44:24.8258|INFO|Everything version: 1.4.1| 2022-06-01 13:44:48.7132|INFO|EverythingToolbar started. Version: 0.7.4.0, OS: Microsoft Windows NT 10.0.17763.0| 2022-06-01 13:44:48.8967|INFO|Everything version: 1.4.1| ```
ZzzzzzzSkyward commented 2 years ago

System info: Windows 10 LTSC 1809(17763.2867), AMD x64.

srwi commented 2 years ago

Hi @ZzzzzzzSkyward, I just installed Windows 10 1809 in a vm and everything works as expected. Has it ever worked for you before or has it always crashed like this? Did you perform any noteworthy modifications to your Windows installation?

ZzzzzzzSkyward commented 2 years ago

If it works on a vm, then sounds like the problem lies in my Windows system. I've experienced other applications like Photoshop, Animate freezing after minutes, losing all their memory usage . I cannot determine where the problem is.

srwi commented 2 years ago

Could you please make EverythingToolbar crash again and then have a look at the system protocols to see if anything stands out there? You can find them if you hit Win+R, enter eventvwr.msc and navigate to Windows logs -> Application/System logs. You can sort by date and see if there is any correlation with the crashes.

ZzzzzzzSkyward commented 2 years ago

Here are the first log(in Chinese language):

日志名称:          Application
来源:            .NET Runtime
日期:            2022/6/8 20:13:09
事件 ID:         1026
任务类别:          无
级别:            错误
关键字:           经典
用户:            暂缺
计算机:           DESKTOP-97LQICD
描述:
应用程序: explorer.exe
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.Xml.XmlException
   在 System.Xml.XmlTextReaderImpl.Throw(System.Exception)
   在 System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[], Int32, Int32)
   在 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   在 System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   在 System.Xml.XmlReader.MoveToContent()
   在 Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1.Read1_ArrayOfString()

异常信息: System.InvalidOperationException
   在 System.Xml.Serialization.XmlSerializer.Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)
   在 EverythingToolbar.Helpers.HistoryManager.LoadHistory()
   在 EverythingToolbar.Helpers.HistoryManager..ctor()
   在 EverythingToolbar.Helpers.HistoryManager..cctor()

异常信息: System.TypeInitializationException
   在 EverythingToolbar.SearchBox.OnLostKeyboardFocus(System.Object, System.Windows.Input.KeyboardFocusChangedEventArgs)
   在 System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   在 System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   在 System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   在 System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   在 System.Windows.Input.InputManager.ProcessStagingArea()
   在 System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   在 System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject, Int32)
   在 System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject, System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean, Boolean)
   在 System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject, Boolean, Boolean, Boolean)
   在 System.Windows.Input.KeyboardDevice.ReevaluateFocusCallback(System.Object)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
   在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   在 MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   在 System.Windows.Threading.DispatcherOperation.Invoke()
   在 System.Windows.Threading.Dispatcher.ProcessQueue()
   在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

事件 Xml:

  
    
    1026
    2
    0
    0x80000000000000
    
    25567
    Application
    DESKTOP-97LQICD
    
  
  
    应用程序: explorer.exe
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.Xml.XmlException
   在 System.Xml.XmlTextReaderImpl.Throw(System.Exception)
   在 System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[], Int32, Int32)
   在 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   在 System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   在 System.Xml.XmlReader.MoveToContent()
   在 Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1.Read1_ArrayOfString()

异常信息: System.InvalidOperationException
   在 System.Xml.Serialization.XmlSerializer.Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)
   在 EverythingToolbar.Helpers.HistoryManager.LoadHistory()
   在 EverythingToolbar.Helpers.HistoryManager..ctor()
   在 EverythingToolbar.Helpers.HistoryManager..cctor()

异常信息: System.TypeInitializationException
   在 EverythingToolbar.SearchBox.OnLostKeyboardFocus(System.Object, System.Windows.Input.KeyboardFocusChangedEventArgs)
   在 System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   在 System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   在 System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   在 System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   在 System.Windows.Input.InputManager.ProcessStagingArea()
   在 System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   在 System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject, Int32)
   在 System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject, System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean, Boolean)
   在 System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject, Boolean, Boolean, Boolean)
   在 System.Windows.Input.KeyboardDevice.ReevaluateFocusCallback(System.Object)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
   在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   在 MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   在 System.Windows.Threading.DispatcherOperation.Invoke()
   在 System.Windows.Threading.Dispatcher.ProcessQueue()
   在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)


  

srwi commented 2 years ago

Thank you. On first glance it looks like maybe the history manager can't handle Chinese characters. Could you try deleting the file %LOCALAPPDATA%\EverythingToolbar\history.xml and also disable search term history in EverythingToolbar options and see if that gets rid of the crashes?

srwi commented 2 years ago

Also are you using an old version of .NET Framework? It looks like you have v4.0.30319 installed. EverythingToolbar requires at least v4.7. You can check your version explicitly like this: https://user-images.githubusercontent.com/14129585/104021832-ff36e080-5206-11eb-9f5f-10e4381992f9.jpg

ZzzzzzzSkyward commented 2 years ago

Also are you using an old version of .NET Framework? It looks like you have v4.0.30319 installed. EverythingToolbar requires at least v4.7. You can check your version explicitly like this: https://user-images.githubusercontent.com/14129585/104021832-ff36e080-5206-11eb-9f5f-10e4381992f9.jpg

That's weird, I have version 4.8 installed.

ZzzzzzzSkyward commented 2 years ago

I took a look at history.xml and it is full of NULL char(\0), maybe that's why xmlTextReader failed. Now after deleting history.xml, Everything Toolbar works fine! Chinese characters is properly displayed and saved. Therefore you may catch this exception to prevent from crashing. Thanks for your instruction.

srwi commented 2 years ago

Thank you. I will have a look at that!

ZzzzzzzSkyward commented 2 years ago

Thank you. I will have a look at that!

But...I guess it has nothing to do with Chinese characters? It's just \0 s. Maybe written by some older version of Everything Toolbar? Who knows.

srwi commented 2 years ago

But...I guess it has nothing to do with Chinese characters? It's just \0 s. Maybe written by some older version of Everything Toolbar? Who knows.

Yes, I also tried it with Chinese characters and it works as expected. However when corrupting the xml file in any way I could reproduce the issue. Since I don't know how your file ended up looking this way I am - for now - just catching and logging the error.

Please open another issue if the problems reappears for you so we can further diagnose it.

Thank you for your bug report and help!