NETworkManager icon indicating copy to clipboard operation
NETworkManager copied to clipboard

scanf APIPA address and subnet mask cause crash./扫描APIPA地址和子网掩码导致程序崩溃

Open AHLLX opened this issue 1 year ago • 3 comments

Describe your issue: I'm using Win11 with msi to install NWM directly, and using the IP scanner to scan the APIPA address with the subnet mask attached causes the program to crash.

我使用Win11用msi直装NWM,使用IP扫描器扫描APIPA地址附加子网掩码就会导致程序崩溃。

NETworkManager version: Version:2024.6.15.0

Windows version (like 10.0.x.x): Win11 prof 22635.2915

.NET version (like 6.0.x): 8.0.1 9318f01e-c8c8-4bb7-acb3-3ca373c129b1 dd6cdbc7-7ab4-46e4-838d-ed8489b7c7e0

AHLLX avatar Jul 11 '24 09:07 AHLLX

Can you send me the crash report from %LocalAppData%\NETworkManager\NETworkManager.log (or in the eventlog > Applications - if the log file is empty)

BornToBeRoot avatar Jul 11 '24 11:07 BornToBeRoot

Can you send me the crash report from %LocalAppData%\NETworkManager\NETworkManager.log (or in the eventlog > Applications - if the log file is empty)

brand new log text here↓ NETworkManager.log

AHLLX avatar Jul 12 '24 03:07 AHLLX

2024-07-12 11:00:25,518 [1] FATAL NETworkManager.App - Unhandled exception occured!
2024-07-12 11:00:25,557 [1] FATAL NETworkManager.App - Exception raised by: System.InvalidOperationException: Failed to compare two elements in the array.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at NETworkManager.Utilities.IPAddressHelper.CompareIPAddresses(IPAddress x, IPAddress y)
   at NETworkManager.ViewModels.IPScannerViewModel.<>c.<.ctor>b__61_0(IPScannerHostInfo x, IPScannerHostInfo y)
   at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)
   --- End of inner exception stack trace ---
   at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)
   at System.Windows.Data.ListCollectionView.AdjustBefore(NotifyCollectionChangedAction action, Object item, Int32 index)
   at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at NETworkManager.ViewModels.IPScannerViewModel.<>c__DisplayClass98_0.<HostScanned>b__0()
   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.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 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.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at NETworkManager.App.Main()

BornToBeRoot avatar Jul 12 '24 09:07 BornToBeRoot

Hi @AHLLX,

i was able to reproduce the issue. A fix is included in the next (pre-)release!

BornToBeRoot avatar Dec 22 '24 18:12 BornToBeRoot