Author Topic: crash detected deleting unit  (Read 647 times)

0 Members and 1 Guest are viewing this topic.

Offline zu Pferd

  • Hoplite
  • *
  • Posts: 18
crash detected deleting unit
« on: December 24, 2018, 02:02:40 PM »
Hello,

I just experienced a repetitious crash event while trying to delete units from army file.
There is no detailed error message but the generic Windows message that the program has stopped working....

premature report....it appear's if I pick "renumber ID's" in the pull down menu the crash does not happen
and I can delete

disregard

Thanks
« Last Edit: December 24, 2018, 02:05:58 PM by zu Pferd »


Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: crash detected deleting unit
« Reply #1 on: January 01, 2019, 11:35:26 AM »
I had a similar problem some times ago but then it was fixed: http://grogheads.com/forums/index.php?topic=22829.0

But I have done a test today and indeed the problem is back. Error message in the windows event log (sorry, French version):
Quote
Application : GSBPArmyEditor.exe
Version du Framework : v4.0.30319
Description : le processus a t arrt en raison d'une exception non gre.
Informations sur l'exception : System.InvalidOperationException
    System.Linq.Enumerable.SingleOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
    ArmyEditor.MainWindowViewModel.<get_DeleteCommand>b__61_0(ArmyEditor.UnitVM)

Informations sur l'exception : System.Reflection.TargetInvocationException
    System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
    System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
    System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
    GalaSoft.MvvmLight.Helpers.WeakAction`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.__Canon)
    GalaSoft.MvvmLight.CommandWpf.RelayCommand`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.Object)
    MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
    System.Windows.Controls.Primitives.ButtonBase.OnClick()
    System.Windows.Controls.Button.OnClick()
    System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
    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.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
    System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
    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.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
    System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
    System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
    System.Windows.Interop.HwndSource.InputFilterMessage(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)
    MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
    System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
    System.Windows.Application.RunDispatcher(System.Object)
    System.Windows.Application.RunInternal(System.Windows.Window)
    ArmyEditor.App.Main()

Version: 0.2018.09.05
Build date: 30 Oct 2018


Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: crash detected deleting unit
« Reply #2 on: January 01, 2019, 11:45:51 AM »
Renumbering IDs is solving the problem for me.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 349
Re: crash detected deleting unit
« Reply #3 on: January 01, 2019, 02:17:38 PM »
You should be able to delete, no problem.

Just took a look at this.
The seasons festivities mean I'm not totally sober right now.
But I can't reproduce this issue with the current version of code I have.
I found a different problem with the save file name, which I've fixed and pushed the changes.
That will be delivered the next time Ezra puts a copy of the installer on the server.

I'll take another look tomorrow.

Maybe an old version of one of the libraries was distributed somehow.

The background to that "old" bug:

The unit structure you see units represented in for the treeview relies on the xml file structure.
A unit has a collection of subordinates which in turn has a collection of subordinates and so on.
When you delete it needs to go find the parent unit in order to take your unit out it's list of subordinates.
This is done by taking the CO Id property and taking a look for a unit with a matching ID.
When that wasn't set or two match then bad things happen.

You could open an xml file using internet explorer ( or an xml editor ) and check the IDs of one of your files are OK.
Or
Just click the renumber button and it'll redo the ids.
Since you don't have the scenario editor yet, the specific ID of a unit doesn't matter so much so long as they are consistent within the hierarchy.
When we eventually distribute the scenario editor then it'll matter... But we'll hopefully have worked out what's happening and fixed anything needs fixing by then.

« Last Edit: January 07, 2019, 09:16:29 AM by Andy ONeill »

Offline zu Pferd

  • Hoplite
  • *
  • Posts: 18
Re: crash detected deleting unit
« Reply #4 on: January 06, 2019, 04:20:16 PM »
Holidays aside ...not quite recovered yet either, I thank you for the reply
Cheers


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 349
Re: crash detected deleting unit
« Reply #5 on: January 07, 2019, 09:20:00 AM »
Just to confirm.

The current version does a good impression of working fine for me.
I've added, deleted, saved, re-opened pasted etc.
Everything I can think of.
I couldn't find the problem.


Not that this is a 100% guarantee there's not a bug lurking there somehow.
I just can't find it if there is.

Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: crash detected deleting unit
« Reply #6 on: January 08, 2019, 01:58:21 PM »
But I have done a test today and indeed the problem is back.

Actually I think there was a problem because I used an old army file. Starting with a new army, deletion is working.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 349
Re: crash detected deleting unit
« Reply #7 on: January 09, 2019, 06:58:59 AM »
That would explain it then.

There definitely was a bug at one time.
AFAIK I fixed that and new units will get ID set.
That doesn't fix old files.
You'd need to renumber any old army file that you created with the bugged version.